How to write rule sound card 2

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

 



Hello

some time ago i write next message

-------- start  --------

i have 3 sound card
one internal and 
two external identical with FM tuner


after reboot there change name. i have some experiment with serial port\touchscreen\lan, but can`t do it =(

Linux rl-adm 2.6.24-22-generic #1 SMP Mon Nov 24 18:32:42 UTC 2008 i686 GNU/Linux

ls -li /dev/audio*
11534 crw-rw----+ 1 root audio 14, 4 2009-02-03 18:40 /dev/audio
11644 crw-rw----+ 1 root audio 14, 20 2009-02-03 18:40 /dev/audio1
11809 crw-rw----+ 1 root audio 14, 36 2009-02-03 18:40 /dev/audio2

 find /sys -name dev | grep audio
/sys/devices/pci0000:00/0000:00:1e.0/0000:02:03.0/sound/card0/audio/dev
/sys/devices/pci0000:00/0000:00:1e.0/0000:02:04.0/sound/card1/audio1/dev
/sys/devices/pci0000:00/0000:00:1f.5/sound/card2/audio2/dev

i need simlink for 
/sys/devices/pci0000:00/0000:00:1e.0/0000:02:03.0/sound/card0/audio
 /sys/devices/pci0000:00/0000:00:1e.0/0000:02:04.0/sound/card1/audio1
 
udevinfo -a -p /sys/devices/pci0000:00/0000:00:1e.0/0000:02:03.0/sound/card0/audio

looking at device '/devices/pci0000:00/0000:00:1e.0/0000:02:03.0/sound/card0/audio':
 KERNEL=="audio"
 SUBSYSTEM=="sound"
 DRIVER==""
 ATTR{dev}=="14:4"

looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:02:03.0/sound/card0':
 KERNELS=="card0"
 SUBSYSTEMS=="sound"
 DRIVERS==""

*********************************************************************

udevinfo -a -p /sys/devices/pci0000:00/0000:00:1e.0/0000:02:04.0/sound/card1/audio1

looking at device '/devices/pci0000:00/0000:00:1e.0/0000:02:04.0/sound/card1/audio1':
 KERNEL=="audio1"
 SUBSYSTEM=="sound"
 DRIVER==""
 ATTR{dev}=="14:20"

looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:02:04.0/sound/card1':
 KERNELS=="card1"
 SUBSYSTEMS=="sound"
 DRIVERS==""

*********************************************************************
 i try use ATTR{dev}=="14:20" but it change after reboot too =(

can i use number of pci slot ? or even more ?

-------- stop --------

but i have not answer =(

i try use externel program and it work now

i crеate file /root/device_namer

#!/bin/bash

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

if [ `echo $1 | grep "0000:02:03.0"| wc -l` != 0 ]; then
  echo radio1;
  exit 0;
fi

if [ `echo $1 | grep "0000:02:04.0"| wc -l` != 0 ]; then
  echo radio2;
  exit 0;
fi

i bad bash programmist =) then i add net line to /etc/udev/rules.d/10-local.rules

KERNEL=="audio*", PROGRAM="/root/device_namer %p", SYMLINK+="%c"

how it work : when system boot udev run some like 
'/root/device_namer /devices/pci0000:00/0000:00:1e.0/0000:02:04.0/sound/card1/.tmp-14-20'
and create simlink what i need

-- 
Igor Tolstov
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux