How to join forever an alsa device id to a particular USB port?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, I bought 2 identic USB audio device that work correctly with
linux but when I restart linux or I keep the devices out and I put it
in again they take another id. I need that the id would be always the
same.

I tried a first script called "A working example":
http://alsa.opensrc.org/Udev but squeeze doesn't rename it...
Then I tried other kind of tries that I paste below (please don't
laugh about me :) I am not good with udev )


# KERNEL=="2-2", SUBSYSTEM=="usb", ACTION=="add", DRIVER=="usb", SYMLINK="test"

# KERNEL=="controlC[0-9]*", SUBSYSTEM=="usb", ACTION=="add",
SYMLINK="snd/controlC9"

# KERNEL=="2-2:1.0", SUBSYSTEM=="usb", ACTION=="add", DRIVER=="usb",
SYMLINK="snd/controlC9"

# KERNEL=="2-2:1.1", SUBSYSTEM=="usb", ACTION=="add", DRIVER=="usb",
SYMLINK="snd/pcmC9D0c"

# KERNEL=="2-2:1.2", SUBSYSTEM=="usb", ACTION=="add", DRIVER=="usb",
SYMLINK="snd/pcmC9D0p"

# KERNEL=="2-2:1.0", SUBSYSTEM=="usb", ACTION=="add", DRIVER=="usb",
SYMLINK="snd/controlC9"


KERNEL=="controlC0", ACTION=="add" DRIVERS=="snd", NAME="snd/controlC9"


As you can see it doesn't work...the only thing I could do was to
create a symlink but that's not important to me, i couldn't rename the
devices that's what I need

What I precisely need is to join one or more particular USB portsto
the same alsa device id. I will decide which one doing it in
/proc/asound/devices

----


udevadm info --query all --path /sys/bus/usb/devices/2-2  --attribute-walk


Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device

found, all possible attributes in the udev rules key format.

A rule to match, can be composed by the attributes of the device

and the attributes from one single parent device.



  looking at device '/devices/pci0000:00/0000:00:10.0/usb2/2-2':

    KERNEL=="2-2"

    SUBSYSTEM=="usb"

    DRIVER=="usb"

    ATTR{configuration}==""

    ATTR{bNumInterfaces}==" 4"

    ATTR{bConfigurationValue}=="1"

    ATTR{bmAttributes}=="80"

    ATTR{bMaxPower}=="100mA"

    ATTR{urbnum}=="63"

    ATTR{idVendor}=="08bb"

    ATTR{idProduct}=="2902"

    ATTR{bcdDevice}=="0100"

    ATTR{bDeviceClass}=="00"

    ATTR{bDeviceSubClass}=="00"

    ATTR{bDeviceProtocol}=="00"

    ATTR{bNumConfigurations}=="1"

    ATTR{bMaxPacketSize0}=="8"

    ATTR{speed}=="12"

    ATTR{busnum}=="2"

    ATTR{devnum}=="2"

    ATTR{version}==" 1.10"

    ATTR{maxchild}=="0"

    ATTR{quirks}=="0x0"

    ATTR{authorized}=="1"

    ATTR{manufacturer}=="Burr-Brown from TI              "

    ATTR{product}=="USB Audio CODEC "



  looking at parent device '/devices/pci0000:00/0000:00:10.0/usb2':

    KERNELS=="usb2"

    SUBSYSTEMS=="usb"

    DRIVERS=="usb"

    ATTRS{configuration}==""

    ATTRS{bNumInterfaces}==" 1"

    ATTRS{bConfigurationValue}=="1"

    ATTRS{bmAttributes}=="e0"

    ATTRS{bMaxPower}=="  0mA"

    ATTRS{urbnum}=="36"

    ATTRS{idVendor}=="1d6b"

    ATTRS{idProduct}=="0001"

    ATTRS{bcdDevice}=="0206"

    ATTRS{bDeviceClass}=="09"

    ATTRS{bDeviceSubClass}=="00"

    ATTRS{bDeviceProtocol}=="00"

    ATTRS{bNumConfigurations}=="1"

    ATTRS{bMaxPacketSize0}=="64"

    ATTRS{speed}=="12"

    ATTRS{busnum}=="2"

    ATTRS{devnum}=="1"

    ATTRS{version}==" 1.10"

    ATTRS{maxchild}=="2"

    ATTRS{quirks}=="0x0"

    ATTRS{authorized}=="1"

    ATTRS{manufacturer}=="Linux 2.6.32-5-686 uhci_hcd"

    ATTRS{product}=="UHCI Host Controller"

    ATTRS{serial}=="0000:00:10.0"

    ATTRS{authorized_default}=="1"



  looking at parent device '/devices/pci0000:00/0000:00:10.0':

    KERNELS=="0000:00:10.0"

    SUBSYSTEMS=="pci"

    DRIVERS=="uhci_hcd"

    ATTRS{vendor}=="0x1106"

    ATTRS{device}=="0x3038"

    ATTRS{subsystem_vendor}=="0x1043"

    ATTRS{subsystem_device}=="0x3038"

    ATTRS{class}=="0x0c0300"

    ATTRS{irq}=="21"

    ATTRS{local_cpus}=="ffffffff"

    ATTRS{local_cpulist}=="0-31"

    ATTRS{modalias}=="pci:v00001106d00003038sv00001043sd00003038bc0Csc03i00"

    ATTRS{enable}=="1"

    ATTRS{broken_parity_status}=="0"

    ATTRS{msi_bus}==""



  looking at parent device '/devices/pci0000:00':

    KERNELS=="pci0000:00"

    SUBSYSTEMS==""

    DRIVERS==""



----



/proc/asound# ls

card0  card1  card2  cards  default  default_1  devices  hwdep  modules  oss

pcm  seq  timers  V8237  version



----



/dev/snd# ls

by-id  by-path  controlC0  controlC1  controlC2  pcmC0D0c  pcmC0D0p

pcmC0D1c  pcmC0D1p  pcmC1D0c  pcmC1D0p  pcmC2D0c  pcmC2D0p  seq  timer



----



dmesg



[    1.520541] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001

[    1.520545] usb usb4: New USB device strings: Mfr=3, Product=2,

SerialNumber=1

[    1.520549] usb usb4: Product: UHCI Host Controller

[    1.520552] usb usb4: Manufacturer: Linux 2.6.32-5-686 uhci_hcd

[    1.520555] usb usb4: SerialNumber: 0000:00:10.2

[    1.520909] usb usb4: configuration #1 chosen from 1 choice

[    1.521101] hub 4-0:1.0: USB hub found

[    1.521126] hub 4-0:1.0: 2 ports detected



[ 4285.848016] usb 2-1: new full speed USB device using uhci_hcd and address

3

[ 4286.169823] usb 2-1: New USB device found, idVendor=08bb, idProduct=2902

[ 4286.169830] usb 2-1: New USB device strings: Mfr=1, Product=2,

SerialNumber=0

[ 4286.169834] usb 2-1: Product: USB Audio CODEC

[ 4286.169837] usb 2-1: Manufacturer: Burr-Brown from TI

[ 4286.170060] usb 2-1: configuration #1 chosen from 1 choice

[ 4286.225195] input: Burr-Brown from TI               USB Audio CODEC  as

/devices/pci0000:00/0000:00:10.0/usb2/2-1/2-1:1.3/input/input5

[ 4286.225961] generic-usb 0003:08BB:2902.0002: input,hidraw1: USB HID v1.00

Device [Burr-Brown from TI               USB Audio CODEC ] on

usb-0000:00:10.0-1/input3



----


Every help will be important to me :) thanks.

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user



[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux