[alsa-devel] Get dB value using softvol plugin
    Jörg Krause 
    joerg.krause at embedded.rocks
       
    Wed May  4 11:47:03 CEST 2016
    
    
  
Hi,
I configured my softvol plugin with a min_dB value of -6.0. However, if
I store the state with alsactl store, the comment section shows a dbmin
value of 0.
I figured out that the softvol plugin adds the tlv info when it adds
the user ctl and stores the db values in snd_pcm_softvol_t. Why differ
the values of the tlv and the values of snd_pcm_softvol_t?
My goal is to get information of the current dB value used by the
softvol plugin, e.g. -6.0dB for a raw volume value of 255 and -51.0dB
for 0. However, I only get values from +0 to +51dB
using snd_ctl_convert_to_dB(). Do I miss something?
Note, that I started from a clean asound.state.
---
The state produced by alsactl:
	control.1 {
                iface MIXER
                name Master
                value.0 255
                value.1 255
                comment {
                        access 'read write user'
                        type INTEGER
                        count 2
                        range '0 - 255'
                        tlv '00000001000000080000000000000014'
                        dbmin 0
                        dbmax 5100
                        dbvalue.0 5100
                        dbvalue.1 5100
                }
        }
---
The output of aplay -D softvol -v:
    Playing WAVE '/test.wav' : Signed 16 bit Little Endian, Rate 44100
    Hz, Stereo
    Soft volume PCM
    Control: Master
    min_dB: -57
    max_dB: -6
    resolution: 256
---
My asound.conf:
    pcm.!default {
          type plug
          slave.pcm "softvol"
      }
    pcm.softvol {
         type softvol
          slave {
              pcm "hw:0"
          }
          control {
              name "Master"
              card 0
          }
         min_dB -57.0
         max_dB -6.0
    }
    ctl.!default {
            type hw
            card 0
    }
    ctl.softvol {
            type hw
            card 0
    }
---
Best regards
Jörg Krause
    
    
More information about the Alsa-devel
mailing list