【问题标题】:Slave PCM not usable when using ALSA multi plugin使用 ALSA 多插件时,从属 PCM 不可用
【发布时间】:2020-06-26 06:54:00
【问题描述】:

我正在尝试使用multi ALSA 插件将我的桌面音频复制到snd-aloop 创建的Loopback 设备。然而,当我尝试使用下面的.asoundrc 时,我得到了这个错误:

> aplay -vv test.wav
Playing WAVE 'test.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo
ALSA lib pcm_params.c:2226:(snd1_pcm_hw_refine_slave) Slave PCM not usable
aplay: set_params:1314: Broken configuration for this PCM: no configurations available

.asoundrc:

pcm.both {
    type multi
    slaves.a.pcm "dmixer" 
    slaves.b.pcm "loop"
    slaves.a.channels 2
    slaves.b.channels 2

    bindings.0 { slave a; channel 0; }
    bindings.1 { slave a; channel 1; }
    bindings.2 { slave b; channel 0; }
    bindings.3 { slave b; channel 1; }
}

pcm.dmixer {
    type dmix
    ipc_key 1231
    ipc_perm 0666
    slave.pcm "hw:PCH,0"
    slave.channels 2
    slave.rate 48000
    slave.format S32_LE
    bindings {
        0 0 
        1 1
    }
}


pcm.loop {
    type dmix
    ipc_key 29637
    slave {
        pcm "hw:Loopback,0"
        rate 48000
        format S32_LE
        channels 2
        period_size 1024
        buffer_size 9182
    }
}

pcm.hubcap {
    type plug
    slave {
        pcm "hw:Loopback,1,0"
        rate 48000
        format S32_LE
    }
}

pcm.!default {
    type asym
    playback.pcm {
        type plug
        slave.pcm "both"
        ttable [
            [ 1 0 1 0 ]
            [ 0 1 0 1 ]
        ]
    } 
    capture.pcm "plug:dsnoop" 
}

defaults.pcm.surround21.card off
defaults.pcm.surround21.device off
defaults.pcm.surround40.card off
defaults.pcm.surround40.device off
defaults.pcm.surround41.card off
defaults.pcm.surround41.device off
defaults.pcm.surround50.card off
defaults.pcm.surround50.device off
defaults.pcm.surround51.card off
defaults.pcm.surround51.device off
defaults.pcm.surround71.card off
defaults.pcm.surround71.device off

注意事项:

当我删除两个dmixes 时,它工作正常。

multi 插件中,当我将两个从属更改为相同的 pcm 时,它适用于那个 pcm。

例如

...
type multi
    slaves.a.pcm "dmixer" 
    slaves.b.pcm "dmixer"
...

【问题讨论】:

    标签: alsa


    【解决方案1】:

    尝试在pcm.dmixer 块中设置slave.period_size 1024

    【讨论】:

      猜你喜欢
      • 2016-08-28
      • 2011-10-23
      • 2013-11-17
      • 2012-03-12
      • 2019-04-27
      • 2016-05-09
      • 2012-03-18
      • 1970-01-01
      • 2011-10-15
      相关资源
      最近更新 更多