Subject: Bug#527074: /etc/init.d/alsa-utils: `/etc/init.d/alsa-utils stop` triggers amixer error

From: Daniel T Chen <[email-masked]>
Date: Fri, 15 May 2009 16:50:59 -0400 (EDT)

tags 527074 + moreinfo
thanks

We need your amixer output. This error seems to stem from the fact that 
not all widgets have the expected functionality, so amixer reports errors. 
This implies that we need to refactor a few of the initscript's functions 
to check the capability of the widget prior to invoking an action on it.

In other words, not everyone will experience this error, because it's 
codec- and revision-specific.

---

From: Piotr Lewandowski <[email-masked]>
Date: Wed, 26 Aug 2009 20:42:19 +0200

* Daniel T Chen <[email-masked]>, 2009-05-15 16:50:
>tags 527074 + moreinfo
>thanks
>
>We need your amixer output.

Here you go:

#v+
Simple mixer control 'Master',0
   Capabilities: pvolume pswitch pswitch-joined
   Playback channels: Front Left - Front Right
   Limits: Playback 0 - 63
   Mono:
   Front Left: Playback 63 [100%] [3.00dB] [on]
   Front Right: Playback 63 [100%] [3.00dB] [on]
Simple mixer control 'PCM',0
   Capabilities: pvolume pswitch
   Playback channels: Front Left - Front Right
   Limits: Playback 0 - 31
   Mono:
   Front Left: Playback 16 [52%] [-10.50dB] [on]
   Front Right: Playback 16 [52%] [-10.50dB] [on]
Simple mixer control 'Mic',0
   Capabilities: cswitch cswitch-joined cswitch-exclusive
   Capture exclusive group: 0
   Capture channels: Mono
   Mono: Capture [on]
Simple mixer control 'Mic Boost',0
   Capabilities: volume
   Playback channels: Front Left - Front Right
   Capture channels: Front Left - Front Right
   Limits: 0 - 3
   Front Left: 3 [100%]
   Front Right: 3 [100%]
Simple mixer control 'Capture',0
   Capabilities: cvolume cswitch
   Capture channels: Front Left - Front Right
   Limits: Capture 0 - 15
   Front Left: Capture 0 [0%] [0.00dB] [on]
   Front Right: Capture 0 [0%] [0.00dB] [on]
Simple mixer control 'Mix',0
   Capabilities: cswitch cswitch-joined cswitch-exclusive
   Capture exclusive group: 0
   Capture channels: Mono
   Mono: Capture [off]
Simple mixer control 'Beep',0
   Capabilities: pvolume pvolume-joined pswitch pswitch-joined
   Playback channels: Mono
   Limits: Playback 0 - 15
   Mono: Playback 0 [0%] [-45.00dB] [off]
Simple mixer control 'Caller ID',0
   Capabilities: pswitch pswitch-joined
   Playback channels: Mono
   Mono: Playback [off]
Simple mixer control 'Digital',0
   Capabilities: cvolume
   Capture channels: Front Left - Front Right
   Limits: Capture 0 - 120
   Front Left: Capture 120 [100%] [30.00dB]
   Front Right: Capture 120 [100%] [30.00dB]
Simple mixer control 'Docking-Station',0
   Capabilities: cswitch cswitch-joined cswitch-exclusive
   Capture exclusive group: 0
   Capture channels: Mono
   Mono: Capture [off]
Simple mixer control 'Internal Mic Boost',0
   Capabilities: volume
   Playback channels: Front Left - Front Right
   Capture channels: Front Left - Front Right
   Limits: 0 - 3
   Front Left: 3 [100%]
   Front Right: 3 [100%]
Simple mixer control 'Off-hook',0
   Capabilities: pswitch pswitch-joined
   Playback channels: Mono
   Mono: Playback [off]
#v-

Regards,
-- 
Piotr Lewandowski

---

From: Elimar Riesebieter <[email-masked]>
Date: Wed, 26 Aug 2009 22:08:23 +0200

* Piotr Lewandowski [090826 20:42 +0200]
> >We need your amixer output.

Hmm, nothing far out. Could you please do as follows:

# rm /var/lib/alsa/asound.state
# alsamixer
  set volume et cetera...
# alsactl init
  ???
