6

I'm trying to set up my RPi with on-board sound out and a USB mic in, but everything I've found only deals with both audio i/o on the same (external) sound card. What's happening in my situation is that regardless of the default sound card I set, either one of aplay or arecord will fail with an error message that looks like: arecord: main:682: audio open error: No such file or directory (replace arecord with aplay if the default card is set to usb mic).

I know you can add the device name when running the command (arecord -Dhw:1,0 test.wav works, but arecord test.wav doesn't), but I would like that to not happen because I'm using a bunch of pre-compiled libraries that seem to only consider the default devices

EDIT:

For example, I have the following scenario:

in /etc/modprobe.d/alsa-base.conf, commenting out options snd-usb-audio index=-2 will allow arecord to work, but not aplay, and uncommenting the above line will allow aplay to work, but not arecord

1 Answer 1

4

adding an 'asymmetrical' ALSA device worked:

change the contents of /etc/asound.conf and ~/.asoundrc to the following:

pcm.!default {
    type asym
    playback.pcm "hw:0,0"
    capture.pcm "hw:1,1"
}

and sudo alsa force-reload for good measure

1
  • My journey started with ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave and after a few hours, I ended up here. Great fix, thx.
    – zipzit
    Commented Dec 28, 2016 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.