Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 5 years ago

Closed 4 years ago

Last modified 3 years ago

#6569 closed patch (Fixed)

ac3 level is low for 5.1 source

Reported by: markspieth Owned by: janneg
Priority: minor Milestone: unknown
Component: MythTV - Video Playback Version: unknown
Severity: medium Keywords:
Cc: Ticket locked: no

Description

the ac3 gain is low for 5.1 sourced audio streams but is ok for 2.0.
we have channels which have 5.1 material with 2.0 ads between. audio level changes are annoying.

patch attached to fix this.

Attachments (2)

mythtv_ac3gainfix.patch (812 bytes) - added by markspieth 5 years ago.
mythtv_ac3gainfix.patch.v2 (845 bytes) - added by Bill Meek <keemllib@…> 3 years ago.
Works with trunk at 27015

Download all attachments as: .zip

Change History (13)

Changed 5 years ago by markspieth

comment:1 Changed 5 years ago by danielk

Mark, have you tried submitting this to the ffmpeg folks?

comment:2 Changed 5 years ago by anonymous

A hardcoded gain increase can result in clipping and is not an appropriate way to address the "loud commercials" problem. This problem varies across different broadcasters/affiliates and really must be fixed at the source. This patch would cause problems on channels that do set proper levels, as well as on other ac3-bearing content, such as DVDs.
Additional reading: http://www.tvtechnology.com/article/12644

comment:3 Changed 5 years ago by anonymous

To attribute this problem to the broadcaster would be erroneous, AC3 5.1 volumes with ffmpeg have always been lower than other codecs, e.g. mp2 or mp3 even with the same programmes (BBC HD offers stereo mp2 alongside 5.1 AC3). This causes problems when switching between channels using differing audio formats and not just on audio stream changes on a single channel.

comment:4 Changed 5 years ago by markspieth

finally had time to look into this again.
the problem I had experienced was my stupid error.
I'd made some different mods to my main frontend which didnt reflect the algo correctly.

The patch does work correctly for both 6ch output and 2ch downmixed output for both 2.0 and 5.1 ac3 source material.

I suspect there is a gain problem that is scaled for the number of channels in the source. thus 1/3 (-10dB) for 6ch over 2ch. (2ch being louder). This is not a downmix issue either.

The spec does not mention this though. The gain values in the table should probably be 3 and not 3.16 for this reason.

If anyone has mixed 4ch/2ch or 4ch/6ch audio material it would be interesting to test this theory. I only have access to mixed 2ch/6ch material.

comment:5 Changed 5 years ago by markspieth

submitted patch to ffmpeg issue 1153

comment:6 Changed 5 years ago by stuartm

  • Owner changed from ijr to janneg
  • Status changed from new to assigned

comment:7 Changed 5 years ago by markspieth

this is an issue with dolby technical bulletin 11.

what I have done is essentially correct but off by 1 dB. they recommend 11 dB attenuation an all non ACE/EAC3

from a bit of web searching

For receivers
featuring E-AC3, this should be consistent with Dolby Technical Bulletin 11: Requirement Updates for AC3
and E-AC3 in DVB Products [34]. Receivers featuring AC3 or E-AC3 decoding shall include the PCM Level
Control feature described therein. For example, for MPEG-1 Layer 2 audio streams that have an average
loudness of about -20 dBLeq, the receiver shall apply an attenuation of 11 dB for the digital output to
match the internal reference level.

Cant find a copy of this bulletin but the concept is there. Something to do with RFMode.

Another spec Ive seen says reduce by a further 3dB on top of the 11dB.

Thus this should be consistent around the world and not just peculiar to some implementations.

comment:8 Changed 4 years ago by robertm

  • Status changed from assigned to infoneeded

Mark,

Appreciate your expertise with the Dolby stuff-- can you comment on how/whether this still applies to the new audio code with all the resampling, upmixing, etc? If so, any chance of an updated patch?

comment:9 Changed 4 years ago by robertm

  • Resolution set to fixed
  • Status changed from infoneeded to closed

Mark,

I'm closing this one for now as you seem to be in touch with the audio guys regarding the current (and upcoming) audio changes that will affect or possibly render unnecessary this ticket. If this issue is uncorrected by those changes, please do feel free to reopen this ticket at any time with an update to your patch. Closing this as "fixed" as there's no real appropriate resolution otherwise.

Changed 3 years ago by Bill Meek <keemllib@…>

Works with trunk at 27015

comment:10 Changed 3 years ago by jyavenard

  • Resolution changed from fixed to Fixed

(In [27370]) Add options to use myth's own downmixer instead of ffmpeg's downmixer. This fix the issue with low volume audio for 5.1 AC3 stream on a stereo system. Fixes #6569

comment:11 Changed 3 years ago by jyavenard

(In [27395]) Backport [27370],[27375],[27377]. Fixes #6569 temporarily

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.