From: "Jörg Krause" <joerg.krause@embedded.rocks>
To: alsa-devel@alsa-project.org
Subject: Get dB value using softvol plugin
Date: Wed, 04 May 2016 11:47:03 +0200 [thread overview]
Message-ID: <1462355223.13036.16.camel@embedded.rocks> (raw)
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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
reply other threads:[~2016-05-04 9:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1462355223.13036.16.camel@embedded.rocks \
--to=joerg.krause@embedded.rocks \
--cc=alsa-devel@alsa-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).