Hi,

This is Dave J. Andruczyk's post to the mailing list:

Alsa DEVFS Howto

I managed to solve my own problem with my previous
issues with ALSA on devfs. I'm going to share them in
case people have the same issues. (and they will on
devfs)

In /etc/init.d/alsasound (the alsa startup/shutdown
script) there is a small section that allows a user to
have a little script run on startup to take care of
any issues that would always need to be done for
whatever reason.

Example 6-1. asound Start up


The snippet of code is
       # run card-dependent scripts
         for i in $drivers; do
           t=`echo $i | sed -e
's/snd-card-\(.*\)/\1/'`
           if [ -x $alsascrdir/$t ]; then
             $alsascrdir/$t
           fi
         done

       $drivers in the script represents the
snd-card-* lines in /etc/modules.conf
       in my case it comes back with
"snd-card-emu10k1"

       $t from above is then equivalent to "emu10k1"


What it does is look for a file in /etc/alsa.d that is
executable that is the name of the DRIVER used for
your card. So on my box I use a SoundBlaster live. The
module is snd-card-emu10k1. This script is looking for
a file called "emu10k1". If it finds it it will run it
when the alsasound script is called with the "start"
argument. (redhat/mdk sysVinit style systems.) Others
may use a different script, check your systems.

In that file I put in three simple lines:

    *

      modprobe snd-pcm-oss
    *

      modprobe snd-mixer-oss
    *

      modprobe snd-seq-oss

make sure the file (emu10k1 in my case) is executable
(chmod +x emu10k1) and its located in the /etc/alsa.d/
or in the place defined by the alsascrdir variable in
the alsasound script. My script defines it as:
alsascrdir=/etc/alsa.d

This takes care of getting OSS compat loaded every
time alsa starts.

If you are NOT using devfs, then you can just reset
the permissions of the audio devices by hand with
chmod/chown. (or use the ./snddevices script in the
alsa-driver source to do it for you)

Now permissions of OSS modules on devfs systems, is
taken care of in /etc/devfsd.conf

There's two ways to do it, one is the Mandrake (and
probably other vendors ways)


# Vendor way 
REGISTER      sound/.*        EXECUTE
/sbin/pam_console_apply


This requires reading the man page for
pam_console_apply ahnd making the necessary
adjustments to the files referenced in the man page.


Or the simpler (yet potentially less secure way)
REGISTER        sound/.*        PERMISSIONS root.audio
660
                                                  
USER.GROUP MODE (rw,rw,no-access)


Make sure the user account that you run OSS audio apps
is either root, or in the audio group. (you could use
any group name if you want)

I've found the second way easier to use and simpler
for my usage situation, you may have reasons to NOT do
it this way.

The last is ALSA permissions. These are controlled
from modules.conf as paramaters to the snd module as
below. The only thing I don't like is you have to
specify the uid/gid as NUMERIC, not string based.
(Thus I have to use 81 instead of "audio") Notes to
developers: Is it too hard to make it accept the
string equivalent, since I doubt gid 81 is the audio
group on all the various linux distributions.

    *

      options snd snd_major=116 \
    *

      snd_cards_limit=1 \
    *

      snd_device_mode=0660 \
    *

      snd_device_gid=81 \
    *

      snd_device_uid=0

This makes all the /proc/asound/dev nodes owned by
root.audio (audio is gid 81 on my box) at mode 660
(rw,rw,no access)
 --Dave J. Andruczyk 

If Dave's document is interesting, perhaps it should
be published.

parker

--- George <[EMAIL PROTECTED]> wrote:
> On Tue, 2002-04-23 at 00:38, Kjetil Tjensvold
> [EMAIL PROTECTED]
> wrote:
> > cd to alsa-driver-0.9.0beta12 dir.
> > type ./snddevices
> > That will probably solve your problem. 
> 
> Thank you for the suggestion.  My understanding is
> that snddevices
> creates devices in the absence of devfs, which I am
> using.  I tried
> snddevices anyway at your suggestion and it didn't
> work.
> 
> I'm locked into using devfs because I'm running the
> Linux Terminal
> Server Project.  The computer with the Delta 44 has
> no hard drive, no
> CD-ROM drive, and no floppy drive.
> 
> My understanding is that ALSA works with devfs.  Am
> I right?
> 
> George
> 
> 
> 
> _______________________________________________
> Alsa-user mailing list
> [EMAIL PROTECTED]
>
https://lists.sourceforge.net/lists/listinfo/alsa-user


__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

_______________________________________________
Alsa-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to