Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 529832

Summary: media-sound/alsa-utils-1.0.28 - alsactl: state_lock:114: file /var/lib/alsa/asound.state lock error: No such file or directory
Product: Gentoo Linux Reporter: Michael Seifert <m.seifert>
Component: Current packagesAssignee: Gentoo ALSA team [DISABLED] <alsa-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Michael Seifert 2014-11-19 08:21:44 UTC
The commands alsactl store and alsactl restore do not execute properly. They exit with a lock error, resulting in alsamixer volumes not being stored and loaded properly.

Some of the things I have tried to fix the issue to no avail:
- Removing asound.state.lock
- Removing asound.state
- Installing the newest alsa-utils from git

The only thing that seems to help is calling alsactl with the -L (no locking) option. However, the systemd units alsa-store and alsa-restore do not call alsactl with this option.

Reproducible: Always

Steps to Reproduce:
1. alsactl restore

Actual Results:  
alsactl: state_lock:114: file /var/lib/alsa/asound.state lock error: No such file or directory
alsactl: load_state:1677: Cannot open /var/lib/alsa/asound.state for reading: No such file or directory
alsactl: sysfs_init:48: sysfs path '/sys' is invalid

/usr/share/alsa/init/ca0106:19: control element not found
/usr/share/alsa/init/ca0106:20: control element not found
alsactl: sysfs_init:48: sysfs path '/sys' is invalid

Found hardware: "USB-Audio" "USB Mixer" "USB0d8c:000c" "" ""
Hardware is initialized using a generic method


Expected Results:  
alsactl restore exits silently with status 0.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-11-19 10:23:52 UTC
Please post your `emerge --info media-sound/alsa-utils' output in a comment.
Comment 2 Michael Seifert 2014-11-20 07:18:15 UTC
Sorry for the delay, here is the emerge --info

# emerge --info media-sound/alsa-utils
Portage 2.2.14 (python 2.7.8-final-0, default/linux/amd64/13.0/desktop/kde/systemd, gcc-4.8.2, glibc-2.19-r1, 3.17.3-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.17.3-gentoo-x86_64-AMD_Opteron-tm-_Processor_6128-with-gentoo-2.2
KiB Mem:    32880760 total,  29610672 free
KiB Swap:    6313524 total,   6313524 free
Timestamp of tree: Thu, 20 Nov 2014 01:45:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
distcc 3.1 x86_64-pc-linux-gnu [enabled]
app-shells/bash:          4.2_p53
dev-java/java-config:     2.2.0
dev-lang/perl:            5.18.2-r2
dev-lang/python:          2.7.8, 3.3.5-r1, 3.4.2
dev-util/cmake:           3.0.2
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.2, 4.9.2
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.3-r2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.17-r1 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo x-portage seden printer-drivers dilfridge java fw-overlay proaudio smt-local gentoo-haskell x11
Installed sets: @system
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=amdfam10 -mtune=amdfam10 -mcx16 -msahf -mpopcnt -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="${CONFIG_PROTECT} /etc /etc/idea/conf /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.1/conf /usr/share/themes/oxygen-gtk/gtk-2.0 /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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"
CXXFLAGS="-O2 -march=amdfam10 -mtune=amdfam10 -mcx16 -msahf -mpopcnt -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet --keep-going --autounmask=y --jobs=9 --load-average=8"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distcc distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://gentoo.inode.at/source/ ftp://gd.tuwien.ac.at/opsys/linux/gentoo/ http://gd.tuwien.ac.at/opsys/linux/gentoo/"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j21 -l20"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /var/lib/layman/seden /var/lib/layman/printer-drivers /var/lib/layman/dilfridge /var/lib/layman/java /var/lib/layman/fw-overlay /var/lib/layman/pro-audio /var/lib/layman/smt-local /var/lib/layman/haskell /var/lib/layman/x11"
USE="3dnow 3dnowext X a52 aac accessiblity acl acpi alsa amd64 avahi bazaar berkdb branding bzip2 cairo cdda cddb cdparanoia cdr clamav cli cracklib crypt cups cxx dbus declarative docbook dri dts dvd dvdr emboss encode exif faac faad fam firefox flac fortran ftp gdbm gif git glamor gnutls gpm gstreamer iconv id3tag ipv6 jack java javascript jpeg kde kipi kvm lame latex lcms ldap libnotify llvm logrotate lv2 lzma lzo mad matroska mmx mmxext mng modules mp3 mp4 mpeg multilib musicbrainz ncurses nfs nls nptl ntfsprogs ogg oggvorbis opengl openmp opus pam pango pcre pdf phonon plasma png policykit ppds projectm pulseaudio python qemu qt3support qt4 readline samba schroedinger sdl semantic-desktop session spell spice sse sse2 ssl startup-notification subversion svg systemd tcpd telepathy theora threads tiff truetype udev udisks unicode upower usb vlc vnc vorbis vpx vst wavpack wma wmf wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid xvmc zeroconf zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 cgi cgid 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="btrfs" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="coreboot emu pc qemu" INPUT_DEVICES="keyboard mouse evdev roccat_kone roccat_savu" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de sv sv_SE" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="arm x86_64" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="mga radeon vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

media-sound/alsa-utils-1.0.28 was built with the following:
USE="libsamplerate ncurses nls -doc (-selinux)" ABI_X86="64"
Comment 3 Michael Seifert 2014-12-31 12:39:53 UTC
When fiddling around with the issue another time, I noticed that the default path for the lock file was /var/lock/asound.state.lock. This was surprising, since there was a lock file in /var/lib/alsa, too.

However, after some further investigation, it turned out that the symlink /var/lock -> /run/lock was missing and alsactl could not create a lock file, because it could not find the base directory /var/lock/.
After restoring the symlink, alsactl store and alsactl restore work again as expected.