# alsactl store
# invoke-rc.d alsa-utils stop
  ???
# invoke-rc.d alsa-utils start
  ???

Elimar

-- 
  We all know Linux is great... it does infinite loops in 5 seconds.
        -- Linus Torvalds

---

From: Piotr Lewandowski <[email-masked]>
Date: Wed, 26 Aug 2009 22:34:09 +0200

># invoke-rc.d alsa-utils start

Sure.

#v+

# alsamixer

# alsactl init
Unknown hardware: "HDA-Intel" "Analog Devices AD1981" "HDA:11d41981,103c30a2,00100200 HDA:11c13026,103c30a2,00100700" "0x103c" "0x30a2"
Hardware is initialized using a guess method
/usr/share/alsa/init/default:51: control element not found
/usr/share/alsa/init/default:52: missing closing brace for format
/usr/share/alsa/init/default:52: error parsing CTL attribute
/usr/share/alsa/init/default:52: invalid rule

# alsactl store

# invoke-rc.d alsa-utils stop
Shutting down ALSA...amixer: Invalid command!
done.

Setting up ALSA...done.
#v-

Regards,
-- 
Piotr Lewandowski

---

From: Elimar Riesebieter <[email-masked]>
Date: Thu, 27 Aug 2009 10:06:13 +0200

> Unknown hardware: "HDA-Intel" "Analog Devices AD1981" "HDA:11d41981,103c30a2,00100200 HDA:11c13026,103c30a2,00100700" "0x103c" "0x30a2"

Do you need the modem snd_hda_codec_si3054?
You can try the following:
Create the file /etc/modprobe.d/sound.conf:

###
blacklist snd-hda-codec-si3054

alias snd-card-0       snd-hda-intel
options snd-hda-intel  index=0
options snd-hda-intel  model=hp
###

This will prevent snd-hda-codec-si3054 to load at boottime and load
snd-hda-intel with model parameter hp.

then run:

# alsa force-reload
# alsactl init
  ???

Elimar

-- 
  BOFH excuse #354:
  Chewing gum on /dev/sd3c

---

From: Piotr Lewandowski <[email-masked]>
Date: Thu, 27 Aug 2009 17:30:28 +0200

>Do you need the modem snd_hda_codec_si3054?
No.

>options snd-hda-intel  model=hp
I'm afraid that it didn't work.

#v+
# cat /etc/modprobe.d/sound.conf
blacklist snd-hda-codec-si3054

# alsa force-reload
Unloading ALSA sound driver modules: snd-hda-codec-analog snd-hda-intel snd-hda-codec snd-hwdep snd-pcm snd-seq snd-timer snd-seq-device snd-page-alloc (failed: modules still loaded: snd-hda-codec-analog snd-hda-codec snd-hwdep snd-pcm snd-timer snd-page-alloc).
Loading ALSA sound driver modules: snd-hda-codec-analog snd-hda-intel snd-hda-codec snd-hwdep snd-pcm snd-seq snd-timer snd-seq-device snd-page-alloc.

# alsactl init

# lsmod | grep snd
snd_seq                42436  0
snd_seq_device          6136  1 snd_seq
snd_hda_intel          22192  0
snd_hda_codec_analog    53456  1
snd_hda_codec          63580  2 snd_hda_intel,snd_hda_codec_analog
snd_hwdep               6120  1 snd_hda_codec
snd_pcm                62420  2 snd_hda_intel,snd_hda_codec
snd_timer              17436  2 snd_seq,snd_pcm
snd                    49060  8 snd_seq,snd_seq_device,snd_hda_intel,snd_hda_codec_analog,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
soundcore               6184  1 snd
snd_page_alloc          8180  2 snd_hda_intel,snd_pcm
#v-

-- 
Piotr Lewandowski

---

From: Elimar Riesebieter <[email-masked]>
Date: Fri, 18 Sep 2009 19:02:56 +0200

* Piotr Lewandowski [090827 17:30 +0200]
> options snd-hda-intel  model=hp

Try this which I found here [0]

######
alias char-major-116 snd
alias snd-card-0 snd-hda-intel
alias snd-card-1 snd-usb-audio

options snd-hda-intel index=0 model=hp-dv5 enable_msi=1
options snd-usb-audio index=1
######

[0] http://lists.debian.org/debian-user/2009/09/msg01278.html

Elimar

-- 
  Experience is something you don't get until 
  just after you need it!

---

From: Piotr Lewandowski <[email-masked]>
Date: Fri, 18 Sep 2009 22:08:30 +0200

>options snd-usb-audio index=1

Unfortunately amixer still shouts 'Invalid command!'.

#v+
# modprobe -r snd_hda_intel

# lsmod | grep ^snd_hda_intel

# modprobe snd-hda-intel index=0 model=hp-dv5 enable_msi=1

# lsmod | grep ^snd_hda_intel
snd_hda_intel          22192  0

# amixer -c 0 -q set Mic 0% mute
amixer: Invalid command!
#v-

Regards,
-- 
Piotr Lewandowski

---

From: Elimar Riesebieter <[email-masked]>
Date: Fri, 18 Sep 2009 22:23:33 +0200

* Piotr Lewandowski [090918 22:08 +0200]

> # amixer -c 0 -q set Mic 0% mute

So, I really have no glue. File a bug at [0] or ask at [1].
[0] https://bugtrack.alsa-project.org/alsa-bug/login_page.php
[1] http://mailman.alsa-project.org/pipermail/alsa-devel/

Sorry
Elimar

-- 
  On the keyboard of life you have always
  to keep a finger at the escape key;-)

---

From: Piotr Lewandowski <[email-masked]>
Date: Fri, 25 Sep 2009 20:54:18 +0200

Hi alsa-devel@!

One of the maintainers of alsa-utils package in Debian advised me to ask 
for your help. I've encountered following problem:

#v+
$ amixer -c 0 -q set Mic 0% mute
amixer: Invalid command!
#v-

This command is invoked from /etc/init.d/alsa-utils script during 
system shutdown. Do you have any ideas how to fix that?

Here is some basic info about my hardware:

#v+
$ lspci -v | sed -ne '/Audio/,/^$/p'
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High 
Definition Audio Controller (rev 01)
         Subsystem: Hewlett-Packard Company Device 30a2
         Flags: bus master, fast devsel, latency 0, IRQ 16
         Memory at f4580000 (64-bit, non-prefetchable) [size=16K]
         Capabilities: <access denied>
         Kernel driver in use: HDA Intel

$ cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.18a.

$ cat /proc/asound/cards
  0 [Intel          ]: HDA-Intel - HDA Intel
                       HDA Intel at 0xf4580000 irq 16

$ lsmod | grep snd
snd_hda_codec_si3054     3920  1
snd_hda_codec_analog    53708  1
snd_hda_intel           22092  0
snd_hda_codec           58808  3 snd_hda_codec_si3054,snd_hda_codec_analog,snd_hda_intel
snd_hwdep                6000  1 snd_hda_codec
snd_pcm                 62708  3 snd_hda_codec_si3054,snd_hda_intel,snd_hda_codec
snd_seq                 42120  0
snd_timer               17808  2 snd_pcm,snd_seq
snd_seq_device           6108  1 snd_seq
snd                     48420  9 snd_hda_codec_si3054,snd_hda_codec_analog,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_seq,snd_timer,snd_seq_device
soundcore                6204  1 snd
snd_page_alloc           8036  2 snd_hda_intel,snd_pcm
#v-

Notes from the battlefield can be found at Debian BTS #527074[1].

[1] http://bugs.debian.org/527074

Thanks for your help!

Regards,
-- 
Piotr Lewandowski

---

From: Elimar Riesebieter <[email-masked]>
Date: Sat, 26 Sep 2009 05:55:13 +0200

* Piotr Lewandowski [090925 20:54 +0200]
> Hi alsa-devel@!
> 
> One of the maintainers of alsa-utils package in Debian advised me to
> ask for your help. I've encountered following problem:
> 
> #v+

1. It would be an option to insert:
   'echo option "snd-hda-intel enable_msi=1"' >> /etc/modprobe.d/local.conf
2. It is a good idea to update to alsa-source 1.0.21-2 and build biuld
   your driver up from there.

Elimar

-- 
  Never make anything simple and efficient when a way 
  can be found to make it complex and wonderful ;-)