How to disable Dolby Digital AC3 dynamic range compression
#1
As with virtually all hardware and software AC3 (Dolby Digital) decoders, the dynamic range compression is enabled by default. I can't find an option in Kodi to disable it. So, how do I disable it (and for all other formats)?
Reply
#2
I think you can still do this from advancedsettings.xml. At least I have this in mine. The wiki is down right now so I can't check if this tag is still being used.

Code:
<advancedsettings>
<audio>
<!-- Whether to use DRC on AC3 and DTS streams -->
<applydrc>false</applydrc>
</audio>
</advancedsettings>

Make a file called advancedsettings.xml containing the above and put it in Kodi's userdata folder for your OS. For windows this is located at %appdata%\Kodi\userdata\ and for Linux it is located at ~/.kodi/userdata/.

Good luck.
HP Stream Mini w/Libreelec -> HDMI -> Toshiba 37"
Intel NUC8i3BEH w/Libreelec -> HDMI -> LG OLED55C3PUA -> S/PDIF -> Sony HT-CT80
Dell Optiplex 7050 Micro w/Libreelec -> HDMI -> Yamaha RX-V467 -> HDMI -> Toshiba 47L7200U
Reply
#3
Sorry for the late response...

I tried your suggestion, it didn't work. According to 'stat', the advancedsettings.xsml isn't even read.

The wiki is online now, and I can't find anything about advancedsettings.xml or applydrc not working...
Reply
#4
disable "boost volume on downmix"

edit: or use passthrough mode.
Reply
#5
Ah far as I know we don't do any DRC.

Do you have any evidence that we DRC? you are you just making an assumption that we do?
Reply
#6
I think we do for downmixing to stereo. Hence the "boost volume on downmix" setting.
Reply
#7
Sorry for the late reply; didn't get a notification.

There is clear evidence that DRC is applied. It's a longstanding beef I have with all Dolby Digital decoders, both software and hardware; they all have DRC on by default. On any new hardware or software I use, I take my Terminator 2 DVD and play the intro theme. The part where the metal plates slam together is 100% clear in demonstrating it. If it sounds like the DTS track: DRC off. If it sounds like a hammer on a cardboard box: DRC on.

Incidentally, I think that's why people think DTS is better than Dolby Digital, because decoders don't default to DRC with DTS.

I don't think the 'boost volume on downmix' is going to do anything, because I don't downmix. But, I'll try.
Reply
#8
No people think that DTS is better then AC3 because it is the case. We don't do DRC on AC3 decode as long as you don't have volume amplification turned up. I assure you because we don't even have a proper DRC algorithm implemented yet.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#9
Did you know that AC3 has DRC metadata in the coding scheme? Look at chapter 3.5 in this PDF. Or this one about metadata.

Quote:Metadata provides a number of key parameters that are specifically intended to change the sound of the program delivered to the consumer’s unique listening environment. These metadata parameters are known as dialogue level (aka dialogue normalization or dialnorm), dynamic range control, and downmixing.

If you use a lib (ffmpeg?), it's doing it for you.

I'll make screenshots of waveforms, but that is going to take me a lot of time. If you can obtain Terminator 2 with both the DTS and AC3 stream in it, you can hear for yourself.
Reply
#10
Then we would need to have a way to disable it in ffmpeg - but if ffmpeg does it - isn't this they way like it is intended to be? (if ac3 has this metadata why would you wanna ignore it?)
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#11
The meta data allows for precise DRC control, to an extent the user wants. I want the loud sounds of the film as loud as the sound engineer intended, so the DRC can be off.

Mpv (fork of mplayer2) uses libavcodec, and they have this bit of code in audio/decode/ad_lavc.c:

Code:
#define OPT_BASE_STRUCT struct ad_lavc_params
struct ad_lavc_params {
    float ac3drc;
    int downmix;
    int threads;
    char **avopts;
};

const struct m_sub_options ad_lavc_conf = {
    .opts = (const m_option_t[]) {
        OPT_FLOATRANGE("ac3drc", ac3drc, 0, 0, 2),
        OPT_FLAG("downmix", downmix, 0),
        OPT_INTRANGE("threads", threads, 0, 1, 16),
        OPT_KEYVALUELIST("o", avopts, 0),
        {0}
    },
    .size = sizeof(struct ad_lavc_params),
    .defaults = &(const struct ad_lavc_params){
        .ac3drc = 1.,
        .downmix = 1,
        .threads = 1,
    },
};

// snip snip

// Always try to set - option only exists for AC3 at the moment
av_opt_set_double(lavc_context, "drc_scale", opts->ac3drc, AV_OPT_SEARCH_CHILDREN);

av_opt_set_double() probably came from libavcodec/avcodec.h, but I don't have that on my system currently.

Their man page says:

Quote:``--ad-lavc-ac3drc=<level>``
Select the Dynamic Range Compression level for AC-3 audio streams.
``<level>`` is a float value ranging from 0 to 1, where 0 means no
compression and 1 (which is the default) means full compression (make loud
passages more silent and vice versa). Values up to 2 are also accepted, but
are purely experimental. This option only shows an effect if the AC-3 stream
contains the required range compression information.
Reply
#12
This doesn't apply to ffmpeg but i have something to try for you. As you didn't state which OS you are running - here the upper commit:

https://github.com/Memphiz/xbmc/commits/ac3drc

Try to compile this and disable DRC in advancedsettings as mentioned some posts above. Not sure if this will work.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#13
I'll have a look as soon as I can. I'm at work now.

I use Mint Linux, version 17, with Kodi from the ppa.

I don't quite get the deal with libavcodec BTW:

wikipedia Wrote:libavcodec is a free and open-source[5] library of codecs for encoding and decoding video and audio data.[6] Because of a project fork, libraries with this name are provided by FFmpeg[7] and Libav,[8] but they are incompatible.[citation needed]

So Kodi actually uses ffmpeg?
Reply
#14
Kodi uses ffmpeg libraries so it's their version of libavcodec we have.

From ffmpeg documentation https://www.ffmpeg.org/ffmpeg-codecs.htm...er-Options

drc_scale == 0
DRC disabled. Produces full range audio.

It appears that might be what Memphiz is setting here https://github.com/Memphiz/xbmc/commit/0...238fda76aa
Reply
#15
yes - but i am not sure if i really set this in the right way/spot tbh Wink - well for this change halfgaar needs to compile it from source ...
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply

Logout Mark Read Team Forum Stats Members Help
How to disable Dolby Digital AC3 dynamic range compression0