Gentoo Archives: gentoo-dev

From: "Diego 'Flameeyes' Pettenò" <flameeyes@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [RFC] USE_EXPAND variable to choose ALSA PCM plugins
Date: Wed, 13 Dec 2006 15:16:31
Not sure if anybody here knows, but alsa-plugins is not the only set of 
plugins an user installs in its system, many others are installed by alsa-lib 
itself, they are the basic plugins like dmix, dsnoop, iec958, plug... the 
ones that many asoundrc already make use of.

Now of course, most of the users need them, and disabling them would be pretty 
bad, but again, there are reasons to disable some of them at least, 
especially when targetting small embedded devices.

If nobody has anything against this, I'll add an ALSA_PCM_PLUGINS variable 
where users can choose the plugins they want built, to reduce the amount of 
code installed by alsa-lib:

Calculating dependencies... done!
[ebuild   R   ] media-libs/alsa-lib-1.0.14_rc1  USE="-alisp -debug -doc -midi" 
ALSA_PCM_PLUGINS="-adpcm -alaw -asym -copy -dmix -dshare -dsnoop -empty -extplug -file -hooks 
iec958 -ioplug -ladspa -lfloat -linear -meter -mulaw -multi -null 
plug -rate -route -share -shm -softvol" 0 kB

As you can see, my system even if it's not an embedded system is skipping most 
of them, as I don't use dmix or dsnoop (I'd rather leave it to PulseAudio, 
that for me had better results) and I don't have much more use for my 
soundcard but playing music and DVDs.

The default for them, in base/ profile directly, should be of _all_ of them. 
There's not the problem as for ALSA_CARDS that some of them have dependencies 
or that they might change between versions, as this configure is smarter and 
filters them already.

As you can see, the modified ebuild I'm currently using also has two more 
useflags, midi and alisp: the first disable all the support for sequencer, 
rawmidi, instrumentation and samples loading, I think that nowadays most of 
the people simply don't care about that it so it might be worth having it as 
useflag (SuSE seems to disable at least sampleloading), while the latter 
disables alisp interpreter for advanced (and complex) configuration (SuSE 
also disable this).

The result is quite good after all; with a -ggdb compiled alsa-lib packages, I 
get this change in the size of the package:

flame@enterprise ~/devel/gentoo-x86/media-libs/alsa-lib % qsize alsa-lib
media-libs/alsa-lib-1.0.14_rc1: 133 files, 25 non-files, 6608.758 KB
flame@enterprise ~/devel/gentoo-x86/media-libs/alsa-lib % qsize alsa-lib
media-libs/alsa-lib-1.0.14_rc1: 127 files, 22 non-files, 3666.628 KB

it is almost the half.

So, anybody has reasons not to pursue this road?

Diego "Flameeyes" Pettenò -
Gentoo/Alt lead, Gentoo/FreeBSD, Video, Sound, ALSA, PAM, KDE, CJK, Ruby ...