What is the relationship between volume percent and dB?

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: What is the relationship between volume percent and dB?

Postby Rémi Denis-Courmont » 08 Jun 2020 16:48

It's cubic scale on amplitude. I agree that it makes no sense, but most users want their nonsensical percentage numbers just because they were always there.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: What is the relationship between volume percent and dB?

Postby Rémi Denis-Courmont » 08 Jun 2020 18:01

Decibels don't make that much more sense than percentage points due to flat or non-flat volumes and what-not mixing policies in the OS. Also having a dB value that contradicts the percentage points is sure to trigger complaints.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: What is the relationship between volume percent and dB?

Postby Rémi Denis-Courmont » 09 Jun 2020 17:19

1. True if VLC does software amplification. But typically it does not; the OS does the amplification and mixing.
2. Decibels and percentage points are both means to express a ratio, obviously. E.g. 50% should be (about) -3dB. Anything else is inconsistent.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: What is the relationship between volume percent and dB?

Postby Rémi Denis-Courmont » 16 Jun 2020 18:09

1. That's irrelevant. If the OS does the mapping, VLC cannnot provide a decibel value.
2. The definition of percentage is hundred times the ratio of a measured value by a reference value. So yes, it is a ratio by definition.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

User avatar
rom1v
Developer
Developer
Posts: 36
Joined: 02 Jul 2012 13:37

Re: What is the relationship between volume percent and dB?

Postby rom1v » 06 Jul 2020 16:05

1. If VLC provided a decibel level, then it would allow for setting consistent levels across operating systems and contexts. dB means the same thing everywhere, whether in the OS or software or hardware. Percent does not.
But like Rémi says, VLC cannot provide a decibel level, because the actual value is defined at the OS level (and not known by VLC).

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: What is the relationship between volume percent and dB?

Postby Jean-Baptiste Kempf » 06 Jul 2020 16:14

You could provide a relative dB level. (0db == 100%, and then show those in amplitudes -10dB, +10dB)
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: What is the relationship between volume percent and dB?

Postby Rémi Denis-Courmont » 03 Aug 2020 17:31

The relation between percentage points and decibel depends on the OS policy and any hardware amplification.

VLC cannot provide a value that it does not know itself.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: What is the relationship between volume percent and dB?

Postby Rémi Denis-Courmont » 24 Apr 2022 13:46

No, the relationship between percentage points and dB is a simple mathematical relationship (20*log10((position/100)^3)). It has absolutely nothing to do with the OS. It's completely internal to VLC.
What I stated is an established and verifiable artefact of the real life OS implementations, whether you like it or not. In real life, the DAC is under the control of the OS audio HAL, including the definition of the audio volume, not VLC.

VLC can measure the volume, and could apply amplification, according to your mathematical accurate formula. But that's not how OS audio HAL implement volume, at least not most of them.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

osmanvielma
New Cone
New Cone
Posts: 3
Joined: 13 Apr 2023 23:41

Re: What is the relationship between volume percent and dB?

Postby osmanvielma » 13 Apr 2023 23:54


I measured VLC's output...

Image

The decibel formula is 20*log10((position/100)^3)



Thank you for the formula and this amazing chart.

Now I know...

+8dB = 135% volume

Thank you! :D

osmanvielma
New Cone
New Cone
Posts: 3
Joined: 13 Apr 2023 23:41

Re: What is the relationship between volume percent and dB?

Postby osmanvielma » 14 Apr 2023 04:19


Thank you for the formula and this amazing chart.

+8dB = 135% volume


It worked like a charm

135% added the 8dB necessary (in my case) to achieve normalization (0dB)

Thank you.

Image

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: What is the relationship between volume percent and dB?

Postby Rémi Denis-Courmont » 14 Apr 2023 08:36

You mean that VLC's 0 to 150% (or 200%) volume control in the lower right adjusts the OS's volume and is not just a digital gain inside VLC?
Yes.
I don't believe that's correct, since it can go above 100%.
I don't really care about your beliefs. You can go and check the source code for definitive reference.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

osmanvielma
New Cone
New Cone
Posts: 3
Joined: 13 Apr 2023 23:41

Re: What is the relationship between volume percent and dB?

Postby osmanvielma » 15 Apr 2023 02:58


tooquiet:
You mean that VLC's volume control adjusts the OS's volume and not a digital gain inside VLC?

Rémi Denis-Courmont:
Yes.


tooquiet:
I don't believe that's correct, since it can go above 100%.

Rémi Denis-Courmont:
I don't really care about your beliefs.



(I believe) Both "Rémi Denis-Courmont" and "tooquiet" could be right,

In the sense that there are moments where VLC could effectively control the power gain and output of the sound signal, and there are other times where this will not be possible since there is no way it could go upper or beyond the normalization point or the saturation point provided by the sound card or operating system.

For example in my case, video with sound 8dB below zero or normalization, VLC seems to effectively control de power until 135%, but beyond that point it will simply indicate an erroneous supposed amplification, meaning it would show +11dB where in reality there will not be possible to go beyond the +8dB for this particular video.

In a normalized video (with sound well adapted to 0dB or near maximum output) the decibels conversion from percentage would just give an erroneous reading.

So, I think both are right. One from a theoretical perspective, and the other from a practical and probably more real point of view.

Hope it helps, and thank you both for your information.


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 16 guests