Massive sound changes / fix (24/32bit pcm support, new sampling
rate converter, various fixes)
skywizard at MyBSD.org.my
Thu Jul 7 11:57:11 GMT 2005
On Thu, 7 Jul 2005 12:05:03 +0200
Alexander Leidinger <Alexander at Leidinger.net> wrote:
> On Thu, 7 Jul 2005 06:46:03 +0800
> Ariff Abdullah <skywizard at MyBSD.org.my> wrote:
> > System wide changes
> > ===================
> > 1. sys/soundcard.h
> > * Add definition for AFMT_(U|S)24_(B|L)E. This is somehow
> > contradict with OSS/Voxware definition of 24bit, but
> > anyway...
> Can you explain this a little bit more please? Being incompatible
> isn't good (I haven't looked at the files, so I may understand
> something wrong).
OSS define AFMT_x32_xE as:
1) 32bit data, packed within 32bit (4bytes) boundary.
2) 24bit data, packed within 32bit (4bytes) boundary where the data
is stored in the 24 most significant bits and least significant 8
bits are not used and should be set to 0.
While this might hold true in few cases, lots of application (notably
mplayer, sweep) really deal / produce 24bit as what they should meant
to be: 24bit data / 3bytes per sample. In this case, I have decided to
handle 24bit pcm separately so the in-kernel conversion space did not
confuse itself with 32bit variant.
Here is a hint for you: After applying the patch and replacing
/usr/include/sys/soundcard.h with the patched version
(/usr/src/sys/sys/soundcard.h), recompile mplayer, and use it to
*abuse* this new format. Something like:
mplayer -af resample=128000:0:0,format=u24be somefile..
This will let mplayer doing the conversion + resample from any ->
128khz/u24be and directly play it to /dev/dsp. Notice that the
in-kernel conversion *really* doing it job properly. Also note that,
mplayer 24bit seeking/pausing is buggy, they should do it within 24bit
I can't think of any other applications that really can play 24/32
bit pcm files *directly*, except mplayer. Most applications tend to do
conversion from 24bit to sign/float 32 for processing, notably
audacity, and to sign 16 le for playing.
Don't worry about incompatibilities. It doesn't break anything. You
don't have to recompile anything (except mplayer, and that is because
to enable the long-awaited disabled feature).
More information about the freebsd-multimedia