LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-04-2004, 06:30 PM   #1
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Rep: Reputation: 64
udev, /dev & alsa


I just thought I would share something I found out about alsa & udev.

I, along with a few others I suspect, was wondering where /dev/dsp and friends had got to when running udev on kernel 2.6.*

I have a SBlive soundcard and compile ALSA separately from the kernel.

All was fine until udev. udev is still at a fairly beta stage on Slackware I think, and although some ALSA stuff appeared in /dev/snd, there was a fair bit missing.
I think most of it is really for OSS compatibility, but this is important to some people, at least in kde.

First thing I tried was running the alsa snddevices script from rc.local. It worked, but seemed untidy.

From the Gentoo forums I discovered a post by Decibels, who wrote an initscript to load the missing devices into /dev. I modified this to go straight into /etc/udev/scripts/make_extra_nodes.sh. Notice /dev/snd is created. Although this dir was being created, it was too late (presumably because the alsa module is loaded later than the kernel built-in stuff) I also changed the permissions to something fairly lax, so be aware of this if you use it:

________________________________________________________________________

mkdir $udev_root/snd

# load some missing sound stuff:
mknod -m 666 /dev/snd/controlC0 c 116 0
mknod -m 666 /dev/snd/hwC0D0 c 116 4
mknod -m 666 /dev/snd/hwC0D1 c 116 5
mknod -m 666 /dev/snd/hwC0D2 c 116 6
mknod -m 666 /dev/snd/hwC0D3 c 116 7
mknod -m 666 /dev/snd/midiC0D0 c 116 8
mknod -m 666 /dev/snd/midiC0D1 c 116 9
mknod -m 666 /dev/snd/midiC0D2 c 116 10
mknod -m 666 /dev/snd/midiC0D3 c 116 11
mknod -m 666 /dev/snd/midiC0D4 c 116 12
mknod -m 666 /dev/snd/midiC0D5 c 116 13
mknod -m 666 /dev/snd/midiC0D6 c 116 14
mknod -m 666 /dev/snd/midiC0D7 c 116 15
mknod -m 666 /dev/snd/pcmC0D0c c 116 24
mknod -m 666 /dev/snd/pcmC0D0p c 116 16
mknod -m 666 /dev/snd/pcmC0D1c c 116 25
mknod -m 666 /dev/snd/pcmC0D1p c 116 17
mknod -m 666 /dev/snd/pcmC0D2c c 116 26
mknod -m 666 /dev/snd/pcmC0D2p c 116 18
mknod -m 666 /dev/snd/pcmC0D3p c 116 19
mknod -m 666 /dev/snd/pcmC0D3c c 116 27
mknod -m 666 /dev/snd/pcmC0D4c c 116 28
mknod -m 666 /dev/snd/pcmC0D4p c 116 20
mknod -m 666 /dev/snd/pcmC0D5c c 116 29
mknod -m 666 /dev/snd/pcmC0D5p c 116 21
mknod -m 666 /dev/snd/pcmC0D6c c 116 30
mknod -m 666 /dev/snd/pcmC0D6p c 116 22
mknod -m 666 /dev/snd/pcmC0D7c c 116 31
mknod -m 666 /dev/snd/pcmC0D7p c 116 23
mknod -m 666 /dev/snd/seq c 116 1
mknod -m 666 /dev/snd/timer c 116 33
chown root:audio /dev/snd/*
mknod -m 666 /dev/admmidi0 c 14 14
mknod -m 666 /dev/admmidi1 c 14 30
mknod -m 666 /dev/admmidi2 c 14 46
mknod -m 666 /dev/admmidi3 c 14 62
chown root:audio /dev/admmidi*
mknod -m 666 /dev/adsp0 c 14 12
mknod -m 666 /dev/adsp1 c 14 28
mknod -m 666 /dev/adsp2 c 14 44
mknod -m 666 /dev/adsp3 c 14 60
chown root:audio /dev/adsp*
mknod -m 666 /dev/amidi0 c 14 13
mknod -m 666 /dev/amidi1 c 14 29
mknod -m 666 /dev/amidi2 c 14 45
mknod -m 666 /dev/amidi3 c 14 61
chown root:audio /dev/amidi*
mknod -m 666 /dev/amixer0 c 14 11
mknod -m 666 /dev/amixer1 c 14 27
mknod -m 666 /dev/amixer2 c 14 43
mknod -m 666 /dev/amixer3 c 14 59
chown root:audio /dev/amixer*
mknod -m 666 /dev/dmfm0 c 14 10
mknod -m 666 /dev/dmfm1 c 14 26
mknod -m 666 /dev/dmfm2 c 14 42
mknod -m 666 /dev/dmfm3 c 14 58
chown root:audio /dev/dmfm*
mknod -m 666 /dev/dmmidi0 c 14 9
mknod -m 666 /dev/dmmidi1 c 14 25
mknod -m 666 /dev/dmmidi2 c 14 41
mknod -m 666 /dev/dmmidi3 c 14 57
chown root:audio /dev/dmmidi*
mknod -m 666 /dev/mixer0 c 14 0
mknod -m 666 /dev/mixer1 c 14 16
mknod -m 666 /dev/mixer2 c 14 32
mknod -m 666 /dev/mixer3 c 14 48
chown root:audio /dev/mixer*
mknod -m 666 /dev/music c 14 8
chown root:audio /dev/music

ln -s /dev/adsp0 /dev/adsp
ln -s /dev/amidi0 /dev/amidi
ln -s /dev/midi0 /dev/midi
ln -s /dev/music /dev/sequencer2

______________________________________________________________________


if you are interested in using this, first back up the original.
Then read /dev and see what is already there, and remove from the above list
then paste into the file make_extra_nodes.sh.
You may also want to review the permissions in /etc/udev/permissions.d/udev.permissions.

I hope that was at least food for thought for someone - it took me 20mins to write!

tobyl
 
Old 07-05-2004, 04:10 AM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
Would it not be simpler to build what you need into the kernel?
 
Old 07-05-2004, 04:35 AM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Most of this stuff is already provided by the new udev package, here is what I get without modif :

$ ls -al /dev/* | grep audio
lrwxrwxrwx 1 root root 11 2004-07-05 11:35 /dev/audio -> sound/audio
crw-rw--w- 1 root audio 14, 9 2004-07-05 11:35 /dev/dmmidi
crw-rw--w- 1 root audio 14, 2 2004-07-05 11:35 /dev/midi
crw-rw-rw- 1 root audio 116, 0 2004-07-05 13:34 controlC0
crw-rw--w- 1 root audio 116, 4 2004-07-05 11:35 hwC0D0
crw-rw-rw- 1 root audio 116, 8 2004-07-05 11:35 midiC0D0
crw-rw--w- 1 root audio 116, 24 2004-07-05 11:35 pcmC0D0c
crw-rw-rw- 1 root audio 116, 16 2004-07-05 11:35 pcmC0D0p
crw-rw--w- 1 root audio 116, 25 2004-07-05 11:35 pcmC0D1c
crw-rw--w- 1 root audio 116, 26 2004-07-05 11:35 pcmC0D2c
crw-rw-rw- 1 root audio 116, 19 2004-07-05 11:35 pcmC0D3p
crw-rw-rw- 1 root audio 116, 33 2004-07-05 11:35 timer
crw-rw--w- 1 root audio 14, 12 2004-07-05 11:35 adsp
crw-rw--w- 1 root audio 14, 4 2004-07-05 11:35 audio
crw-rw--w- 1 root audio 14, 3 2004-07-05 11:35 dsp
crw-rw--w- 1 root audio 14, 0 2004-07-05 11:35 mixer
$
 
Old 07-05-2004, 09:19 AM   #4
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
/sbin/udevstart should take care of this as well.

Udev should work fine as long as you have hotplug enabled, as well -- the two work together to create the /dev nodes you need.

--Shade
 
Old 07-05-2004, 12:25 PM   #5
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Original Poster
Rep: Reputation: 64
Thanks for your comments
Andrew: yes this is a fair comment. Up until now I have tried to keep things modular, and Slackware is designed to use alsa as a module. Also due to various problems with sound in the past I have found compiling my own alsa to be the most successful.

Keefaz & Shade: I went to all this trouble precisely because I was not getting the correct entries in /dev. Yes, I have hotplug and udev, the most recent versions.
I did get some stuff like keefaz but with several omissions, including /dev/dsp and /dev/mixer. (actually I missed /dev/dsp and /dev/dsp > /dev/dsp0 in my first post)

I am now wondering whether something else is amiss for these entries to be missed by udev. Still, it is working now.
 
Old 07-05-2004, 01:47 PM   #6
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
I ran into the problem when I disabled hotplug on my laptop... Didn't have the problem before.

Running udevstart and re-enabling hotplug corrected the problems, though -- Just sharing my experience

I need to read up some more on dynamic device creation -- what hotplug's role is with udev -- that sort of thing.

--Shade
 
Old 07-05-2004, 02:52 PM   #7
lupin_the_3rd
Member
 
Registered: Oct 2003
Location: Memphis, TN
Distribution: Slackware current
Posts: 485

Rep: Reputation: 30
Exact same situation here... disabled hotplug and devices disappeared... turned it back on and sound worked again...
 
Old 07-09-2004, 08:13 AM   #8
jymbo
Member
 
Registered: Jan 2003
Posts: 217

Rep: Reputation: 30
This is from my post here.

Quote:
After reading through the Slack10 changelogs (which is what I should've done in the first place), I found that the major change is in the new sysvinit. According to the changelogs, sysvinit will check if:

a.) You are running a 2.6 kernel
b.) If your 2.6 kernel has hotplug and sysfs enabled

...if these 2 conditions are met, then udev will be used...if not, devfs will be used.

I removed these 2 options in my 2.6 kernel, recompiled, and now my Slack system automagically switched-back to devfs (which is what I prefer). I can now uninstall the hotplugging daemon (I prefer a monolithic kernel).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add pseudo-terminals to /dev directory (Mandrake 10.1 & udev) blubery Mandriva 1 08-06-2005 12:46 PM
udev is about to beat me (/dev/null, etc) CowboyJ Linux - Hardware 5 07-06-2005 08:12 AM
udev doesn't create /dev/pktcdvd/0 logout_login Linux - Software 1 04-03-2005 11:29 PM
[Udev] Can I delete the content of /dev? lokee Linux - Software 6 02-04-2005 08:30 PM
how to tell udev to make a dev jimdaworm Slackware 10 08-13-2004 07:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration