Hotplug loads USB audio before local audio
Hello,
I have a built in emu10k1 audio devices in my computer and a USB quickcam with a microphone. It seems the modules for the USB quickcam are loaded via Hotplug before the module for the emu10k1 module is loaded. This is on RedHat 9.0 BTW.
When I boot my computer with the Quickcam connected, the usb audio module loads before the emu10k1 module, so the Quickcam gets the /dev/mixer, etc, devices. The sound card gets the /dev/mixer1, etc,
devices.
When I boot with the camera unplugged, the soundcard is /dev/mixer, etc, and then I can plug in the camera and get them to be /dev/mixer1, etc.
Short of hacking the system's boot process up, is there a way to ensure that the emu10k1 sound card will always be connected to the primary /dev/mixer devices, while the USB ones will be on the secondary ones?
Signature · 13 lines
Joshua Pollak 617-491-3474 x586 Software Engineer [email protected] Charles River Analytics ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 4 lines · Joshua Pollak
Short of hacking the system's boot process up, is there a way to ensure that the emu10k1 sound card will always be connected to the primary
/dev/mixerdevices, while the USB ones will be on the secondary ones?
On 2.4 right now, no, sorry.
For 2.5 I'm working on something that will let you do this, called udev. Search the archives of this list, or lkml for some pointers to the project (hint, it will not solve your problem yet, but hopefully in the near future.)
thanks,
greg k-h
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Ok, thanks, I guess I'll just have to wait.
Quoted 15 lines · Greg KH
Quoted 3 lines · Joshua Pollak
Short of hacking the system's boot process up, is there a way to ensure that the emu10k1 sound card will always be connected to the primary
/dev/mixerdevices, while the USB ones will be on the secondary ones?On 2.4 right now, no, sorry.
For 2.5 I'm working on something that will let you do this, called udev. Search the archives of this list, or lkml for some pointers to the project (hint, it will not solve your problem yet, but hopefully in the near future.)
thanks,
greg k-h
Signature · 13 lines
Joshua Pollak 617-491-3474 x586 Software Engineer [email protected] Charles River Analytics ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 5 lines · Greg KH
Quoted 3 lines
Short of hacking the system's boot process up, is there a way to ensure that the emu10k1 sound card will always be connected to the primary
/dev/mixerdevices, while the USB ones will be on the secondary ones?On 2.4 right now, no, sorry.
Hacks you can do:
- build emu10k1 statically
- 'alias audio off' in /etc/modules.conf (this will make USB not load at all, though.)
- and, as you said, hack something in initscripts to load emu10k1 for you first.
None of these are that great, of course.
Bill
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Thanks for the suggestions and the quick responses, some devel mailinglists just ignore user requests. ;)
I'm trying to avoid recompiling the Kernel, just 'cause we'll have to do the same on three or four different machines, and I want to keep the process simple. Same for hacking the config scripts. We don't need the audio portion of the camera though, so I guess we'll do 'alias audio off'. It would be nice to have, but its not important enough to get down and dirty with the system.
Thanks again, I didn't expect a solution so quickly.
Quoted 18 lines · Bill Nottingham
Quoted 5 lines · Greg KH
Quoted 3 lines
Short of hacking the system's boot process up, is there a way to ensure that the emu10k1 sound card will always be connected to the primary
/dev/mixerdevices, while the USB ones will be on the secondary ones?On 2.4 right now, no, sorry.
Hacks you can do:
- build emu10k1 statically
- 'alias audio off' in/etc/modules.conf(this will make USB not load at all, though.)
- and, as you said, hack something in initscripts to load emu10k1 for you first.None of these are that great, of course.
Bill
Signature · 13 lines
Joshua Pollak 617-491-3474 x586 Software Engineer [email protected] Charles River Analytics ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 3 lines · Joshua Pollak
Short of hacking the system's boot process up, is there a way to ensure that the emu10k1 sound card will always be connected to the primary
/dev/mixerdevices, while the USB ones will be on the secondary ones?
Another trick can be to include 'audio' in your '/etc/hotplug/blacklist' file. Add only the word 'audio' without '.o' in an empty line. This will prevent hotplug to load this module. You can do it later, by hand, with 'modprobe audio'.
Regards,
Pedro
Signature · 13 lines
ALSA Library Bindings for Pascal http://alsapas.alturl.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 9 lines · Pedro Lopez-Cabanillas
Quoted 3 lines · Joshua Pollak
Short of hacking the system's boot process up, is there a way to ensure that the emu10k1 sound card will always be connected to the primary
/dev/mixerdevices, while the USB ones will be on the secondary ones?Another trick can be to include 'audio' in your '
/etc/hotplug/blacklist' file. Add only the word 'audio' without '.o' in an empty line. This will prevent hotplug to load this module. You can do it later, by hand, with 'modprobe audio'.
Yes, this works well. We solved that this way. Have a look at the attached files.
Signature · 6 lines
ciao, christian
--------------------------------------------------------------------
Verglichen mit jedem x-beliebigen Redmonder Betriebssystem-Clone
ist Linux geradezu eine leuchtende Perle der Datensicherheit.
------ Frank Rennemann (http://www.linux-knowledge-portal.org) -----#
# Listing a module here prevents the hotplug scripts from loading it. # Usually that'd be so that some other driver will bind it instead,
# no matter which driver happens to get probed first. Sometimes user # mode tools can also control driver binding. # # Syntax: driver name alone (without any spaces) on a line. Other # lines are ignored. #
# uhci ... usb-uhci handles the same pci class usb-uhci
# tulip ... de4x5, xircom_tulip_cb, dmfe (...) handle same devices de4x5 # At least 2.4.3 and later xircom_tulip doesn't have that conflict # xircom_tulip_cb dmfe
# Modules for sound devices will be loaded by the alsasound script in
# /etc/hotplug/usb/. They should not be loaded before rcalsasound has started. audio snd-usb-audio usb-midi
# 8139cp.o is listed only once in modules.pcimap. And for exactly this device
# there is also an entry with 8139too. I have one bugreport that 8139cp does # not work for this card, therefore i add it to the blacklist. 8139cp
# ISDN USB is handled via /etc/hotplug/usb/ISDN.usermap fcusb
fcusb2
fxusbfxusb_CZ
fcdslusb
# module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info alsasound 0x0003 0x0499 0x1000 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008928 alsasound 0x0003 0x0499 0x1001 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008938 alsasound 0x0003 0x0499 0x1002 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008948 alsasound 0x0003 0x0499 0x1003 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008958 alsasound 0x0083 0x0499 0x1004 0x0000 0x0000 0x00 0x00 0x00 0xff 0x00 0x00 0x00008968 alsasound 0x0003 0x0499 0x1005 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008978 alsasound 0x0003 0x0499 0x1006 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008988 alsasound 0x0003 0x0499 0x1007 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008998 alsasound 0x0003 0x0499 0x1008 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x000089a8 alsasound 0x0003 0x0499 0x1009 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x000089b8 alsasound 0x0083 0x0499 0x100a 0x0000 0x0000 0x00 0x00 0x00 0xff 0x00 0x00 0x000089c8 alsasound 0x0003 0x0499 0x100e 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x000089d8 alsasound 0x0003 0x0499 0x100f 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x000089e8 alsasound 0x0003 0x0499 0x1010 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x000089f8 alsasound 0x0003 0x0499 0x1011 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008a08 alsasound 0x0003 0x0499 0x1012 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008a18 alsasound 0x0003 0x0499 0x1013 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008a28 alsasound 0x0003 0x0499 0x1014 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008a38 alsasound 0x0003 0x0499 0x5002 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008a48 alsasound 0x0003 0x0499 0x5003 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008a58 alsasound 0x0003 0x0499 0x5004 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008a68 alsasound 0x0003 0x0582 0x0000 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008a78 alsasound 0x0003 0x0582 0x0002 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008a88 alsasound 0x0003 0x0582 0x0003 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008a98 alsasound 0x0003 0x0582 0x0004 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008aa8 alsasound 0x0003 0x0582 0x0005 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008ab8 alsasound 0x0003 0x0582 0x0007 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008ac8 alsasound 0x0003 0x0582 0x0008 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008ad8 alsasound 0x0003 0x0582 0x0009 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008ae8 alsasound 0x0003 0x0582 0x000b 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008af8 alsasound 0x0003 0x0582 0x000c 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008b08 alsasound 0x0003 0x0582 0x0012 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008b18 alsasound 0x0003 0x0582 0x0014 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008b28 alsasound 0x0003 0x0582 0x0016 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008b38 alsasound 0x0003 0x0582 0x0023 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008b48 alsasound 0x0083 0x0582 0x0025 0x0000 0x0000 0x00 0x00 0x00 0xff 0x00 0x00 0x00008b58 alsasound 0x0003 0x0582 0x0027 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008b68 alsasound 0x0003 0x0582 0x0029 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008b78 alsasound 0x0083 0x0582 0x002b 0x0000 0x0000 0x00 0x00 0x00 0xff 0x00 0x00 0x00008b88 alsasound 0x0003 0x0582 0x002d 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008b98 alsasound 0x0003 0x0582 0x0033 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00008ba8 alsasound 0x0083 0x0763 0x1002 0x0000 0x0000 0x00 0x00 0x00 0xff 0x00 0x00 0x00008bb8 alsasound 0x0083 0x0763 0x1011 0x0000 0x0000 0x00 0x00 0x00 0xff 0x00 0x00 0x00008bc8 alsasound 0x0083 0x0763 0x1015 0x0000 0x0000 0x00 0x00 0x00 0xff 0x00 0x00 0x00008bd8 alsasound 0x0083 0x0763 0x1021 0x0000 0x0000 0x00 0x00 0x00 0xff 0x00 0x00 0x00008be8 alsasound 0x0083 0x0763 0x1033 0x0000 0x0000 0x00 0x00 0x00 0xff 0x00 0x00 0x00008bf8 alsasound 0x0083 0x0763 0x1041 0x0000 0x0000 0x00 0x00 0x00 0xff 0x00 0x00 0x00008c08 alsasound 0x0083 0x0763 0x2001 0x0000 0x0000 0x00 0x00 0x00 0xff 0x00 0x00 0x00008c18 alsasound 0x0083 0x0763 0x2003 0x0000 0x0000 0x00 0x00 0x00 0xff 0x00 0x00 0x00008c28 alsasound 0x0180 0x0000 0x0000 0x0000 0x0000 0x00 0x00 0x00 0x01 0x01 0x00 0x00000000 #!/bin/bash # # /etc/hotplug/usb/alsasound # # Sets up newly plugged in USB audio/MIDI devices. #
function add_alsa () {
# check alsa is already running
if [ ! -d /proc/asound ]; then
# start alsasound script, so that static devices are properly loaded
echo "Starting ALSA..."
/etc/init.d/alsasound start >/dev/null 2>&1
fi
/sbin/modprobe snd-usb-audio
}function remove_alsa () {
/sbin/modprobe -r snd-usb-audio
}
case "$ACTION" in
add)
add_alsa
;;
remove)
remove_alsa
;;
esac
Quoted 7 lines · David Brownell
Quoted 6 lines · Christian Zoz
Quoted 4 lines · Pedro Lopez-Cabanillas
Another trick can be to include 'audio' in your '
/etc/hotplug/blacklist' file. Add only the word 'audio' without '.o' in an empty line. This will prevent hotplug to load this module. You can do it later, by hand, with 'modprobe audio'.
Quoted 6 lines
Quoted 2 lines
Yes, this works well. We solved that this way. Have a look at the attached files.
Are you suggesting that the hotplug distro should include those files? If this particular ALSA setup problem is common, likely it should ...
Just to clarify, this problem is not particular to ALSA. I don't believe RedHat 9.0 uses ALSA, I think the driver that is being loaded is the stock Linux kernel one.
Signature · 13 lines
Joshua Pollak 617-491-3474 x586 Software Engineer [email protected] Charles River Analytics ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 10 lines · Christian Zoz
Quoted 4 lines · Pedro Lopez-Cabanillas
Another trick can be to include 'audio' in your '
/etc/hotplug/blacklist' file. Add only the word 'audio' without '.o' in an empty line. This will prevent hotplug to load this module. You can do it later, by hand, with 'modprobe audio'.Yes, this works well. We solved that this way. Have a look at the attached files.
Are you suggesting that the hotplug distro should include those files? If this particular ALSA setup problem is common, likely it should ...
- Dave
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 3 lines · Joshua Pollak
Just to clarify, this problem is not particular to ALSA. I don't believe RedHat 9.0 uses ALSA, I think the driver that is being loaded is the stock Linux kernel one.
Yes, 'audio' is the OSS module for USB audio devices. OTOH, i think that your problem is not particular to audio, OSS or ALSA. The problem is that you have two devices of the same class, one of them supported by hotplug (or both).
For instance: if you get some internal PCI TV card using a V4L driver (as bt878), and you have also an USB webcam... How can you know which is your webcam /dev/video0 or /dev/video1 ? if you boot with your USB cam plugged, then it is /dev/video0, but if you boot with it unplugged the node /dev/video0 is your TV card, and /dev/video1 will be the webcam if you plug it later. Same for printers, scanners, disks (i guess).
If you have several USB devices of the same class, you can also go into troubles with your apps configured to use one device or another, by his device node in /dev directory. ALSA driver snd-usb-audio has some support to solve this issue, with two params to specify the device order by manufacturer and model ids, but i don't know about other drivers.
Of course, you can avoid to use hotplug to load your device driver (/etc/hotplug/blacklist) or renounce to use it (alias off in modules.conf). The SuSE approach gives you some hotplug support, loading the drivers with the classic ALSA startup script. The problem is that you need to maintain the alsa.usermap file by hand as the set of devices supported by the snd-usb-audio driver grows (and it grows very quickly!). Planet CCRMA (stanford.edu) has a set of RPM packages for multimedia Red Hat users, using /etc/hotplug/blacklist for audio, too.
David: I think that some kind of general solution for this problem should be included in hotplug (if there is one).
Regards,
Pedro
Signature · 13 lines
ALSA Library Bindings for Pascal http://alsapas.alturl.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 4 lines · Pedro Lopez-Cabanillas
Quoted 3 lines · Joshua Pollak
Just to clarify, this problem is not particular to ALSA. I don't believe RedHat 9.0 uses ALSA, I think the driver that is being loaded is the stock Linux kernel one.
Yes, then modify the scripts accordingly.
Quoted 17 lines
Yes, 'audio' is the OSS module for USB audio devices. OTOH, i think that your problem is not particular to audio, OSS or ALSA. The problem is that you have two devices of the same class, one of them supported by hotplug (or both).
For instance: if you get some internal PCI TV card using a V4L driver (as bt878), and you have also an USB webcam... How can you know which is your webcam
/dev/video0or/dev/video1? if you boot with your USB cam plugged, then it is/dev/video0, but if you boot with it unplugged the node/dev/video0is your TV card, and/dev/video1will be the webcam if you plug it later. Same for printers, scanners, disks (i guess).If you have several USB devices of the same class, you can also go into troubles with your apps configured to use one device or another, by his device node in /dev directory. ALSA driver snd-usb-audio has some support to solve this issue, with two params to specify the device order by manufacturer and model ids, but i don't know about other drivers.
Quoted 5 lines
Of course, you can avoid to use hotplug to load your device driver (
/etc/hotplug/blacklist) or renounce to use it (alias off in modules.conf). The SuSE approach gives you some hotplug support, loading the drivers with the classic ALSA startup script. The problem is that you need to maintain the alsa.usermap file by hand as the set of devices supported by the
Yes that's the problem. It's a kind of 'works for most users' solution.
Quoted 6 lines
snd-usb-audio driver grows (and it grows very quickly!). Planet CCRMA (stanford.edu) has a set of RPM packages for multimedia Red Hat users, using
/etc/hotplug/blacklistfor audio, too.David: I think that some kind of general solution for this problem should be included in hotplug (if there is one).
For 2.4 kernel:
It would be best, if all services that initialize builtin hardware, would run before USB, PCMCIA, Firewire is started. Then you always get the same device names for this builtin hardware.
In SuSE Linux we start e.g. network before hotplug and pcmcia. But e.g. alsa reads files from /usr/..., which may be mounted via network. And network may be provided by pcmcia/hotplug (But this is a rare case). So alsa starts later and therefore needs the blacklist solution.
For 2.6 this problem will hopefully solved with persistent interface names.
Signature · 16 lines
ciao, christian
--------------------------------------------------------------------
Verglichen mit jedem x-beliebigen Redmonder Betriebssystem-Clone
ist Linux geradezu eine leuchtende Perle der Datensicherheit.
------ Frank Rennemann (http://www.linux-knowledge-portal.org) -----
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-develAm Mittwoch, 30. April 2003 20:24 schrieb Joshua Pollak:
Quoted 11 lines
Hello,
I have a built in emu10k1 audio devices in my computer and a USB quickcam with a microphone. It seems the modules for the USB quickcam are loaded via Hotplug before the module for the emu10k1 module is loaded. This is on RedHat 9.0 BTW.
When I boot my computer with the Quickcam connected, the usb audio module loads before the emu10k1 module, so the Quickcam gets the
/dev/mixer, etc, devices. The sound card gets the/dev/mixer1, etc,
devices.
On 2.4 use the preload and postload feature in /etc/modules.conf to always load both drivers in desired order. There is no generic solution, however.
Regards
Oliver
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel