Add USB audio (playback and mic) support to Raspberry Pi

https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/instructions

Plug in USB audio card and boot Pi

dmesg | grep cm109
dmesg | grep Headphone
dmesg | grep C-Media
dmesg | grep General
dmesg | grep Jabra (*)

On Raspbian Stretch:

sudo nano /usr/share/alsa/alsa.conf

  1. defaults.ctl.card 0
  2. defaults.pcm.card 0

change 0 to 1

Playback

speaker-test -c2
sudo apt-get unstall mpg123
mpg123 http://ice1.somafm.com/u80s-128-mp3

List audio devices

aplay -l

To force a specific device/sub-device use the command below

speaker-test -c2 -D plughw:1,0
aplay –device=hw:1,0 test.wav

alsamixer – c 1

Recording

arecord –device=hw:1,0 –format S16_LE –rate 44100 -c1 test.wav
aplay –device=hw:1,0 test.wav

I want to buy Raspberry Pi and parts in the UK

I do not endorse nor do I receive any benefits in cash or kind for click throughs. Use at your own risk

These companies supply project kits