Re: [alsa-devel] alsactl restore fails for INTEGER64 control

Jaroslav Kysela <[email protected]> Fri, 31 Jul 2026 13:26:28 +0200
Newsgroups org.alsa-project.alsa-devel
Message-ID <[email protected]>
On 7/15/26 10:53, Sheetal . wrote:
> Hi Alsa team,
> 
> We have a mixer control with a range of 0 .. 0xffffffff and are considering exposing it as SND_CTL_ELEM_TYPE_INTEGER64.
> However, alsactl restore appears to fail when the saved value is small enough to be parsed as a config INTEGER rather than INTEGER64.
> Example state snippet:
> 
> control.N {
>     iface MIXER
>     name 'ABC control'
>     value [
>         1
>         0
>     ]
> }
> 
> The restore then fails with:
> alsactl: set_control:<line>: Cannot write control '<card>:0:0:ABC control 1:0' : Invalid argument
> 
>  From alsactl/state.c, INTEGER64 restore goes through config_integer64(), which calls snd_config_get_integer64():
> https://github.com/alsa-project/alsa-utils/blob/master/alsactl/state.c
> It does not appear that snd_config_get_integer64() accepts a plain INTEGER node for an INTEGER64 control:
> https://github.com/alsa-project/alsa-lib/blob/master/src/conf.c#L3203
> 
> If this is a known issue, what is the recommended way to handle it?
> I would appreciate any guidance or recommendations and look forward to your response.

It's clear issue in alsactl. I tried to fix this in commit [1]. I also 
introduced new function snd_config_get_llong() in alsa-lib [2], because there 
are few other callers with similar usage.

Thank you for the report.

					Jaroslav

[1] 
https://github.com/alsa-project/alsa-utils/commit/85db8a95f7f4c5bdb353033d50d5e4c14011dd11 

[2] 
https://github.com/alsa-project/alsa-lib/commit/36118b8898ad3da18def6153f6aa3392390bf0a0

-- 
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat