FC3 T2 alsactl store issues unresolved

Matias Feliciano feliciano.matias at free.fr
Sat Sep 25 19:25:10 UTC 2004


Le sam 25/09/2004 à 01:37, maxer1 a écrit :
> Latest dev after FC3T2 upgrade.
> 
> [...]
> Any ideas why alsactl store doesn't appear to be working at all?
> 

"store" works :-) It's "restore" that doesn't work.

> Is this a problem in initscripts?
> 

Sorry for my _very_ poor English.
I spent one day with this.

Initscripts, is not the only problem. The issue is with
udev/alsactl/alsa-lib. As with many devices, alsactl talk to the
hardware only with a special file (which provide major and minor
number).

The modprobe.conf :
        install snd-ens1371 /sbin/modprobe --ignore-install snd-ens1371 && /usr/sbin/alsactl restore >/dev/null 2>&1 || :

"alsactl restore" is done _before_ udev create special files in
/dev/snd/. udev is executed _after_ modprobe.

At boot time, 'alsactl restore' "silently print" :
alsactl: load_state:1134: No soundcards found...

alsactl is trying to open the device but failed :
        open("/dev/snd/controlC0", O_RDONLY)    = -1 ENOENT (No such file or directory)
        open("/dev/aloadC0", O_RDONLY)          = -1 ENOENT (No such file or directory)

So, the setting is not restored.

I find two ways to solve this issue :
	- adapt initscript and modprobe.conf
	- patch alsa-lib to use /sys

The first is simple, works, but not perfect.
The second is "new" because we use a device without special file already
in place. Seams there is something broken here :-)

The first solution (not tested and i am very weak in shell programming) :
        --- rc.sysinit.orig     2004-09-25 20:20:09.060208486 +0200
        +++ rc.sysinit  2004-09-25 20:24:48.494075002 +0200
        @@ -204,6 +204,9 @@
         for module in `/sbin/modprobe -c | awk '/^alias[[:space:]]+snd-card-[[:digit:]]+[[:space:]]/ { print $3 }'` $audio; do
                modprobe $module >/dev/null 2>&1
         done
        +if [ "$module" = "" ] ; then
        +       /usr/sbin/alsactl restore >/dev/null 2>&1
        +fi
        
         echo -n $" audio"
        
At that point in rc.sysinit, /usr is not mounted ! and libasound is in
/usr/lib (and some other piece of alsa stay in /usr/share/alsa). Perhaps
the soundcards initialisation should be moved after the mount all other
partitions.
Note that the modules are "modprobed" two times ! With "/sbin/modprobe
-c ..." and with $audio provided by kmodule.

For modprobe.conf we can remove this useless line :
        install snd-XXXX /sbin/modprobe --ignore-install snd-XXXX && /usr/sbin/alsactl restore >/dev/null 2>&1 || :


That's all for the first solution.




The second solution i try to make is a little more harder.
If alsa-lib don't find the special file, alsa-lib create it "on the
fly". Only root can do that.

Only /dev is writable at hardware initialisation (if we don't touch
rc.sysinit).

This "quick and dirty" patch use /sys to find out the major and minor
number. This information is in /sys/class/sound/controlCN/dev .

See attachment. Be very careful, I am not an alsa hacker :-) Works here
only (two sound cards).



And now a word about how s-c-soundcard handle multi-cards.
Why it touch/create /etc/asound.conf ?
asound.conf is for alsa-lib, the end-user! He can add plugins, etc...
There are nothing to do with the hardware detection and it is not the
best way to identify a sound card. We should use modprobe.conf or udev
(like scsi_id does, or like i do with my ide drives :-)). With udev,
it's harder but possible.



Please, don't touch /etc/asound.conf. 
The only benefit of asound.conf using by s-c-soundcard is to not
unload/reload the modules (or reboot).
And think fc2 users already use a custom asound.conf.
btw, fc3 provide OSS emulation (for realplay, etc...) and OSS software
... don't use alsa-lib (asound.conf).

There is a ticket in bugzilla :
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=133535

But how Fedora handle the sound is broken in many places and this can be
summarize by "Sound settings not saved on shutdown".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: quick_fix_udev.patch
Type: text/x-patch
Size: 5863 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/test/attachments/20040925/cfbc701d/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Ceci est une partie de message
	=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e=2E?=
Url : http://lists.fedoraproject.org/pipermail/test/attachments/20040925/cfbc701d/attachment-0001.bin 


More information about the test mailing list