You are not logged in.

#1 2003-01-28 05:27:32

BluPhoenyx
Member
Registered: 2002-12-23
Posts: 239

setting devfs sound permissions

(edited mar 3 2003 to fix my idiot typo) :oops

FYI for all those folks who seem to have a bit of problems using sound. Part of the trouble may be related to the devfs file system. I see where folks have used several methods to fix this but the secure & official method is as follows.

Create a group for sound access. It is not advised to use root for this for security reasons. In this method we use sndusers. GID shouldn't really matter. Add any users who need to access the sound devices to this group.

Edit the /etc/devfsd.conf file and add the following lines (remark optional.)

#give sndusers group access to sound devices
REGISTER  sound/.*  PERMISSIONS  root.sndusers  0660

Now, when the system starts, or technically when the sound devices are registered by devfs, they will automatically be accessible only to root and those in the sndusers group as read/write.


BluPhoenyx

Offline

#2 2003-01-29 20:43:53

Rouslan
Member
From: New York USA
Registered: 2002-11-13
Posts: 76

Re: setting devfs sound permissions

Yup, that's right, and if you want devfs to create links from /dev/sound/some_device to /dev/some_device for compatibilty issues, than put this in your devfsd.conf:

#
# ALSA sound
REGISTER    ^sound/dsp$         CFUNCTION GLOBAL mksymlink $devname dsp
UNREGISTER  ^sound/dsp$         CFUNCTION GLOBAL unlink dsp
REGISTER    ^sound/mixer$       CFUNCTION GLOBAL mksymlink $devname mixer
UNREGISTER  ^sound/mixer$       CFUNCTION GLOBAL unlink mixer
REGISTER    ^sound/sequencer$   CFUNCTION GLOBAL mksymlink $devname sequencer
UNREGISTER  ^sound/sequencer$   CFUNCTION GLOBAL unlink sequencer
REGISTER    ^sound/midi$        CFUNCTION GLOBAL mksymlink $devname midi
UNREGISTER  ^sound/midi$        CFUNCTION GLOBAL unlink midi

Also: in the 2.5 kernel Documentation it's recommended to put this in front of your Alsa sound portion in /etc/devfsd.conf :

LOOKUP       snd      MODLOAD snd

Rouslan

Offline

#3 2003-02-25 17:06:20

Nickm
Member
From: Netherlands
Registered: 2003-02-25
Posts: 106

Re: setting devfs sound permissions

