I bought the following external usb sound card from Amazon for $7,- to integrate into my Video Doorbell project.
Note: This link above will point to the same sound card for only $4,-.
In order to do the setup I connected a micro-USB male to USB female adapter to my PI zero and made two small changes.
Please note though that I do intend to remove the USB plug all together and solder things together in the final setup.
1: Find the US sound card number ( in my case the USB card is card # 1 )
aplay -l **** List of PLAYBACK Hardware Devices **** card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA] Subdevices: 8/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0
2: create a file /etc/asound.conf with the following contents
pcm.!default { type hw card 1 } ctl.!default { type hw card 1 }
3: and finally test the speaker :
speaker-test -c2 -twav
This concluded the setup and testing. To use this external USB sound card in my project it had to fit tightly into the chassis which I built from scratch. So the USB plug had to come off and I had to solder some wires onto the card to connect t up to the Raspberry PI.
I am confused !
Why is a $4 udb adapter better than a $4 hat? – as you still need a speaker and microphone for both as far as I see