[pulseaudio-discuss] Please help to explain the algorithm in pa_sw_volume_to_dB

zhaochengyi at uniontech.com zhaochengyi at uniontech.com
Mon Aug 8 13:29:45 UTC 2022


Hi guys,

The dB range of Playback Master of Sound Card is between -65.25 and 0.

I changed the sink volume to 8%, but the dB volume calculated by 
function pa_sw_volume_to_dB is -65.82 dB, this will result in
no sound playing when the volume is between %0 and 8%.

I think this is an issue, but I don't understand the algorithm
principle of function pa_sw_volume_to_dB.

Would you please help to explain it, thanks a lot!

logs:
------------------------------------
8月 08 21:06:32.535263 zhao-PC pulseaudio[5173]: D: [pulseaudio] 
protocol-native.c: Client dde-session-daemon changes volume of sink 
alsa_output.pci-0000_03_00.6.analog-stereo.
8月 08 21:06:32.535263 zhao-PC pulseaudio[5173]: D: [pulseaudio] sink.c: 
The reference volume of sink alsa_output.pci-0000_03_00.6.analog-stereo 
changed from front-left: 4587 /   7% / -69.30 dB,   front-right: 4587 / 
  7% / -69.30 dB to front-left: 5898 /   9% / -62.75 dB,   front-right: 
5898 /   9% / -62.75 dB.
8月 08 21:06:32.535263 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] alsa-sink.c: Requested volume: front-left: 5898 /   9% / -62.75 
dB,   front-right: 5898 /   9% / -62.75 dB
8月 08 21:06:32.535263 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] alsa-sink.c: Got hardware volume: front-left: 5919 /   9% / 
-62.65 dB,   front-right: 5919 /   9% / -62.65 dB
8月 08 21:06:32.536525 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] alsa-sink.c: Calculated software volume: front-left: 65303 / 
100% / -0.09 dB,   front-right: 65303 / 100% / -0.09 dB 
(accurate-enough=yes)
8月 08 21:06:32.536525 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] sink.c: Volume going up to 5898 at 6577292163
8月 08 21:06:32.536525 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] ratelimit.c: 745 events suppressed
8月 08 21:06:32.536525 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] sink.c: Next volume change in 7992 usec
8月 08 21:06:32.536525 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] sink.c: Next volume change in 7981 usec
8月 08 21:06:32.536525 zhao-PC pulseaudio[5173]: I: [pulseaudio] 
module-device-restore.c: Storing volume/mute for device+port 
sink:alsa_output.pci-0000_03_00.6.analog-stereo:analog-output-speaker.
8月 08 21:06:32.543465 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] sink.c: Volume change to 5898 at 6577292163 was written 104 usec 
late
8月 08 21:06:40.507006 zhao-PC pulseaudio[5173]: D: [pulseaudio] 
protocol-native.c: Client dde-session-daemon changes volume of sink 
alsa_output.pci-0000_03_00.6.analog-stereo.
8月 08 21:06:40.507006 zhao-PC pulseaudio[5173]: D: [pulseaudio] sink.c: 
The reference volume of sink alsa_output.pci-0000_03_00.6.analog-stereo 
changed from front-left: 5898 /   9% / -62.75 dB,   front-right: 5898 / 
  9% / -62.75 dB to front-left: 4587 /   7% / -69.30 dB,   front-right: 
4587 /   7% / -69.30 dB.
8月 08 21:06:40.507593 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] alsa-sink.c: Requested volume: front-left: 4587 /   7% / -69.30 
dB,   front-right: 4587 /   7% / -69.30 dB
8月 08 21:06:40.507593 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] alsa-sink.c: Got hardware volume: front-left: 4605 /   7% / 
-69.20 dB,   front-right: 4605 /   7% / -69.20 dB
8月 08 21:06:40.507593 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] alsa-sink.c: Calculated software volume: front-left: 65280 / 
100% / -0.10 dB,   front-right: 65280 / 100% / -0.10 dB 
(accurate-enough=yes)
8月 08 21:06:40.507593 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] sink.c: Volume going down to 4587 at 6585248016
8月 08 21:06:40.507593 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] sink.c: Volume change to 4587 at 6585248016 was written 8010 
usec late
8月 08 21:06:40.507593 zhao-PC pulseaudio[5173]: I: [pulseaudio] 
module-device-restore.c: Storing volume/mute for device+port 
sink:alsa_output.pci-0000_03_00.6.analog-stereo:analog-output-speaker.
8月 08 21:06:42.535546 zhao-PC pulseaudio[5173]: I: [pulseaudio] 
module-device-restore.c: Synced.
8月 08 21:06:48.928087 zhao-PC pulseaudio[5173]: D: [pulseaudio] 
protocol-native.c: Client dde-session-daemon changes volume of sink 
alsa_output.pci-0000_03_00.6.analog-stereo.
8月 08 21:06:48.928087 zhao-PC pulseaudio[5173]: D: [pulseaudio] sink.c: 
The reference volume of sink alsa_output.pci-0000_03_00.6.analog-stereo 
changed from front-left: 4587 /   7% / -69.30 dB,   front-right: 4587 / 
  7% / -69.30 dB to front-left: 5242 /   8% / -65.82 dB,   front-right: 
5242 /   8% / -65.82 dB.
8月 08 21:06:48.928812 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] alsa-sink.c: Requested volume: front-left: 5242 /   8% / -65.82 
dB,   front-right: 5242 /   8% / -65.82 dB
8月 08 21:06:48.928812 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] alsa-sink.c: Got hardware volume: front-left: 5276 /   8% / 
-65.65 dB,   front-right: 5276 /   8% / -65.65 dB
8月 08 21:06:48.928812 zhao-PC pulseaudio[5173]: D: [alsa-sink-ALC256 
Analog] alsa-sink.c: Calculated software volume: front-left: 65114 / 
99% / -0.17 dB,   front-right: 65114 /  99% / -0.17 dB (accurate-enough=yes)
--------------------------------------------


Best Regards,
Chengyi


More information about the pulseaudio-discuss mailing list