[alsa-devel] [PATCH] alsa: support module on-demand loading for seq and timer

Kay Sievers kay.sievers at vrfy.org
Tue Nov 23 16:56:32 CET 2010

On Tue, Nov 23, 2010 at 16:45, Clemens Ladisch <clemens at ladisch.de> wrote:
> Kay Sievers wrote:
>> If CONFIG_SND_DYNAMIC_MINORS is used, assign /dev/snd/seq and
>> /dev/snd/timer the usual static minors, and export specific
>> module aliases to generate udev module on-demand loading
>> instructions: ...
>> As soon as userspace accesses any of these nodes, the in-kernel
>> module-loader will load the module, and the device can be used.
> Is this another mechanism than sound/core/sound.c::autoload_device()?
> Because in this case, that function can go away.

No, the kernel needs to match the minor to the module name to load.

>> +++ b/sound/core/seq/seq.c
>> +MODULE_ALIAS("devname:snd/seq");
> The device name that alsa-lib tries to use for autoloading is actually
> /dev/aloadSEQ.

That might need to be changed then, if something depends on that, but
nothing ever tries to open /dev/snd/seq. These names will never exist
on any usual system where CONFIG_SND_DYNAMIC_MINORS is used.

>> This is part of systemd's effort to get rid of unconditional
>> module load instructions and needless init scripts.
> So you're going to add the entries for card driver autoloading
> (/dev/aloadC*), too?

No, we only ever handle single-instance devices with a single fixed
dev_t, not ones with an arbitrary number of device instances.

Card drivers are loaded by hardware matches today, not on-demand, and
not by an card number.

There are no configured numbered module aliases for sound cards
anymore, that can't work with today's setups.


More information about the Alsa-devel mailing list