INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Clip Protection inconsistent with volume adjustment...  (Read 2840 times)

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Clip Protection inconsistent with volume adjustment...
« on: September 23, 2018, 08:10:25 pm »

So I'm seeing some strange behavior/results  when volume leveling and clip protection are engaged...

Some movies have true peaks above 0db; Iron Man 2 is an example, which has a true peak of +3.3.  So I have my JRiver volume set to 90% (-5db) to provide headroom for volume leveling.  (I'm trying to avoid reducing further, because if I do JRiver will be noticeably different from my other components.)  MC applies -6.6 for volume leveling on Iron Man 2, but I do have some equalizer effects in the audio path.

Now the problem comes when the peaks come in the movie:  I will see audio path indicate a volume reduction of -0.4db for Clip Protection.  Fair enough (those equalizers).  So I reduce the MC volume by another -1db.  Surely that will solve the problem?  So why when I replay the exact same scene with the volume down that additional 1db, do I see clip protection engage AGAIN with -0.1db?

If it says it needs -0.4, and I give it -1.0, why does it still need another -0.1?

If I reduce volume another -0.5db, Clip Protection engages with "-0.0db".  Not really sure what that means.  Clipping, but no adjustment?

I have to reduce the volume by -2db in order to avoid -0.4db clip protection.... (to make the clip protection message not appear)

Can anyone explain what's going on with these numbers, or am I just doing something stupid?

It would also be great if someone could point out a way to better monitor how much clip protection adjustment is necessary.  Leaving fullscreen display mode, to click on audio path and scroll to the bottom just to see what's happening, and then going back to display view to wait for the next loud sceneis a real drag to do over and over again trying to evaluate a movie.

I'm trying to make my volume adjustment as small as possible, and with audio analysis not giving a timecode for the peak, and info on clip protection being so inaccessible when watching a movie, it's a lot harder than it needs to be.

FYI, I have also used ffprobe to report on volume information for the entire movie; it will output timecode for each audio sample.  However the timecodes with max db value reported that way are not accurate for when the true peak actually occurs; they're not the timecodes when JRiver imposes clip protection.

Thanks for any wisdom that can be offered!
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: Clip Protection inconsistent with volume adjustment...
« Reply #1 on: September 25, 2018, 09:53:16 pm »

You should be able to use the results from Analyze Audio to see exactly what peak the movie has.

Look at Peak Level (Sample).

Then you might have DSP that monkey's with the level further, but try turning all of those off as a test.

The results should be perfectly predictable then.
Logged
Matt Ashland, JRiver Media Center

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Clip Protection inconsistent with volume adjustment...
« Reply #2 on: September 25, 2018, 10:12:33 pm »

Why peak level(sample) instead of peak level (r128)?  What's the difference in this context?
Sample says -0.5db, r128 says +3.3dbTP.

My understanding is it's the positive TP value that means a volume reduction is needed for headroom.

But my question was about the discrepancy between what audio path says it needs, and the volume adjustment actually required to avoide clip protection engaging.  One is much greater than the other, when it seems they should be the same.
Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Clip Protection inconsistent with volume adjustment...
« Reply #3 on: September 26, 2018, 06:15:58 am »

If you're making adjustments based off True Peak, you need an additional 1 dB of headroom. So if the peak is 3.3 dBTP, you need -4.3 dBTP to ensure that there will be no inter-sample clipping.
If you're applying EQ, you should make negative adjustments rather than positive. Instead of +3dB somewhere, it should be -3dB everywhere else - though I'm surprised that it would be an issue, since most EQs will normalize automatically these days.
 
I'm trying to avoid reducing further, because if I do JRiver will be noticeably different from my other components.
Well that's kind-of the point of Volume Leveling.
Without a sufficient volume reduction, it's not possible to have tracks with a wide dynamic range play back at the same loudness as tracks with a compressed dynamic range.
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Clip Protection inconsistent with volume adjustment...
« Reply #4 on: September 26, 2018, 02:03:24 pm »

Hi RD James... I know the point of volume leveling, and I'm trying to make the necessary amount of volume correction, just not MORE than necessary.  I think that's reasonable.

In my initial calculations I did exactly what you said.  True Peak was +3.3db, so I reduced volume by -5db.  That's 1.7 greater.

But in the end result I'm not really going off the peak values, I'm going by what Clip Protection reports in audio path.

Clip protection is at the very end of the audio chain, after volume leveling, EQ, and everything else have been taken into account.  So it's not important what each of the individual contributors are (+2 here, -1 there) what matters is the sum, which is what clip protection reports.

So to reiterate, Clip Protection reports "Reducing Volume by -0.4db".  That is the net out of all adjustments in the audio chain: the peak is still 0.4db above maximum.

So my question is, that being the case as reported in Audio Path, why do I need an ADDITIONAL -2db reduction in volume to keep clip protection from engaging?  One would expect the needed adjustment to be -0.4 or -0.5db, not 4x that amount at -2.0.

Thanks for any insight you can provide...
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Clip Protection inconsistent with volume adjustment...
« Reply #5 on: October 01, 2018, 08:40:17 pm »

A gentle bump on this. Someone must know the answer...
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient
Re: Clip Protection inconsistent with volume adjustment...
« Reply #6 on: October 02, 2018, 02:26:25 pm »

A gentle bump on this. Someone must know the answer...

You haven't explained your "equalizers" or other DSP in the processing chain, and that's almost certainly what's causing the discrepancy you're seeing.  The peak and the expected volume reduction will only match if there's not boost being added by an equalizer or other DSP.  When you're dealing with equalizers or DSP that target only part of the band its not just simple math like it is with whole-band volume adjustments (you can't just assume that a +2dB equalizer boost in part of the band will only ever add 2dB to the overall volume level).  For example, some DSPs that conceptually only cut volume can cause incidental volume increases in nearby frequencies because the DSP attenuates frequencies that would otherwise be destructively interfering with other nearby frequencies, and vice versa.  So it very much does matter what the individual contributors are if your DSP or Equalizers are operating on a subset of frequencies instead of the entire passband.

Matt suggested you test with no additional DSP enabled to see if you got more predictable results, and you haven't commented on your results when trying that.  That's the only way to get a sensible answer here; do you still see a discrepancy with nothing but volume leveling enabled?
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Clip Protection inconsistent with volume adjustment...
« Reply #7 on: October 03, 2018, 12:30:50 am »

Hi mwillems.  I understand what you're saying, but that's not what my question is about.  My question is not about why does clip protection engage in the first place; I know why.  It's about the number clip protection reports.  Of course I can eliminate the need for clip protection by removing all equalizers and effects from the chain, but that's not important.

All then things you are referring to are earlier in the audio path.  Volume leveling, then volume control, then equalizer, then effects, then room correction, and then at the very end, CLIP PROTECTION.

Clip Protection is the sum of all other modifications to the path, and it is ONLY the discrepancy between the reported clip protection adjustment, and the ADDITIONAL volume adjustment required to remove it, that I am concerned about.

I know perfectly well Clip Protection is engaging because equalizer, effects, and room correction are altering the peak volume (at at least some frequencies) after the volume control and volume leveling has been applied.  That's working as designed.  But the number reported by Clip Protection should be rational; it's supposed to represent the volume adjustment made to prevent clipping.  But it does not match up.

Let me put it another way:
Volume leveling -5, volume -5, equalizer config XYZ, might equal: Clip protection -0.4db
Also, Volume leveling -14.2, volume -0, equalizer ABC, effects DEF, might equal: Clip Protection -0.4db

In both of those cases, all the specifics about the earlier parts of the audio path are irrelevant for my question.  The only thing that matters is the RESULT, -0.4db.  Comparing that one number, -0.4db, to a needed volume control adjustment, is simple math, because the clip protection at the end IS a whole band volume adjustment.

Here is the fact:  If Clip Protection reports -0.4db, then reducing the volume control by an additional -0.5db DOES NOT PREVENT CLIP PROTECTION FROM ENGAGING.  You still get something like Clip Protection -0.2db.  You don't see the clip protection message not appear until you've reduced the volume by way more than -0.4db; more like -1.6db is needed.

My question is why, when Clip Protection reports -0.4db, why do I need to add an additional Volume -1.6db to prevent clip protection from engaging?

Scenario:
0. Have your standard effects and room correction activated
1. Play video clip
2. Clip Protection engages, reports volume reduction -0.4
3. Stop playback
4. Reduce MC volume control by an additional -0.5
5. Play clip again
6. Clip Protection still engages, reports volume reduction -0.3!!!
7. Iterate steps 4-6; Clip protection will report reducing but non-zero adjustments
8. Clip protection finally stops engaging when you reach volume control -1.5 or -2db

That's my question.  Why do I need additional Volume -1.6 instead of additional Volume -0.4?  Four times as much as reported. That's the discrepancy.

I hope I'm explaining myself clearly.  Thanks for your help.   :)
Logged

Spike1000

  • Citizen of the Universe
  • *****
  • Posts: 641
Re: Clip Protection inconsistent with volume adjustment...
« Reply #8 on: October 03, 2018, 02:43:59 am »

Matt suggested you test with no additional DSP enabled to see if you got more predictable results, and you haven't commented on your results when trying that.  That's the only way to get a sensible answer here; do you still see a discrepancy with nothing but volume leveling enabled?

I think the key words here are "more predictable results". You should try this and report back.

Why do I need additional Volume -1.6 instead of additional Volume -0.4?  Four times as much as reported. That's the discrepancy.

You do appreciate that the dB scale is logarithmic? In terms of power, 4 times would be 6dB.

Spike

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10935
Re: Clip Protection inconsistent with volume adjustment...
« Reply #9 on: October 03, 2018, 02:53:48 am »

Volume leveling can theoretically use any additional headroom from a lowered internal volume to ensure a more even leveling. You could easily spot if thats going on if the volume leveling value in the audio path changes.
Logged
~ nevcairiel
~ Author of LAV Filters

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re: Clip Protection inconsistent with volume adjustment...
« Reply #10 on: October 03, 2018, 04:25:38 am »

You do appreciate that the dB scale is logarithmic? In terms of power, 4 times would be 6dB.
the comparison is of 2 values expressed in dB terms

to the OP, I think clip protection operates on a sliding window and changes to the internal volume do not propagate immediately to that analysis. I don't know the length of that window but it seems quite long to me (10s or so).

Simple case to reproduce

* generate some pink noise at say -10dB rms
* play it in jriver at full volume
* there will be no clip protection

* stop playback
* add a gain stage in DSP studio to add some big number (+20dB)
* start playback
* clip protection will report some adjustment
* reduce internal volume by 10dB
* watch audio path for the next 10s
* the amount of clip protection applied will gradually reduce

I don't know if there would be side effects but I would have thought MC could react more quickly to this by distinguishing between level changes caused by the content vs level changes caused by internal volume changes (i.e. when volume changes then shift the level seen by the analysis by the same amount)

I don't know if this is the source of your problem but it seems a plausible explanation.
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Clip Protection inconsistent with volume adjustment...
« Reply #11 on: October 03, 2018, 07:18:58 pm »

Hendrik, your observation is correct of course, but this comes into play only when the clip needs a positive volume leveling adjustment.  All the clips in question have negative adjustments.  I have checked, and the first thing audio path reports is the volume leveling adjustment, and it is always exactly the amount in the [Volume Level (R128)] field, regardless of what amount I have internal volume set to.  I normally have internal volume set at -5.0db to allow headroom for those few files that require positive volume leveling adjustment.  So for example Iron Man always plays with a -5.1 volume leveling adjustment.

mattkhan, I avoid that complication because I always stop playback before adjusting the MC volume; not because it is required, but precisely because I do want to reset the info displayed in Audio Path.  Since each sample in my experiment is fresh data from a new playback with a pre-set volume level, any propagation delay for clip protection due to live volume control adjustments is not germane. So that is not the source of this discrepancy.

Hendrik, I assume you agree that if clip protection reports that it is making a -0.3db adjustment, then reducing MC volume by another -0.5db (before playback) should obviate the need for clip protection to engage?  If so then it seems that either the db numbers assigned to the volume control are inaccurate, or the number reported by clip protection is inaccurate.

It's like buying something in a store, being told your total comes to $8, handing them a $10 bill, and then being told, thanks, but you still owe $4 more.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10935
Re: Clip Protection inconsistent with volume adjustment...
« Reply #12 on: October 04, 2018, 06:18:08 am »

Clip Protection is not quite as simple as just applying an offset. It adjusts volume gradually to avoid huge volume jumps from single short spikes (and flat-lines the remaining overflow). As such its certainly possible that audio with (rare) short sudden bursts would result in this particular behavior. They probably exceed the max volume by around ~2dB, but because they are so short, they don't get the Clip Protection to fully engage to 2dB.
Logged
~ nevcairiel
~ Author of LAV Filters

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Clip Protection inconsistent with volume adjustment...
« Reply #13 on: October 05, 2018, 07:59:02 pm »

Ah, ok.  That would explain it then...

Audio path is reporting the amount clip protection actually adjusted the volume, but because of clip protection's slow attack, that might be less than the actual amount by which max volume was exceeded in the transient.  Have I got that right?

That would mean to effectuate a volume adjustment as great as necessary but not more so, there would have to be some trial and error, which is exactly what I've been seeing.

But in the scenario you described, that would mean that clip protection actually still could/would allow some short-duration clipping on transients, correct?   It's hard to tell by listening for distortion, since these are mostly explosions and such anyway.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: Clip Protection inconsistent with volume adjustment...
« Reply #14 on: October 05, 2018, 08:09:49 pm »

Audio path is reporting the amount clip protection actually adjusted the volume, but because of clip protection's slow attack, that might be less than the actual amount by which max volume was exceeded in the transient.  Have I got that right?

Exactly right.
Logged
Matt Ashland, JRiver Media Center

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Clip Protection inconsistent with volume adjustment...
« Reply #15 on: October 06, 2018, 12:42:53 am »

Thanks guys. 

So that means clip protection is actually letting a little clipping occur on transients then, right?
Logged
Pages: [1]   Go Up