[MPlayer-dev-eng] [patch] prefer ALSA over OSS
Nicolas George
nicolas.george at ens.fr
Thu May 3 19:11:21 CEST 2007
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);
- 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.
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.
And as a user with a somewhat exotic hardware configuration (an integrated
8-channels chipset connected to 5.1 speakers, an old PCI sound card
connected to headphones (less plugging and unplugging late at night), an USB
webcam with microphone), I like being able to control the sound output
through environment variables, for programs that lacks an ergonomic way to
set it up.
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070503/b022ce75/attachment.pgp>
More information about the MPlayer-dev-eng
mailing list