I have a usb microphone and speaker adapter connected to a raspberry pi 3. I have setup everything on alsamixer. I have also set the pcm.!default sysdefault:0
in file .asoundrc
on 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 on the home directory.
When I run 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 :
pcm.!default {
type plug
slave {
pcm "hw:1,0"
}
}
ctl.!default {
type hw
card 1
}