hehe just have chmod a+rw /dev/sound/* in my rc.local smile

Offline

#4 2003-02-25 17:45:23

orelien
Forum Fellow
From: France
Registered: 2002-12-05
Posts: 220
Website

Re: setting devfs sound permissions

Or:

REGISTER sound/.* PERMISSIONS root.users 660
REGISTER snd/.*   PERMISSIONS root.users 660

(note: the second line is for alsa users only).
All users can now have access to sound devices.

BTW, it is now documented in the FAQ section wink

Offline

#5 2003-02-26 05:38:20

BluPhoenyx
Member
Registered: 2002-12-23
Posts: 239

Re: setting devfs sound permissions

Nickm wrote:

hehe just have chmod a+rw /dev/sound/* in my rc.local smile

It's the joy of Linux that you can do things in more than one way.

Even more is the joy of learning that there are other ways of doing things which might come in handy at some future time. Your method was the whole reason this thread was started.


BluPhoenyx

Offline

#6 2003-03-03 01:08:11

BluPhoenyx
Member
Registered: 2002-12-23
Posts: 239

Re: setting devfs sound permissions

Are you using ALSA or OSS? My info was for OSS so I don't know how much different it will be for ALSA. I would think it would be similar. The permissions should be anyhow.

Do the permissions actually get changed? Have you checked them after booting to make sure? You can always make the changes by hand and have the devfs system save the settings for you. I really don't like this since you never know when something could screw up. I like to make sure I know how to get the settings right from bootup just in case I have to do it again.

Also is the /dev/dsp device being created properly?

I know that not all systems are the same when it comes to sound. Even the difference between OSS modules for the SB Live and the Yahama (ymfpci) compared to the SB Awe and SB 16.

Based on what you typed in the message, things should work. Verify that there are no typos. BTW, do you need both the sound/.* and snd/.* scans in the devfs file? This might be confusing the daemon (I had a similar issue testing other options). My OSS only uses the sound, ALSA may only use the snd. Select which your system uses and # the other off.


BluPhoenyx

Offline

#7 2003-03-03 04:42:01

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: setting devfs sound permissions

if you installed alsa and are using any sound driver that has the snd- prefix then you are using alsa. if you are only using sound/ and the kernel drivers for your card (ie the will not have the snd- prefix) then you are using OSS.


AKA uknowme

I am not your friend

Offline

#8 2003-03-04 00:17:44

BluPhoenyx
Member
Registered: 2002-12-23
Posts: 239

Re: setting devfs sound permissions

jeff wrote:

So was it really /etc/devfsd.conf along? Or should /etc/devfs.conf have worked?

I can't believe I never even noticed that stupid of a typo. I've read that message several times and read yours a couple times as well.

Now that you pointed it out I will fix it as the file is actually /etc/devfsd.conf

Thanks


BluPhoenyx

Offline

#9 2003-03-05 08:56:18

Arielext
Member
From: Amersfoort, the Netherlands
Registered: 2002-08-12
Posts: 362
Website

Re: setting devfs sound permissions

you can save your alsa settings so you don't have to unmute your soundcard all the time
or if you are using sfdif output you can map your pcm channels to your spdif out (which don't need to be unmuted at all!)

I promised an "howto" a few weeks ago, but I've moved and I don't have internet at my new home yet sad ...

playing with arch at work, seeing the new xfree and all but unable to install it at home is frustating ...


apt-get install arch

Offline

#10 2003-03-05 23:44:41

BluPhoenyx
Member
Registered: 2002-12-23
Posts: 239

Re: setting devfs sound permissions

It is also possible to have aumix automated in the modules.conf system. My 'other' post on sound mentions this and it should work with alsa as well. Then there is a script which a user made which alows for the saving and loading of the alsa settings via rc daemon style. And of course the methods Arielext mentions.


BluPhoenyx

Offline

#11 2003-03-06 21:25:04

Guest
Guest

Re: setting devfs sound permissions

Hi -

    In my machine I did a modprobe cmpci (C Media) and from then on
KDE was able to get to /dev/dsp and use it. I was able to hear the kde startup  sound file.

    But when I tried playing my DVD / CD there is no sound output.
    but the programs seem to be working fine. The DVD video output is perfect, but no sound output.

    Any help / insight into the problem is greatly appreciated.

Thanks
Raj

#12 2003-03-06 23:11:01

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: setting devfs sound permissions

raj,

you cound also modrpobe in "sound" as well this should carry all of the sound parts that are needed besides dsp.


AKA uknowme

I am not your friend

Offline

#13 2003-03-07 00:54:11

BluPhoenyx
Member
Registered: 2002-12-23
Posts: 239

Re: setting devfs sound permissions

You should check first to make sure that the sound modules aren't already loaded. Generally the kernel will take care of this with OSS modules. Using the lsmod command you should see soundcore, sound as well as the cmpci module and possibly ac97_codec and uart401. The last two I don't know for sure as I haven't worked with cmedia stuff in a while.

A stupid sounding question but you don't mention it, did you verify the mixer settings? I don't mess with KDE much anymore neither do I play DVD's on my PC much.

Are you using the setups mentioned here for setting device permissions and module installations?


BluPhoenyx

Offline

#14 2003-03-07 01:07:37

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: setting devfs sound permissions

BluPhoenyx wrote:

You should check first to make sure that the sound modules aren't already loaded. Generally the kernel will take care of this with OSS modules. Using the lsmod command you should see soundcore, sound as well as the cmpci module and possibly ac97_codec and uart401.

well sure but the soundcore and sound modules are not built in iirc. they will therefore have to be probed in.


AKA uknowme

I am not your friend

Offline

#15 2003-03-07 02:01:19

BluPhoenyx
Member
Registered: 2002-12-23
Posts: 239

Re: setting devfs sound permissions

As I mentioned to the user, they should check first to verify whether the modules get loaded.

With the OSS setups I have made where the sound system is modular (as is the AL OSS sound setup) one should be able to simply modprobe the proper driver and the kernel loads the sound and soundcore modules. This works for me with several setups including the YahamaPCI, the SB Live and even the older SB Awe32. The examples I've given for OSS setup are directly from the /etc/modules.conf files I use.

This does require one kernel option which I haven't verified with the default kernel (I don't use it and always build my own after install) IE, that the module autoloader option is turned on. THis allows it to load required support modules.

I can't guarantee how well this works with ALSA though.


BluPhoenyx

Offline

#16 2003-03-07 02:02:26

jon
Member
Registered: 2002-11-28
Posts: 87

Re: setting devfs sound permissions

sarah31 wrote:
BluPhoenyx wrote:

You should check first to make sure that the sound modules aren't already loaded. Generally the kernel will take care of this with OSS modules. Using the lsmod command you should see soundcore, sound as well as the cmpci module and possibly ac97_codec and uart401.

well sure but the soundcore and sound modules are not built in iirc. they will therefore have to be probed in.

where is the "soundcore" module, i can find the "sound" module but not soundcore. When i do a modprobe soundcore in a fresh arch .4 install i get "can't locate module soundcore". If anyone has it on their system can you tell me.

Thanks
Jon

Offline

#17 2003-03-07 04:14:04

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: setting devfs sound permissions

as far as i know sound = soundcore


AKA uknowme

I am not your friend

Offline

#18 2003-03-08 08:33:33

BluPhoenyx
Member
Registered: 2002-12-23
Posts: 239

Re: setting devfs sound permissions

Technically 'sound' does not equal 'soundcore'. You get 'soundcore' when the sound system is truly modular and you get 'sound' with the OSS general option.  Apparently the AL kernel builds the base of the sound system into the kernel which is not a problem. And yes jon, I have both soundcore and sound but not with the default kernel. The simple sound setup I posted should work with a variety of kernel variations as it lets the kernel load what it requires. You only need to adjust things for the proper module name.

Have you verified that the arts package is installed for KDE sound? Also, have you used the KDE configuration system to verify the sound settings? One more, did you run the KDE mixer and adjust the values properly AND save the defaults AND leave the mixer in the 'systray' so it will start on next execution.

FWIW, I just put together an Athlon system with Arch on it. It has the via (Avance) audio system on the motherboard (not my choice.) Anyhow, it's set to boot the system directly into KDE for the user. The only sound configuration it has is the modules.conf info.

alias sound-slot-0 via82cxxx_audio

When KDE starts, it init's the sound system and the mixer sets the volume settings. It doesn't have a dvd but the cdrom plays pretty well.


BluPhoenyx

Offline

Board footer

Powered by FluxBB