Subject: alsa-utils: restore fails after rename from "PC Speaker" to "Beep"

From: Kurt Roeckx <[email-masked]>
Date: Thu, 30 Dec 2010 14:48:32 +0100

Package: alsa-utils
Version: 1.0.23-3
Severity: important

Hi,

I think Linux 2.6.33 renamed "PC Speaker" to "Beep".  alsactl
doesn't seem to be liking this much.

During boot between kernels with different names I see:
Setting up ALSA...warning: 'alsactl restore' failed with error message 'Unknown hardware: "ICH" "SigmaTel STAC9700,83,84" "AC97a:83847600" "0x1043" "0x1493"
Hardware is initialized using a guess method
alsactl: set_control:1255: failed to obtain info for control #5 (No such file or directory)
alsactl: set_control:1255: failed to obtain info for control #6 (No such file or directory)'...done.

I think that SigmaTel thing is a modem and not related at all.

On a 2.6.32 kernel I get:
        control.5 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'PC Speaker Playback Switch'
                value true
        }
        control.6 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 1
                comment.range '0 - 15'
                comment.dbmin -4500
                comment.dbmax 0
                iface MIXER
                name 'PC Speaker Playback Volume'
                value 8
        }

Booting into a newer kernel, I get:
        control.5 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Beep Playback Switch'
                value false
        }
        control.6 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 1
                comment.range '0 - 15'
                comment.dbmin -4500
                comment.dbmax 0
                iface MIXER
                name 'Beep Playback Volume'
                value 0
        }

So it's renamed, volume turned to 0 and muted.

So I've changed it manually so that is says:
        control.5 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Beep Playback Switch'
                value true
        }
        control.6 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 1
                comment.range '0 - 15'
                comment.dbmin -4500
                comment.dbmax 0
                iface MIXER
                name 'Beep Playback Volume'
                value 15
        }

(On, volume at 15)

Rebooting into a .32 kernel gets me the volume of 8 again.

So it seems that for .32 it sets up reasonable defaults, while for newer it just turns it off.
But I'm expecting my settings to be saved, even after a rename.

The manpage says:
       -F, --force
              Used  with restore command.  Try to restore the matching control elements as much as possible.  This option is
              set as default now.

This doesn't seem to be doing what I expect it to do.

Kurt

---

From: Elimar Riesebieter <[email-masked]>
Date: Thu, 30 Dec 2010 17:08:01 +0100

Hi Kurt,

> alsactl: set_control:1255: failed to obtain info for control #6 (No such file or directory)'...done.
[...]
> But I'm expecting my settings to be saved, even after a rename.

Could you please apply attached patch to /etc/init.d/alsa-utils and
test again?

Thanks
Elimar

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

---

From: Elimar Riesebieter <[email-masked]>
Date: Thu, 30 Dec 2010 17:11:01 +0100

Hi Kurt,

now with attachment ;)

[...]

Thanks
Elimar

-- 
  Experience is something you don't get until 
  just after you need it!
--- alsa-utils.orig	2010-12-30 16:58:39.905964578 +0100
+++ alsa-utils	2010-12-30 17:03:59.972338203 +0100
@@ -206,6 +206,10 @@
 	# On MacBookPro5,3 and later models (See Bug#597791)
 	unmute_and_set_level "Front Speaker" "80%"
 
+	# SigmaTel renames controls for kernels > 2.6.32 (See Bug#608388)
+	switch_control "Beep Playback Switch" on
+	unmute_and_set_level "Beep Playback Volume" "80%"
+
 	return 0
 }

---

From: Kurt Roeckx <[email-masked]>
Date: Thu, 30 Dec 2010 20:26:34 +0100

> Could you please apply attached patch to /etc/init.d/alsa-utils and

That patch doesn't seem to have any effect.

> +++ alsa-utils	2010-12-30 17:03:59.972338203 +0100

Note that this has nothing to do with the SigmaTel modem.  In my
case it's the snd_ac97_codec driver.  But alot of the drivers (all?)
got changed.

It's changed in the following commit in the kernel:
commit d355c82a0191d5a3e971bd5af96cc81fe3ed25b9
Author: Jaroslav Kysela <[email-masked]>
Date:   Tue Nov 3 15:47:25 2009 +0100

    ALSA: rename "PC Speaker" and "PC Beep" controls to "Beep"

    To avoid confusion in control names for the standard analog PC Beep generator
    using a small Internal PC Speaker, rename all related "PC Speaker" and "PC
    Beep" controls to "Beep" only. This name is more universal and can be also
    used on more platforms without confusion.

    Introduce also "Internal Speaker" in ControlNames.txt for systems with
    full-featured build-in internal speaker.

    Signed-off-by: Jaroslav Kysela <[email-masked]>
    Signed-off-by: Takashi Iwai <[email-masked]>

---

From: Kurt Roeckx <[email-masked]>
Date: Fri, 31 Dec 2010 12:05:37 +0100

> > +++ alsa-utils	2010-12-30 17:03:59.972338203 +0100

I also forgot to mention that the default for 2.6.32 seems to be 8
(out of 15), so 50% might make more sense.

Kurt

---

From: Elimar Riesebieter <[email-masked]>
Date: Mon, 16 Mar 2015 21:41:48 +0100

> doesn't seem to be liking this much.

Hmm, we'll just before release of Jessie. It might be a good idea to
close this bug as we don't support 2.6 kernels anymore? Do you
agree?

Elimar
-- 
 You cannot propel yourself forward by
  patting yourself on the back.

---

From: Kurt Roeckx <[email-masked]>
Date: Mon, 16 Mar 2015 22:10:31 +0100

> close this bug as we don't support 2.6 kernels anymore? Do you

squeeze (with 2.6.32) is still supported.  This is an issue when
going from squeeze to wheezy (or newer).

Kurt