Connecting the card before boot then running dmesg shows that the card has been recognised. Running aplay -l (as root) lists both the internal and external cards, with the internal selected as default. I then tried editing /etc/modprobe.d/alsa-base.conf, replacing the line:
- Code: Select all
options snd-usb-audio index=-2
with
- Code: Select all
options snd-usb-audio index=0
options snd-bcm2835 index=-2
options snd-usb-audio nrpacks=1
This is supposed to disable the internal sound card, and force the USB card to default. Running aplay -l now results in this, which looks hopeful:
- Code: Select all
**** List of PLAYBACK Hardware Devices ****
card 0: Extigy [Sound Blaster Extigy], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Extigy [Sound Blaster Extigy], device 1: USB Audio [USB Audio #1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Extigy [Sound Blaster Extigy], device 2: USB Audio [USB Audio #2]
Subdevices: 1/1
Subdevice #0: subdevice #0
For some reason, the USB card has been listed three times. I think this might be either for 5.1 channel audio (with the three devices being front, rear and center, which each have their own plugs on the back of the card), or because the card has seperate analog, SPDIF and ToSLink outputs. Either way, trying to play something with aplay results in no sound from either the internal or external cards. So I tried specifying a device name:
- Code: Select all
sudo aplay -Dhw:0,0 song.wav
This worked better. I now get sound, but it's distorted with a continual crackling/rumbling sound, and everything plays at the wrong pitch. aplay shows this warning:
- Code: Select all
Warning: rate is not accurate (requested = 44100Hz, got = 48000Hz)
please, try the plug plugin
Not sure what the plug plugin is. If I try aplay with the same card on my main (Ubuntu) PC, it selects the correct sound card without the -D option, and plays back at the correct rate with no distortion or warnings. If I use the -D option on my main PC, I get the same warning as on the Pi, and the sound is also wrong (though this time it plays too fast/high pitched). So I'd guess using the -D tag is bypassing some software that converts the sample rate, but I don't know enough about ALSA to know whether this is actually the case or not. What I do know is that on my main PC, everything works fine if I don't use the -D option. On the Pi, leaving out -D gets no sound. So how do I get ALSA to select the correct device so I don't have to use -D?
