Autor |
Nachricht |
|
Titel: Hilfe für Hotplug Regel gesucht
Verfasst am: 19.06.2007, 23:08 Uhr
|
|

Anmeldung: 15. Mai 2005
Beiträge: 191
Wohnort: Frankfurt am Main
|
|
Hallo,
ich möchte folgenden Zustand erreichen:
Solange keine externe USB Soundkarte verwendet wird, soll die interne verwendet werden.
Sobald eine externe Soundkarte eingesteckt wird, soll der Soundserver gestoppt werden und dann mit einer bestimmten .asoundrc Konfiguration neu gestartet werden.
Sobald die externe Soundkarte ausgesteckt wird, soll der soundserver gestoppt werden und dann ohne .asoundrc Konfigurationsfile neu gestartet werden.
Der .asoundrc File existiert bereits und funktioniert, mir fehlt aber im Moment das Wissen, wei ich diese Datei dynamsich während der Laufzeit abhängig vom Ein/Ausstecken aktiviere.
Danke für die Tipps! |
_________________ Auch wenn das Leben auf der Erde teuer sein mag: eine jährliche Rundreise um die Sonne ist gratis mit dabei.
|
|
|
|
 |
|
Titel:
Verfasst am: 21.06.2007, 16:10 Uhr
|
|
Anmeldung: 12. Mar 2005
Beiträge: 368
|
|
Diesen Post hast du gelesen?
http://www.kanotix.de/PNphpBB2-viewtopic-t-23714.html
Ich meine es ganz gut erklärt zu haben, so das es sich auch auf dein Problem übertragen lässt.
Um beim Entfernen eines USB-Devices etwas ausführen zu wollen,
musst du eigentlich nur eine zweite udev-Regel hinzufügen und da den Action Eintrag:
ACTION=="add"
ersetzen durch:
ACTION=="remove"
und das entsprechende Skript aufrufen. |
_________________ Gruss an alle Kanotix-Fans, blauweiss
|
|
|
|
 |
|
Titel:
Verfasst am: 21.06.2007, 17:16 Uhr
|
|

Anmeldung: 15. Mai 2005
Beiträge: 191
Wohnort: Frankfurt am Main
|
|
Hallo blauweiss,
vielen Dank für den Link und die sehr verständliche Anleitung
Ich habe an folgender Stelle ein Problem:
Zitat:
3. Udev Regel schreiben
Informationen über den Stick abfragen:
udevinfo -a -p $(udevinfo -q path -n sdg1)
funktioniert bei mir so natürlich nicht, da die Soundkarte ja kein mountbarer Massenspeicher ist. Was also statt "-n sdg1" muss ich denn bei einer USB Soundkarte angeben, um udevinfo korrekt aufzurufen?
Der Befehl lsusb -v liefert mir übrigens ne Menge Info über diese Soundkarte, aber ich weiß nicht, ob ich davon was für die udev Regel verwenden kann.
lsusb -v
....
Bus 003 Device 003: ID 0ccd:0028 TerraTec Electronic GmbH
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0ccd TerraTec Electronic GmbH
idProduct 0x0028
bcdDevice 1.00
iManufacturer 0
iProduct 1
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 369
bNumInterfaces 4
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 1 Control Device
bInterfaceProtocol 0
iInterface 0
AudioControl Interface Descriptor:
bLength 10
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 1.00
wTotalLength 179
bInCollection 2
baInterfaceNr( 0) 1
baInterfaceNr( 1) 2
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bNrChannels 6
wChannelConfig 0x003f
Left Front (L)
Right Front (R)
Center Front (C)
Low Freqency Enhancement (LFE)
Left Surround (LS)
Right Surround (RS)
iChannelNames 0
iTerminal 0
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 2
wTerminalType 0x0201 Microphone
bAssocTerminal 0
bNrChannels 2
wChannelConfig 0x0003
Left Front (L)
Right Front (R)
iChannelNames 0
iTerminal 0
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 3
wTerminalType 0x0603 Line Connector
bAssocTerminal 0
bNrChannels 2
wChannelConfig 0x0003
Left Front (L)
Right Front (R)
iChannelNames 0
iTerminal 0
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 4
wTerminalType 0x0605 SPDIF interface
bAssocTerminal 0
bNrChannels 2
wChannelConfig 0x0003
Left Front (L)
Right Front (R)
iChannelNames 0
iTerminal 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 5
wTerminalType 0x0605 SPDIF interface
bAssocTerminal 0
bSourceID 1
iTerminal 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 6
wTerminalType 0x0301 Speaker
bAssocTerminal 0
bSourceID 9
iTerminal 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 7
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 8
iTerminal 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 5 (SELECTOR_UNIT)
bUnitID 8
bNrInPins 3
baSource( 0) 10
baSource( 1) 11
baSource( 2) 12
iSelector 0
AudioControl Interface Descriptor:
bLength 14
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 9
bSourceID 15
bControlSize 1
bmaControls( 0) 0x03
Mute
Volume
bmaControls( 1) 0x00
bmaControls( 2) 0x00
bmaControls( 3) 0x00
bmaControls( 4) 0x00
bmaControls( 5) 0x00
bmaControls( 6) 0x00
iFeature 0
AudioControl Interface Descriptor:
bLength 10
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 10
bSourceID 2
bControlSize 1
bmaControls( 0) 0x43
Mute
Volume
Automatic Gain
bmaControls( 1) 0x00
bmaControls( 2) 0x00
iFeature 0
AudioControl Interface Descriptor:
bLength 10
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 11
bSourceID 3
bControlSize 1
bmaControls( 0) 0x01
Mute
bmaControls( 1) 0x02
Volume
bmaControls( 2) 0x02
Volume
iFeature 0
AudioControl Interface Descriptor:
bLength 10
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 12
bSourceID 4
bControlSize 1
bmaControls( 0) 0x01
Mute
bmaControls( 1) 0x00
bmaControls( 2) 0x00
iFeature 0
AudioControl Interface Descriptor:
bLength 10
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 13
bSourceID 2
bControlSize 1
bmaControls( 0) 0x03
Mute
Volume
bmaControls( 1) 0x00
bmaControls( 2) 0x00
iFeature 0
AudioControl Interface Descriptor:
bLength 10
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 14
bSourceID 3
bControlSize 1
bmaControls( 0) 0x01
Mute
bmaControls( 1) 0x02
Volume
bmaControls( 2) 0x02
Volume
iFeature 0
AudioControl Interface Descriptor:
bLength 21
bDescriptorType 36
bDescriptorSubtype 4 (MIXER_UNIT)
bUnitID 15
bNrInPins 3
baSourceID( 0) 1
baSourceID( 1) 13
baSourceID( 2) 14
bNrChannels 6
wChannelConfig 0x003f
Left Front (L)
Right Front (R)
Center Front (C)
Low Freqency Enhancement (LFE)
Left Surround (LS)
Right Surround (RS)
iChannelNames 0
bmControls 0x00
bmControls 0x00
bmControls 0x00
iMixer 0
junk at descriptor end: 00 00 00 00 00
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 1
bDelay 3 frames
wFormatTag 1 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 48000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 9
Transfer Type Isochronous
Synch Type Adaptive
Usage Type Data
wMaxPacketSize 0x00c8 1x 200 bytes
bInterval 1
bRefresh 0
bSynchAddress 0
AudioControl Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bLockDelayUnits 1 Milliseconds
wLockDelay 4 Milliseconds
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 2
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 1
bDelay 1 frames
wFormatTag 1 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 6
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 48000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 9
Transfer Type Isochronous
Synch Type Adaptive
Usage Type Data
wMaxPacketSize 0x0258 1x 600 bytes
bInterval 1
bRefresh 0
bSynchAddress 0
AudioControl Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bLockDelayUnits 1 Milliseconds
wLockDelay 2 Milliseconds
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 7
bDelay 1 frames
wFormatTag 1 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 48000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x00c8 1x 200 bytes
bInterval 1
bRefresh 0
bSynchAddress 0
AudioControl Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bLockDelayUnits 0 Undefined
wLockDelay 0 Undefined
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Devices
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.00
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 48
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0003 1x 3 bytes
bInterval 32
cannot read device status, Operation not permitted (1)
|
_________________ Auch wenn das Leben auf der Erde teuer sein mag: eine jährliche Rundreise um die Sonne ist gratis mit dabei.
|
|
|
|
 |
|
Titel:
Verfasst am: 21.06.2007, 18:40 Uhr
|
|
Anmeldung: 12. Mar 2005
Beiträge: 368
|
|
|
|
 |
|
Titel:
Verfasst am: 21.06.2007, 22:38 Uhr
|
|

Anmeldung: 15. Mai 2005
Beiträge: 191
Wohnort: Frankfurt am Main
|
|
Vielen Dank für die Hilfe ... der zweite Link war der entscheidende Hinweis!
Meine Regel sieht jetzt so aus:
Zitat:
KERNEL=="pcmC[D0-9cp]*", ACTION=="add", PROGRAM="/bin/sh -c 'killall artsd ; cp /etc/asound.conf.usb /etc/asound.conf'"
KERNEL=="pcmC[D0-9cp]*", ACTION=="remove", PROGRAM="/bin/sh -c 'killall artsd ; cp /etc/asound.conf.nousb /etc/asound.conf'"
und wird beim Einstecken bzw. Ausstecken ausgeführt. |
_________________ Auch wenn das Leben auf der Erde teuer sein mag: eine jährliche Rundreise um die Sonne ist gratis mit dabei.
|
|
|
|
 |
|