0

I am running Google Assistant on my Pi (and an Imp) to open my door over voice control.

My problem is that I am using a 3.5mm speaker, in connection with a mic that is connected via an external soundcard over USB. I tried to create a new asound.conf with the required input (speaker hw: 0,0 and mic hw: 1,0 (which are correct, I checked them over aplay and arecord). But even though thats the case I will only ever get input OR output, depending on which device I put a checkmark as standard device (on the desktop loudspeaker icon).

1

You need to setup an asym card, which tells ALSA to record through hw:1 and play through hw:0.

You can create an asym card by creating the following .asoundrc file in your home directory :

pcm.!default {
    type asym
    playback.pcm "plughw:0"
    capture.pcm  "plughw:1"
}
ctl.!default {
        type hw
        card 0
}

ALSA by default will now play through hw:0 and record through hw:1. The reason why you use plughw is to make sure both input and output can use the same audio stream specifications - even if their hardware doesn't support it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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