The first time alsa-utils is installed all the mixer levels are at zero (0), which leads many new users to assume that their Linux sound setup doesn't work. This could be avoided if the default mixer levels for master, CD playback and PCM were set to sensible defaults upon the first emerge of alsa-utils. One way to accomplish this would be to use alsactl to create a default /etc/asound.state file in the emerge work directory. This file could then be processed via a script to set the mixer values to 15 (or another reasonable value) for the three previously mentioned outputs. Finally it could be installed as /etc/asound.state which would make the new settings the default ones when /etc/init.d/alsasound is started for the first time. How about it? Should I go ahead a create the needed script? Reproducible: Always Steps to Reproduce:
if you can get a way to do it, I'd say great, but the problem is that the asound.state files are specific to the individual cards, and alsa-utils package is independent of knowing what cards are installed... so I don't think it's possible...
Created attachment 40152 [details] set_defaults.sh I understand that the asound.state files are different for each soundcard. That's why my proposed solution depends on first getting the default one, then processing it a bit, and finally restoring it. Should work most of the time. And I don't think the processing have to be so complex. The attached shell script works this way, please try it out. I haven't set any absolute paths or anything, so you'll probably want to adjust that if this solution seems viable. Also, the logic is pretty simple, just change all 0 values to 15. That should give people an idea that the volume is too low.
Reopening to encourage reviewing the added patch (newer than the bug itself and the previous reason for rejection).
that's great, but the problem is that it can't be incorporated into portage because we can't do something like that when we install a package.
Could you please provide some specific reasons? If it is really technically impossible (hard to see) to run this automatically, it should still be possible to provide it through the "ebuild ... config" mechanism. And displaying a note about it among the pkg_postinst messages.
Or if the issue is changing the ASLA mixer values, then use this method to create a default asound.state file that can be installed. That way, reasonable mixer levels will be set the first time the user starts alsasound.