[alsa-devel] Since kernel-2.6.32 alsactl thinks my sound card is "Unknown"
perex at perex.cz
Thu Sep 2 15:33:36 CEST 2010
On Thu, 2 Sep 2010, Raymond Yau wrote:
> 2010/9/2 Pacho Ramos <pacho at condmat1.ciencias.uniovi.es>
>> El jue, 02-09-2010 a las 10:29 +0200, Takashi Iwai escribió:
>>> Rejected by SPF lookup: (recv=llar.net.uniovi.es,
>>> send-ip=126.96.36.199) Could not find a valid SPF record
>>> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka)
>>> (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1 (x86_64-suse-linux-gnu)
>>> References: <1283357723.8159.4.camel at localhost.localdomain>
>>> At Wed, 01 Sep 2010 18:15:23 +0200,
>>> Pacho Ramos wrote:
>>>> This is an old problem I am suffering since kernel-2.6.32 and that is
>>>> still unresolved even with 2.6.35 and alsa-utils-1.0.23:
>>>> If you follow the thread, it got stalled in:
>>>> In summary, I get the following:
>>>> # alsactl -f /etc/asound.state restore /dev/snd/controlC0
>>>> Unknown hardware: "VIA8237" "Realtek ALC658D" "AC97a:414c4781" "0x147b"
>>>> Hardware is initialized using a guess method
>>>> # echo $?
>>> This is no error. It means that alsactl has no special workaround
>>> for your hardware. The return code of alsactl looks strange.
>>> I thought Jaroslav has already fixed it, though...
>> Well, Jaroslav fixed it to use "99" instead of "157":
>> And, about the message, could it be reworded for preventing to make
>> users think their hardware is "Unknown"? Maybe it could simply show "No
>> workaround needed for: ..." instead of "Unknown hardware"
>> Thanks :-)
I renamed string to "Found hardware:" to avoid this confusion.
> It seem to me that the current logic of alsactl try to compare the number
> of controls created by the driver and the number of controls in the state
> file before it restore the controls from the state file.
> it assume that it cannot restored the setting from the state file when the
> number of controls does not match , so it call the init routine instead of
> restore routine.
> This create a problem for those drivers which have IFACE_PCM "PCM volume
> control" since alsactl does not need to store the value of the controls in
> the state file as those per voice volume controls are always initialised
> when the stream is open for those sound cards via82xx and ymfpci
> This mean that the number of controls in state file is always less than the
> number of controls created by the driver and that is the reason why alsactl
> always init instead of restore the setting for both via82xx and ymfpci
> To solve this bug, alsactl should subtract the number of those IFACE_PCM
> "PCM volume control" when comparing the number of control in state file
But this policy is not universal. Basically, the problem is for two types
1) static, created in the driver, which can go to the inactive state
2) dynamic ones
The first type can be solved by storing of inactive values to the state
file. The restore procedure will know about all static driver controls and
can just skip ones which are marked inactive in the state file or in the
driver (it means that the controls which can be inactive will be restored
only when they are active in the state file and in the driver). Another
possibility is to mark these controls with a temporary flag to skip them
The second one (dynamic controls) are more difficult to handle. We cannot
distinguish them from static controls now.
It seems that the best method will be to restore what we can and
initialize rest without overwritting the restored controls (something like
"merge" mode - restore+init).
Jaroslav Kysela <perex at perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
More information about the Alsa-devel