[MPlayer-dev-eng] [patch] prefer ALSA over OSS

Michael Niedermayer michaelni at gmx.at
Thu May 3 20:21:16 CEST 2007


Hi

On Thu, May 03, 2007 at 07:11:21PM +0200, Nicolas George wrote:
> Le quartidi 14 floréal, an CCXV, Ivan Kalvachev a écrit :
> > ALSA project haven't publically documented the API they use to
> > communicate with the ALSA kernel modules. So it is not standard and
> > ALSA could decide to change it at any moment.
> 
> Well, that is the whole point. They do not want to make it standard because
> they want the users to go through the library only. There are two reasons to
> that:
> 
> - For one, they think that
> 
>   snd_pcm_hw_params_set_rate(pcm, params, 48000, 0);
> 
>   is a cleaner way to talk than
> 
>   int rate = 48000;
>   ioctl(dsp, SNDCTL_DSP_SPEED, 48000);

anyone dislikeing ioctl() could always have a ANSI-C header which wraps the
calls in nicer function names, that would be 100% portable and trivial too


> 
> - For two, having an userland library allows to do some things that it would
>   be very bad taste to go in kernelspace, like parsing a configuration file,
>   loading plugins or altering the audio stream.

sure, but there are many ways to do advanced stuff, one is

audio card -> kernel -> lib (config files, plugnis),  -> user app

audio card -> kernel <-> lib(config files, plugins)    _ user app
                   \___________________________________/|

in the later case you have standard unix /dev/files and an entirely optional
library which you can uninstall if you dont need plugnis or "advanced"
features

to be a little more specific here, you could have
/dev/dsp files corresponding to the actual hardware and /dev/soft_dsp files
corresponding to the lib both with the same API
IMHO that would be cleaner


> 
> I have programmed a little both with OSS and ALSA, and I find that neither
> is really more agreeable than the other. And there is this huge point for
> ALSA: I do not have to worry whether the device will support the particular
> sample rate / channel count / sample format I need to use: the library will
> convert it on the fly if needed.

ALSA is like forcing all image/video access in linux through libsdl and to be
honest the mere thought scares me

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070503/be4951f1/attachment.pgp>


More information about the MPlayer-dev-eng mailing list