4a-alsacore (used by HAL Generic) creates dbscale mixer controls, also if not specified

Description

There is a  dffference between controls setup in HAL and Softmixer.
HAL Controls are adding dbscale, which should not be the case if not specified.

Example specified:

 "halmap": [
{
"uid": "agl-master-playback-volume",
"info": "Sets master playback volume",
"alsa": {
"name": "Master Playback Volume",
"value": 95,
"create":
{
"type": "INTEGER",
"count": 1,
"minval": 0,
"maxval": 100,
"step": 1
}
},
"action": "plugin://hal-unicens#MasterVol"
},

 

*****

Checking values for UNICENS HAL
~> amixer -Dhw:ep016ch cget numid=1
numid=1,iface=MIXER,name='Master Playback Volume'
; type=INTEGER,access=rw---RW-,values=1,min=0,max=100,step=1
: values=4
| dBlinear-min=-100.00dB,max=0.00dB

The Value can be set by cset but alsamixer is not matching correctly.
~> amixer -Dhw:ep016ch cset numid=1 40
numid=1,iface=MIXER,name='Master Playback Volume'
; type=INTEGER,access=rw---RW-,values=1,min=0,max=100,step=1
: values=40
 dBlinear-min=-100.00dB,max=0.00dB

****

In Comparison, the softmixer controls are added correctly. No dbscale.
~> amixer -Dhw:2 cget numid=1
numid=1,iface=PCM,name='PCM Rate Shift 100000'
; type=INTEGER,access=rw------,values=1,min=80000,max=120000,step=1
: values=100000

Environment

None

Activity

Sebastien Douheret 
July 31, 2019 at 8:50 AM

4A is no longer use and has been replaced by Pipewire.

Jonathan Aillet 
January 14, 2019 at 2:01 PM
(edited)

After more investigations, when creating a integer controls, ALSA is not happy when a dbScale/dbLinear/... is not specified.

By the way, volume controls created by softmixer also have a 'dbScale':
amixer -D hw:3 cget numid=113
numid=113,iface=MIXER,name='vol-multimedia'
; type=INTEGER,access=rw---RW-,values=2,min=0,max=100,step=0
: values=104,104
dBscale-min=-51.00dB,step=0.51dB,mute=0

So, dbScale won't be remove from controls created by '4a-alsacore' to avoid ALSA issue. However, some tweaking will be done to '4a-alsacore' created controls to have a smooth control value setting when using dbScale.

Tobias Jahnke 
November 30, 2018 at 7:46 AM

I agree, after CES should be fine.

Jonathan Aillet 
November 28, 2018 at 6:50 PM

Ok, I now understand that your hw:2 is the snd-aloop sound card. Your logs comes from a computer and not from a board running AGL.

After a discussion with Fulup, it seems that when a controls is created by softmixer, the dBLinear is also created along with 'INTEGER' type control (ALSA is not very happy about it if you don't provide a dBscale at controls creation for 'INTEGER' type). But, unlike when controls are created using 4a-alsacore, dbScale is set in a certain way that it is not visible when you use 'amixer ... cget ...' command, and in a way that it doesn't interfere with control set (using 'alsamixer' comand for example).

I will have a debug session to understand how everything works to provide a solution as soon as possible. But everything related to CES demo is more important, so I am not sure when the correction will come.

Tobias Jahnke 
November 28, 2018 at 7:41 AM

I mean the mixer controls added to the Loopback soundcard. Dulup and I recognized that those seem to be ok.

Only the controls added by the HAL seem to have dbscale.

Won't Fix

Details

Assignee

Reporter

Labels

Contract ID

Components

Priority

Created November 27, 2018 at 1:08 PM
Updated August 1, 2019 at 3:03 PM
Resolved July 31, 2019 at 8:50 AM