[alsa-devel] Device assignment and hotplug
krzysztof.h1 at wp.pl
Wed Sep 5 20:41:00 CEST 2007
On Wed, 05 Sep 2007 19:08:45 +0200
Takashi Iwai <tiwai at suse.de> wrote:
> the recent Linux systems use the auto-probing at boot via udev, and
> this often screws up the order of device loading, which results in the
> inconsistent device appearance. A typical case is that you have a PCI
> onboard and a USB audio device. Sometimes the USB appears as the
> first device while sometimes (most times) PCI appears as the first.
> So far, for fixing this order, we use index module option. That is,
> add the following to module config:
> options snd-onboard index=0
> options snd-usb-audio index=1
I would rather try to contact udev guys how to solve this. This problem
is not limited to sound cards. They have solution for hard drives already
as it hit them first and could even lead to non-bootable system (sda
swapped with sdb then e.g. /usr partition could not be mounted).
A general solution would be to use some kind of device locator (e.g. bus:device_id).
For PCI devices the pci id could be used. For the USB devices, the device id reported
by lsusb or something id string from the device (like for disks now - they can use disk
number reported by disk).
Even, if the problem is solved for USB devices only, it will probably make life much easier
as the PCI bus is probably always scanned in the same order.
The same may apply to graphics cards, modems, network cards, etc. A general
solution (like bus:device_id) would solve it for the most if not all of them.
If it is not solvable by udev guys, then you can try doing it in alsa the way I mentioned
so you can set in the config file which device id (USB serial number or bus:device_id)
correspond to each sound device.
In your solution, it is a change of index to some kind of locator.
My two cents,
More information about the Alsa-devel