Platform: ubuntu on WSL
Trying to learn/understand ALSA by playing a wav file via aplay. It works via command:
# aplay -D sysdefault:CARD=wm8524audio ~/wav/taunt.wav
But not via:
# aplay -D hw:3,0 ~/wav/taunt.wav
Playing WAVE '/root/wav/taunt.wav' : Unsigned 8 bit, Rate 22257 Hz, Mono
aplay: set_params:1387: Sample format non available
Available formats:
- S16_LE
- S24_LE
- S32_LE
I did try using each of the suggested formats with -f, like
# aplay -D hw:3,0 ~/wav/taunt.wav -f S16_LE
Warning: format is changed to U8
Playing WAVE '/root/wav/taunt.wav' : Unsigned 8 bit, Rate 22257 Hz, Mono
aplay: set_params:1387: Sample format non available
Available formats:
- S16_LE
- S24_LE
- S32_LE
No idea what “Warning: format is changed to U8” means. Might be relevant.
FYI:
# aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=btscoaudio
bt-sco-audio, 30020000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0
Default Audio Device
sysdefault:CARD=imxspdif
imx-spdif, S/PDIF PCM snd-soc-dummy-dai-0
Default Audio Device
sysdefault:CARD=wm8524audio
wm8524-audio, HiFi wm8524-hifi-0
Default Audio Device
# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: btscoaudio [bt-sco-audio], device 0: 30020000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0 [30020000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: imxspdif [imx-spdif], device 0: S/PDIF PCM snd-soc-dummy-dai-0 [S/PDIF PCM snd-soc-dummy-dai-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: wm8524audio [wm8524-audio], device 0: HiFi wm8524-hifi-0 [HiFi wm8524-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: wm8524audio [wm8524-audio], device 1: HiFi-ASRC-FE (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
From some research, it seems that using the hw: specifier bypasses the asound config files. Therefore, I guess there’s config info in an asound config file that allows my device to play the wav when using id “sysdefault:CARD=wm8524audio”, but not “hw:3,0”. But, the default config file, /usr/share/alsa/alsa.conf is >600 lines of goodness. Can’t make heads of tails of it.
How can I find the info in the asound config file that allows it to work? How do I go about figuring out how to specify CLI args so that I can use hw: specifier?