Alsa + dmix + microphone [SOLVED]

本文将探讨一个在配置alsa-lib时遇到的录音问题,详细解释了配置文件asoundrc中的设置,并提供了修复该问题的方法。通过调整配置文件中的参数,作者成功解决了无法录制声音的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I can play many sound at the same time but I can't record any sound using arecord: 

parpin@localhost parpin $ arecord -f cd -d 3 -t wav -N test.wav 
ALSA lib pcm_dmix.c:759:(snd_pcm_dmix_open) The dmix plugin supports only playback stream 
arecord: main:502: audio open error: Invalid argument

But when I remove my .asoundrc I can record. 
How can I fix this ? 
Here is my config: 

parpin@localhost parpin $ cat .asoundrc 
pcm.dmixer { 
    type dmix 
    ipc_key 1024 
    slave { 
        pcm "hw:0,0" 
        period_time 0 
        period_size 1024 
        buffer_size 8192 
   rate 44100 
    } 
  
    bindings { 
        0 0 
        1 1 
    } 
} 
  
pcm.dsp0 { 
    type plug 
    slave.pcm "dmixer" 
} 
  
pcm.!default { 
        type plug 
        slave.pcm "dmixer" 
} 
  
pcm.default { 
   type plug 
   slave.pcm "dmixer" 
} 
  
ctl.mixer0 { 
    type hw 
    card 0 
} 

parpin@localhost parpin $ qpkg -I -v | grep alsa 
media-libs/alsa-lib-1.0.0_rc2-r1 * 
media-libs/alsa-oss-1.0.0_rc2 * 
media-sound/alsa-utils-1.0.0_rc2 * 
media-plugins/alsa-xmms-0.9.12 * 

pwk on #alsa gave me a new /etc/asound.conf: 

pcm.dmixer { 
    type dmix 
    ipc_key 1024 
    slave { 
        pcm "hw:0,0" 
        period_time 0 
        period_size 1024 
        buffer_size 8192 
   rate 44100 
    } 
  
    bindings { 
        0 0 
        1 1 
    } 
} 

pcm.asymed { 
        type asym 
        playback.pcm "dmixer" 
        capture.pcm "hw:0,0" 
} 


  
pcm.dsp0 { 
    type plug 
    slave.pcm "asymed" 
} 
  
pcm.!default { 
        type plug 
        slave.pcm "asymed" 
} 
  
pcm.default { 
   type plug 
   slave.pcm "asymed" 
} 
  
ctl.mixer0 { 
    type hw 
    card 0 
}

https://forums.gentoo.org/viewtopic.php?p=958187

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值