VectorLinux
October 31, 2014, 12:13:01 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: confused about hal and udev  (Read 1964 times)
bad_gui
Member
*
Posts: 61


« on: February 24, 2008, 03:53:10 pm »

I searched the forum and looked at http://reactivated.net/writing_udev_rules.html#syntax
but I'm confused about the udev rules that are already in /etc/udev and how I can change them.

The problem is that everytime I boot my system device assignments are mixed up.  I tried to fix
the problems but everything was reset when I rebooted.

I have a CDRW on /dev/hdc  and a DVDRW on /dev/hdd.

Quote
lrwxrwxrwx 1 root root  3 2008-02-24 08:46 /dev/cdr -> hdd
lrwxrwxrwx 1 root root  3 2008-02-24 08:46 /dev/cdrom -> hdd
lrwxrwxrwx 1 root cdrom 3 2008-02-24 08:46 /dev/cdrw -> hdd
lrwxrwxrwx 1 root cdrom 3 2008-02-24 08:46 /dev/cdwriter -> hdc
lrwxrwxrwx 1 root cdrom 3 2008-02-24 08:46 /dev/dvd -> hdd

Here is the relevant section from dmesg:

Code:
Probing IDE interface ide1...
hdc: HL-DT-ST GCE-8483B, ATAPI CD/DVD-ROM drive
hdd: _NEC DVD+RW ND-1100A, ATAPI CD/DVD-ROM drive
hdc: selected mode 0x42
hdd: selected mode 0x42
ide1 at 0x170-0x177,0x376 on irq 15
hdc: ATAPI 48X CD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33)
Uniform CD-ROM driver Revision: 3.20
hdd: ATAPI 40X DVD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33)

This also happens with my audio devices so that XMMS and skype
fail until I reassign input/output devices.

Intel ICH5: Intel ICH5 (hw:1,0)  but sometimes it is (hw:0,0)

Here is the section from udev-rules that seems to be responsible for assigning
names but do I replace these with my own rules or just add my rules to them?

Code:
# import optical drive properties and set CD partitions
KERNEL=="scd[a-z]|sr[0-9]*|hd[a-z]|pcd[0-9]*", IMPORT{program}="cdrom_id --export $tempnode"
ENV{ID_CDROM}=="?*", NAME="%k", GROUP="cdrom", MODE="0660", RUN+="cdrom-symlinks.sh %k"

# ALSA devices
SUBSYSTEM=="sound",             GROUP="audio"
SUBSYSTEM=="snd",               GROUP="audio"
KERNEL=="controlC[0-9]*",       NAME="snd/%k", MODE="0666"
KERNEL=="hw[CD0-9]*",           NAME="snd/%k", MODE="0662"
KERNEL=="pcm[CD0-9]*c",         NAME="snd/%k", MODE="0662"
KERNEL=="pcm[CD0-9]*p",         NAME="snd/%k", MODE="0666"
KERNEL=="midiC[D0-9]*",         NAME="snd/%k", MODE="0666"
KERNEL=="timer",                NAME="snd/%k", MODE="0666"
KERNEL=="seq",                  NAME="snd/%k", MODE="0666"

So to fix the CD/DVD problem I would replace the code above with:
Code:
SUBSYSTEM=="block", KERNEL=="hdc", SYMLINK+="cdrw", GROUP="cdrom"
SUBSYSTEM=="block", KERNEL=="hdd", SYMLINK+="dvdrw", GROUP="cdrom"

What do I do for ALSA?




Logged
The Headacher
Louder than you
Global Moderator
Vectorian
*****
Posts: 1552


I like the bass to go BOOM!


WWW
« Reply #1 on: February 25, 2008, 10:34:37 am »

Quote
Intel ICH5: Intel ICH5 (hw:1,0)  but sometimes it is (hw:0,0)

Here is the section from udev-rules that seems to be responsible for assigning
names but do I replace these with my own rules or just add my rules to them?
I don't know the udev way, but perhaps this can help? :
http://www.vectorlinux.com/forum2/index.php?topic=4888.0
Logged

Most music on my soundcloud page was arranged in programs running on VL.
bad_gui
Member
*
Posts: 61


« Reply #2 on: February 25, 2008, 02:39:13 pm »

I only have one soundcard.  I don't know why XMMS and Skype see multiple possible
devices  hw:0,0, hw:1,0 etc.  Since it varies each time I boot they may remember
all of the previous ones?  I tried "default" but that doesn't always work either.

I saw that Ubuntu and some other distros have a separate rule file for ALSA so I will
try to research those further.
Logged
rbistolfi
Packager
Vectorian
****
Posts: 2290


« Reply #3 on: February 25, 2008, 02:45:30 pm »

Those are different devices from your only sound card, like the recording device or the playing device. I use default in Skype and works for me, but the hw:x,x which is my recording device works too. Do you have a modem or a webcam with mic? those could be detected as audio devices, my Logitech works like that.
« Last Edit: February 25, 2008, 02:47:15 pm by rbistolfi » Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
bad_gui
Member
*
Posts: 61


« Reply #4 on: February 25, 2008, 06:16:52 pm »

Yes, you are right.  Skype can't tell whether my mic input is from the soundcard or the webcam.
Default works for the output device.

While poking around in the udev scripts I found an error.  The cd-devices.rules is not written
due to a syntax error (bash tutorials on the web indicate the command let is for math calculations).

Quote
root:# /lib/udev/cdrom-symlinks.sh
/lib/udev/cdrom-symlinks.sh: line 26: let: expression expected

Code:
# initialize some variables:
OPTICAL_DEVICE=$1
ID=${PHYSDEVPATH##*/}
let `/lib/udev/cdrom_id --export /dev/${OPTICAL_DEVICE}`

if ! [ -z $ID_CDROM ] && ! [ -e /dev/coldplug ]; then
        getlock
        if ! [ -e /etc/udev/rules.d/cd-devices.rules ]; then
                cat <<EOF > /etc/udev/rules.d/cd-devices.rules         
# Local CD/DVD rules to make the symlinks for your CD/DVD devices.
# These rules were generated by cdrom-symlinks.sh, but you can customize
# them if needed.
#
# If you delete this file, /lib/udev/cdrom-symlinks.sh will try to
# generate it again the next time udev is started.

EOF
Logged
rbistolfi
Packager
Vectorian
****
Posts: 2290


« Reply #5 on: February 26, 2008, 04:57:17 am »

I dunno about the script, but The_Headacher's howto about multiple sound cards will solve the Skype problem. Make your sound card the default instead the webcam's mic, then setup the input device as default in Skype.
Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
rbistolfi
Packager
Vectorian
****
Posts: 2290


« Reply #6 on: February 26, 2008, 05:11:58 am »

Another thing, afaik, ide kernel names change only if you change the ide slots for them inside the box (I mean the wires). The last two udev rules you propose in your first post will generate a symlink for each one, no matter the kernel name of the cdrom devices (i.e., will symlink /dev/cdrw to /dev/hdc and /dev/dvdrw /dev/hdd).
Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!