Alsa + dmix + microphone [SOLVED]

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

你可能感兴趣的:(Linux,嵌入式,ALSA)