[alsa-devel] Bug in aplay?

Damien Zammit damien.zammit at gmail.com
Wed Dec 12 12:01:38 CET 2012


Hi,
I think i found a small bug in alsa utility "aplay".

If you have a sound device that supports the S24_3BE format natively,
and you have a wav file of the same format, aplay will not play it
because it detects the wrong format and assumes it is default format.
(ie 8000Hz Mono 1 channel).
I compiled my own version of aplay and it works because I hacked the
default format to match this format, but it is not the ideal solution.

pi at raspberrypi ~ $ aplay --version
aplay: version 1.0.25 by Jaroslav Kysela <perex at perex.cz>

pi at raspberrypi ~ $ aplay -D hw:1 48000-S24_3BE.wav
Playing raw data '48000-S24_3BE.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
aplay: set_params:1081: Sample format non available
Available formats:
- S24_3BE

My version:
pi at raspberrypi ~ $ ./aplay -D hw:1 48000-S24_3BE.wav
Playing raw data '48000-S24_3BE.wav' : Signed 24 bit Big Endian in
3bytes, Rate 48000 Hz, Stereo
aplay: set_params:1145: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S24_3BE
SUBFORMAT:  STD
SAMPLE_BITS: 24
FRAME_BITS: 48
CHANNELS: 2
RATE: 48000
PERIOD_TIME: 125000
PERIOD_SIZE: 6000
PERIOD_BYTES: 36000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 24000
BUFFER_BYTES: 144000
TICK_TIME: 0
pi at raspberrypi ~ $

This is making it tricky for me to use my sound card.  For some reason
it works better with jackd.  The error above is also a mystery to me,
but it seems to be detecting the format better.

Regards,
Damien


More information about the Alsa-devel mailing list