Does AC3 have Dynamic Range Compression?

I read on the kodi forum a post from 2015 where it said kodi has dynamic range compression as part of AC3 passthrough. Here is a link from GitHub [AudioCodecFFMPEG] - disable drc in audio codec context when by Memphiz · Pull Request #6820 · xbmc/xbmc · GitHub where they proposed to turn it off.
Is dynamic range compression still implemented?

Reading through the pull request and following along with the original thread that spawned it takes you to the information that Kodi by default isn’t making a decision about if DRC is being applied but rather ffmpeg. Additionally there exists an option through an advancedsettings.xml file to explicitly turn this option on or off…

<!-- Whether to use Dynamic Range Compression (DRC) on AC3 streams. 1.0 is "full" compression, as defined by the audio track's metadata, which is recommended for "basic" sound systems such as the internal speakers on a TV. 0.0 is no compression at all, which is recommended for people with nice multi-speaker sound systems. -1.0 (default) defaults to whatever ffmpeg uses, which is currently the same as 1.0. This has no effect if passthrough is enabled for AC3. -->
<applydrc>-1.0</applydrc>

Also if you have an AC3 soundtrack that is being passed through AFAIK it doesn’t get touched. From what I understand this would only apply in cases where Kodi was needing to decode an AC3 file.

Thanx for the reply. Is there a way osmc could modify the system advancedsettings.xml if this is still implemented, because I would like to move this to feature requests. I believe this is unacceptable, as it should be able to be changed in settings.

I don’t personally see how there exists a possibility where OSMC would implement a change here. The current situation is where we are not changing Kodi default behavior which is the preferred way to operate in most cases. Additionally I think if you were to balance the pros and cons across the entire user base to such a change I think it would weigh heavily against making this modification. I believe that currently the overwhelming majority of users are in two camps such that they are using their TV speakers and no passthrough, or else an AVR or soundbar and passthrough. The former likely is benefiting from DRC as it makes quiet dialog easier to hear, and the latter would be using passthrough in most cases so that setting would not apply.

I understand that having to know the option exists and manually make a file is a lot more to ask than just having a GUI setting. On the other hand the Kodi devs have to have some line where you don’t want to clutter the UI with niche options. I think perhaps the best thing may be to just add the topic to @Chillbo’s audio guide to increase visibility for people who are looking at tweaking their audio setup.

Ok, thanx for the detailed response, I’ll add a comment in that thread.

1 Like

Maybe we should expose a GUI option – but I’d be reluctant to change the default behaviour. I believe you’re the only one that’s picked up on this.

Sam

Yes Sam please add that GUI option. I believe this hasn’t been brought up because people don’t know about it. I didn’t know about it till I read it on the kodi forum and it is a 6 year old thread.

I couldn’t find on google an answer to what to type in the advancedsettings.xml so for anyone who is interested

If required, a custom USER advancedsettings.xml file can be created/edited in the following location:

/home/osmc/.kodi/userdata/advancedsettings.xml

You can rename a windows text file and rename the file extension to .xml

Edit the text file and type this:

<advancedsettings>
<audio>
<applydrc>-0.0</applydrc>
</audio>
</advancedsettings>

This worked for me

I had marked the thread solved but I took it off in case anyone wants to comment about whether a GUI option should be implemented (default off)

It is literally in the first response to your thread. Both specifically the tag for this option, as well as a link to Kodi’s wiki about advancedsettings.xml.

I was able to figure it out thanx to your link but at first I didn’t realise I had to add <audio> </audio>
(I should have said an explicit answer)
The link also backs up your belief that it doesn’t affect passthrough

“This has no effect if passthrough is enabled for AC3”

Straight passthrough I know it wouldn’t be touched since ffmpeg isn’t touching it. If you have AC3 transcoding enabled or are passing through AC3 only and are playing EAC3 then things may get more complicated. Without having a reference where someone who knows spelled out the behavior in detail or having spent a bunch of time testing it myself then I would much rather slap a qualifier on it so it wouldn’t be easily confused with blanket definitive statement.

This topic is likely much more nuanced than what you may think. If you expose that option in the GUI then you need to explain it. Since it is going to do ‘something’ or ‘nothing’ depending on how you connected to your other equipment, what some other settings are, and also the exact type of soundtrack your playing. This would be hard to fully explain in a paragraph let along a single sentence which is all you really have room for in the settings pane description area. So once you add this option you take something that almost never has come up as an issue into an issue for anyone playing with their settings without full understanding and then wonder why only some of their movies being played their TV speakers no longer is as easy to understand or the music is too loud.

I’m sure that the Kodi devs spent time giving careful deliberation to where the setting should be and what should be enabled as default settings. I think if OSMC were to decide to go a different direction then there would need to be a specific compelling reason to do so. If there was a specific compelling reason to do so then why should that case not be brought to the Kodi devs themselves because surely if DRC is bad as a default setting for decoded AC3 in OSMC then it would be equally bad on every other platform that runs Kodi as well would it not?

I would also point out that in that github you linked to it was stated that AC3 was intended to default to having compression applied to it. Indeed every TV that I recall that could decode AC3 compresses the audio as a default setting and often have an extra night mode setting where it would compress it even more. Thus if you have a Kodi box that is decoding the audio and sending it to a TV as LPCM then the TV is going to get similar output as if it got the AC3 and was processing it on its own. Kodi is currently doing what is normal and expected behavior from the way I see it. I think the lack of people bring this up as a topic is a testament to the status quo being correct.

1 Like

I’ll think leave it to the professionals. Thanx again