I have a USB microphone and speaker adapter connected to a Raspberry Pi 3. I have set up everything on alsamixer. I have also set the pcm.!default sysdefault:0
in file .asoundrc
in the home directory which sets the USB audio adapter as the default audio card.
I have run: aplay -l
and the output is:
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/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: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
I then set the pcm.!default sysdefault:0 in file .asoundrc
in the home directory.
When I run the command arecord -d 5 -r 48000 test.wav
I receive this error:
arecord: set_params:1233: Sample format non available Available formats: - S16_LE
The solution is to change .asoundrc
to this:
pcm.!default {
type plug
slave {
pcm "hw:1,0"
}
}
ctl.!default {
type hw
card 1
}
A generic configuration that works would be:
$ sudo nano ~/.asoundrc
pcm.!default {
type asym
playback.pcm {
type plughw
slave.pcm "output"
}
capture.pcm {
type plughw
slave.pcm "input"
}
}
pcm.output{
type hw
card 1
}
ctl.!default {
type hw
card 1
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With