You are not logged in.

#1 2014-11-11 19:19:14

Sputnik83
Member
Registered: 2014-10-09
Posts: 5

udev rule for hotplug USB-soundcard with ALSA

Hey there,

first of all, i want to  apologize for my realy bad english skills.
I give my best and hope you can understand me good enough.

Topic:
I have USB-speakers (with included USB-soundcard) attached on my Laptop, most of the time.
Everytime i want to use my Laptop without the speakers i have to edit my index in /etc/modprobe.d/alsa-base.conf

from:

options snd_usb_audio index=0
options snd_hda_intel index=1

to:

options snd_usb_audio index=1
options snd_hda_intel index=0

and reboot afterwards to reload config file.
This is way to complicated and sucks a lot.

What i need (atleast in my opinion) is a working udev rule, but i am not aable to write it myself....

Pulseaudio could be a solution, but in my case Puls makes a lot of troubles and strange behavioure. So i finaly deinstalled it...

some informations could be usefull:

lsusb
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 005: ID 0a5c:4503 Broadcom Corp. Mouse (Boot Interface Subclass)
Bus 007 Device 004: ID 0a5c:4502 Broadcom Corp. Keyboard (Boot Interface Subclass)
Bus 007 Device 003: ID 413c:8126 Dell Computer Corp. Wireless 355 Bluetooth
Bus 007 Device 002: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 003: ID 18c3:6255  
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 05a9:2640 OmniVision Technologies, Inc. OV2640 Webcam
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
lsmod | grep 'snd'
snd_hda_codec_idt      56952  1 
snd_hda_codec_hdmi     49213  1 
snd_hda_codec_generic    63126  2 snd_hda_codec_idt
snd_usb_audio         139412  1 
snd_hda_intel          26387  0 
snd_hda_controller     26938  1 snd_hda_intel
snd_usbmidi_lib        27571  1 snd_usb_audio
snd_hda_codec         108536  5 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller
snd_rawmidi            26806  1 snd_usbmidi_lib
snd_hwdep              17244  2 snd_usb_audio,snd_hda_codec
snd_seq_device         13132  1 snd_rawmidi
snd_pcm                88487  5 snd_usb_audio,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller
snd_timer              26614  1 snd_pcm
snd                    73436  14 snd_usb_audio,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_hda_codec_idt,snd_pcm,snd_rawmidi,snd_hda_codec_generic,snd_usbmidi_lib,snd_hda_codec,snd_hda_intel,snd_seq_device
soundcore              13031  2 snd,snd_hda_codec
usbcore               199381  8 btusb,uhci_hcd,snd_usb_audio,uvcvideo,snd_usbmidi_lib,ehci_hcd,ehci_pci,usbhid
 ls -l /dev/snd/
insgesamt 0
drwxr-xr-x  2 root root       60 Nov 11 18:06 by-id
drwxr-xr-x  2 root root       80 Nov 11 18:06 by-path
crw-rw----+ 1 root audio 116,  2 Nov 11 18:06 controlC0
crw-rw----+ 1 root audio 116,  4 Nov 11 18:04 controlC1
crw-rw----+ 1 root audio 116, 10 Nov 11 18:04 hwC1D0
crw-rw----+ 1 root audio 116, 11 Nov 11 18:04 hwC1D1
crw-rw----+ 1 root audio 116, 12 Nov 11 18:04 hwC1D2
crw-rw----+ 1 root audio 116,  3 Nov 11 19:49 pcmC0D0p
crw-rw----+ 1 root audio 116,  7 Nov 11 18:04 pcmC1D0c
crw-rw----+ 1 root audio 116,  6 Nov 11 18:04 pcmC1D0p
crw-rw----+ 1 root audio 116,  8 Nov 11 18:04 pcmC1D1p
crw-rw----+ 1 root audio 116,  9 Nov 11 18:04 pcmC1D2c
crw-rw----+ 1 root audio 116,  5 Nov 11 18:04 pcmC1D3p
crw-rw----+ 1 root audio 116,  1 Nov 11 18:04 seq
crw-rw----+ 1 root audio 116, 33 Nov 11 18:04 timer
 cat /proc/asound/cards
 0 [Device         ]: USB-Audio - USB Audio Device
                      Elite Silicon USB Audio Device at usb-0000:00:1d.0-2, full speed
 1 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xfe9fc000 irq 31

Hope you guys can help me wink
Thank you so far,

Sputti!

Offline

Board footer

Powered by FluxBB