【问题标题】:ALSA unable to use dmix with route [closed]ALSA 无法在路由中使用 dmix [关闭]
【发布时间】:2021-02-07 04:55:06
【问题描述】:

我有一个 alsa 配置文件,用于将立体声扬声器映射到我的 5.0 扬声器设置。

文件如下所示:

pcm.all8 {
    type plug
    slave {
        pcm "hw:0,0"
        channels 8
    }
    hint.description "8 channel analog"
}

pcm.music4 {
    type route
    slave {
        pcm all8
        channels 8
    }

    ttable {
      0.0 1
      1.1 1
      0.2 1    # Copy Front Left to Rear Left
      1.3 1    # Copy Front Right to Rear Right
      0.4 0.8  # Copy Front Left to Front Centre
      1.4 0.8  # Copy Front Right to Front Centre
    }

    hint.description "2 channels duplicated on front and rear"
}

我目前使用“music4”设备从一个程序播放音乐,但我现在需要第二个程序才能访问该设备。我需要使用 dmix,因为目前设备已锁定。

我尝试将此添加到配置中(我无耻地从 https://www.alsa-project.org/main/index.php/Asoundrc#dmix 复制):

pcm.dmixer  {
        type dmix
        ipc_key 1024
        slave {
                pcm music4
                period_time 0
                period_size 1024
                buffer_size 4096
                rate 44100
        }
        bindings {
                0 0
                1 1
        }

        hint.description "Dmixed - 4 speakers"
}

当我尝试使用此设备时,我收到一条错误消息,提示“dmix 插件只能连接到硬件插件”,但如何在保留映射的同时做到这一点?

【问题讨论】:

    标签: alsa


    【解决方案1】:

    设法解决了这个问题。解决方案如下所示:

    pcm.dmixer  {
            type dmix
            ipc_key 1024
            ipc_key_add_uid true
            slave {
                    pcm "hw:0,0"
                    period_time 0
                    period_size 1024
                    buffer_size 4096
                    rate 44100
                    channels 8
            }
    
            bindings {
              0 0
              1 1
              2 2
              3 3
              4 4
              5 5
              6 6
              7 7
            }
    
    
            hint.description "Raw dmixer - 8 channels"
    }
    
    pcm.dmix4 {
        type plug
        slave.pcm dmixer
        slave.channels 8
    
        ttable {
          0.0 1
          1.1 1
          0.2 1    # Copy Front Left to Rear Left
          1.3 1    # Copy Front Right to Rear Right
          0.4 0.8  # Copy Front Left to Front Centre
          1.4 0.8  # Copy Front Right to Front Centre
        }
    
        hint.description "Dmixed - 2 channels to 5.0"
    
    }
    

    【讨论】:

      猜你喜欢
      • 2013-08-10
      • 2010-12-15
      • 2011-10-29
      • 1970-01-01
      • 1970-01-01
      • 2021-09-06
      • 2012-09-13
      • 2020-02-08
      • 1970-01-01
      相关资源
      最近更新 更多