Summary: | /etc/init.d/alsasound doesn't always restore mixer volume | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Adam Nielsen <a.nielsen> |
Component: | New packages | Assignee: | Gentoo ALSA team [DISABLED] <alsa-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | boltomli, marc.blumentritt, pacho, shrdlu, zl29ah |
Priority: | High | ||
Version: | 2008.0 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Adam Nielsen
2009-08-16 03:19:40 UTC
Which card? Need emerge --info Not sure what you mean by 'which card' - it seems to fail for all sound cards on the system. (But if it fails for the first card, it does keep going and tries the next card - but whatever problem causes this error, it skips alsactl on both cards which I think it shouldn't.) $ emerge --info Portage 2.1.6.13 (default/linux/amd64/2008.0, gcc-4.3.4, glibc-2.10.1-r0, 2.6.30 x86_64) ================================================================= System uname: Linux-2.6.30-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6600_@_2.40GHz-with-gentoo-2.0.1 Timestamp of tree: Wed, 12 Aug 2009 16:00:01 +0000 distcc 3.1 x86_64-pc-linux-gnu [disabled] app-shells/bash: 4.0_p28 dev-java/java-config: 1.3.7-r1, 2.1.8-r1 dev-lang/python: 2.4.4-r6, 2.5.4-r3, 2.6.2-r1, 3.1 dev-python/pycrypto: 2.0.1-r8 dev-util/cmake: 2.6.4-r2 sys-apps/baselayout: 2.0.1 sys-apps/openrc: 0.4.3-r3 sys-apps/sandbox: 2.0 sys-devel/autoconf: 2.13, 2.63-r1 sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11 sys-devel/binutils: 2.19.1-r1 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6a virtual/os-headers: 2.6.30-r1 ACCEPT_KEYWORDS="amd64 ~amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=nocona -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-O2 -march=nocona -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://ftp.iinet.net.au/linux/Gentoo" LANG="en_AU.UTF-8" LC_ALL="en_AU.UTF-8" LDFLAGS="-Wl,-O1" LINGUAS="en_AU en_GB" MAKEOPTS="-j12" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage/layman/desktop-effects /usr/i686-mingw32/usr/portage" SYNC="rsync://rsync.teln.shikadi.net/gentoo-portage" USE="X a52 aac aalib acl acpi alsa amd64 berkdb bzip2 cairo cli cracklib crypt cups dbus dri dssi dts dv dvd exif ffmpeg flac gdbm gif gnome gpm gtk hal iconv ieee1394 inotify iproute2 ipv6 isdnlog jack java jpeg jpeg2k kde kipi ladcca ladspa libsamplerate lirc mad matroska mmx mng modplug mp3 mplayer mudflap multilib mysql ncurses nls nonfsv4 nptl nptlonly ogg opengl openmp pam pcre perl php png pppd pulseaudio python qt3support readline reflection sdl session slang smp speex spell spl sse sse2 ssl svg sysfs syslog tcpd theora threads tiff truetype unicode vorbis wmf x264 xinerama xml xorg xscreensaver xv xvid xvmc zlib" ALSA_CARDS="emu10k1" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev microtouch mutouch" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_AU en_GB" LIRC_DEVICES="it87 serial" USERLAND="GNU" VIDEO_CARDS="nvidia vesa vga nv none" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS (In reply to comment #2) > Not sure what you mean by 'which card' - it seems to fail for all sound cards > on the system. And they are? One's an onboard Realtek ALC889A (Intel HD audio) and the other's a USB MIDI interface with no mixer that I'm aware of. I don't think this is important though, the problem was caused by an ALSA upgrade and there's a typo in /usr/share/alsa/init/default, but the issue here is that typo causes the script to abort completely instead of skipping just that step and restoring volumes anyway. (In reply to comment #4) > One's an onboard Realtek ALC889A (Intel HD audio) and the other's a USB MIDI > interface with no mixer that I'm aware of. > > I don't think this is important though, the problem was caused by an ALSA > upgrade and there's a typo in /usr/share/alsa/init/default, but the issue here > is that typo causes the script to abort completely instead of skipping just > that step and restoring volumes anyway. > So there's a typo? I remember there being an issue with this recently, and it getting fixed, have you tried syncing and upgrading ALSA? Also, if you know what the typo is, can you post it here. Here's a diff of the typo, the wrong type of bracket was used after the word "values". But although that fixes this error, the bug is still there in that issues like these will make the script abort unnecessarily. It's just that normally you won't notice because everything is working properly :-) --- default.orig 2009-08-13 08:58:56.698197000 +1000 +++ default 2009-08-16 12:49:20.585378194 +1000 @@ -49,7 +49,7 @@ CTL{name}="Headphone Playback Volume",PROGRAM=="__ctl_search",GOTO="headphone0_end" # if master volume control is present, turn headphone volume to max ENV{has_pmaster_vol}=="true",CTL{values}="0dB",RESULT=="0",GOTO="headphone0_end" -ENV{has_pmaster_vol}=="true",CTL{values)="100%",GOTO="headphone0_end" +ENV{has_pmaster_vol}=="true",CTL{values}="100%",GOTO="headphone0_end" CTL{values}="$env{pvolume}",RESULT!="0",CTL{values}="$env{ppercent}" LABEL="headphone0_end" CTL{name}="Headphone Playback Switch",PROGRAM=="__ctl_search", \ So.. this is fixed long ago then & is a duplicate bug? alsa-utils-1.0.20-r5 (17 Aug 2009) 17 Aug 2009; Samuli Suominen <ssuominen@gentoo.org> +alsa-utils-1.0.20-r5.ebuild, +files/alsa-utils-1.0.20-init_default.patch: Fix brackets inside /usr/share/alsa/init/default wrt #281538. It's fixed long ago and the only relation to this bug is that it's a good example of how to trigger it. This bug is that the initscript aborts at the drop of a hat, it should be more robust and continue on, setting the volume etc. even after encountering a problem such as the bracket typo. I suppose it's more of an enhancement than a bug, but IMHO anything to increase the reliability of a system is good. same problem: # alsactl -f "/var/lib/alsa/asound.state" restore Unknown hardware: "VIA8233" "Realtek ALC650F" "AC97a:414c4723" "0x1458" "0xa002" Hardware is initialized using a guess method % lspci -v | grep -i audio 00:0b.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11) Subsystem: Pinnacle Systems Inc. PCTV pro (TV + FM stereo receiver, audio section) 00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 50) Subsystem: Giga-byte Technology GA-7VAX Onboard Audio (Realtek ALC650) Kernel driver in use: VIA 82xx Audio % eix -Ic alsa-* [I] media-libs/alsa-lib (1.0.22-r1@30.03.2010): Advanced Linux Sound Architecture Library [I] media-plugins/alsa-plugins (1.0.22@30.03.2010): ALSA extra plugins [I] media-sound/alsa-headers (1.0.22@30.03.2010): Header files for Advanced Linux Sound Architecture kernel modules [I] media-sound/alsa-utils (1.0.22-r1(0.9)@30.03.2010): Advanced Linux Sound Architecture Utils (alsactl, alsamixer, etc.) Found 4 matches. Trouble can fixed with workaround: in /etc/init.d/alsasound - alsactl -f "${alsastatedir}/asound.state" restore ${cardnum} \ + alsactl -I -f "${alsastatedir}/asound.state" restore ${cardnum} \ Same here: Unknown hardware: "HDA-Intel" "Realtek ALC883" "HDA:10ec0883,1458e601,00100002" "0x1458" "0xa002" Hardware is initialized using a guess method (In reply to comment #9) > Trouble can fixed with workaround: > in /etc/init.d/alsasound > - alsactl -f "${alsastatedir}/asound.state" restore ${cardnum} \ > + alsactl -I -f "${alsastatedir}/asound.state" restore ${cardnum} > \ Since /etc/init.d/alsasound can be overwritten by an update, I'd say that (lacking a proper fix) that workaround could go into /etc/conf.d/alsasound in an ALSACTL_OPTS variable or similar (of course the initscript has to support that, which it probably doesn't now). +*alsa-utils-1.0.25-r1 (20 Feb 2012) + + 20 Feb 2012; Tony Vroon <chainsaw@gentoo.org> +alsa-utils-1.0.25-r1.ebuild, + +files/alsasound.confd-r4, +files/alsasound.initd-r5: + Use -I option on alsactl restore to avoid aborting unnecessarily, as per Adam + Nielsen in bug #281631. libsamplerate is both a build & run time dependency, + as per Albert W. Hopkins in bug #403557. Remove unsupported autoload/unload + as it breaks with kmod, as per Ulenrich in bug #404535. Better late than never Adam. I can only apologise. *** Bug 298840 has been marked as a duplicate of this bug. *** Haha no worries, thanks for following through and fixing it! |