[MPlayer-dev-eng] Practical outcomes of the ALSA thread

Thomas Orgis thomas-forum at orgis.org
Sat May 5 12:25:25 CEST 2007


Am Sat, 5 May 2007 10:50:26 +0200
schrieb Attila Kinali <attila at kinali.ch>: 

> On Fri, 4 May 2007 16:09:30 -0600
> Sven Gothel <sgothel at jausoft.com> wrote:
> 
> > so .. there must be a way in ALSA 
> > to determine who is capable of what:
> > 	alsa hw: freq/channels/..
> > 	alsa lib: ...
> > 
> > query the values and decide what to do ..
> 
> Exactly. If ALSA can be queried on what the HW
> actualy provide, what the library layer can do
> and what has to be done by the application, then

It can.

$ mpg123 -a default -v -v ...
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
	version 0.65; written and copyright by Michael Hipp and others
	free software (LGPL/GPL) without any warranty but with best wishes

Audio capabilities:
        |  s16  |  u16  |  u8   |  s8   | ulaw  | alaw  |
 --------------------------------------------------------
  8000  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |
 11025  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |
 12000  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |
 16000  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |
 22050  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |
 24000  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |
 32000  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |
 44100  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |
 48000  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |  M/S  |

$ mpg123 -a hw -v -v ...
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
	version 0.65; written and copyright by Michael Hipp and others
	free software (LGPL/GPL) without any warranty but with best wishes

Audio capabilities:
        |  s16  |  u16  |  u8   |  s8   | ulaw  | alaw  |
 --------------------------------------------------------
  8000  |   S   |       |       |       |       |       |
 11025  |   S   |       |       |       |       |       |
 12000  |   S   |       |       |       |       |       |
 16000  |   S   |       |       |       |       |       |
 22050  |   S   |       |       |       |       |       |
 24000  |   S   |       |       |       |       |       |
 32000  |   S   |       |       |       |       |       |
 44100  |   S   |       |       |       |       |       |
 48000  |   S   |       |       |       |       |       |

Via the "hw" device you get the real hardware (mine only supporting stereo
signed 16 bit, but the range of sampling rates natively).
I also did some benchmarking with mpg123 and native OSS/free versus ALSA
and the "hw" device gives the same performance (needed user and sys time)
when decoding, while the "default", which includes software mixing adds
around 66% of needed computing time (that computing time includes the mp3
decoding, btw), even more when mono<->stereo is needed.

I'm still trying to evaluate how efficient the alsa conversion routines are,
but when you want the app to do mono<->stereo and resampling and also want to
block the device because of disabled software mixing, you can just use
the "hw" device instead of "default".

I'd call this an user preference.

> one could work out a way that uses the features
> of ALSA and the features of application efficiently
> and with high quality.

Indeed.


Thomas.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070505/c7ab13d9/attachment.pgp>


More information about the MPlayer-dev-eng mailing list