0

I have connected Logitech C310 webcam on USB port and my speaker audio jack to the on board audio jack on my Rpi2.

Now i want my alsa to use usb webcam to record audio and play the sound through speaker using the audio jack.

Cards:

$rpi2> cat /proc/asound/cards

     0 [ALSA           ]: bcm2835 - bcm2835 ALSA
                          bcm2835 ALSA
     1 [U0x46d0x81b    ]: USB-Audio - USB Device 0x46d:0x81b
                          USB Device 0x46d:0x81b at usb-3f980000.usb-1.3, high speed

Please help me to set this up.

Thanks/Tanvir

1

1 Answer 1

1

I have studied this link and found my solutions.

In my case the speaker directly connected to the Rpi and mic is connected through USB.

#cat /proc/asound/cards

 0 [ALSA           ]: bcm2835 - bcm2835 ALSA
                      bcm2835 ALSA
 1 [U0x46d0x81b    ]: USB-Audio - USB Device 0x46d:0x81b
                      USB Device 0x46d:0x81b at usb-3f980000.usb-1.3, high speed

Solution:

I have added bellow lines to my /etc/asound.conf

pcm.primary{
        type hw
        card 0
        device 0
}

pcm.secondary{
        type hw
        card 0
        device 1
}

Now i can record my voice using

arecord -d secondary rec1.wav

And Play using

aplay -D primary rec1.wav

As i understand this problem has many solutions and from them i choose my one which i feel easy for me.

Thanks all,

Tanvir

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.