Opened 10 years ago

Closed 10 years ago

#8030 closed defect (fixed)

*confusing* AC3 track confuses trunk audio code

Reported by: Yeechang Lee <ylee@…> Owned by: JYA
Priority: minor Milestone: 0.23
Component: MythTV - Audio Output Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

My frontend has a Chaintech AV-710 sound card, and all audio goes from the frontend to my receiver via S/PDIF. Playing non-AC3 and AC3 audio from my MythTV recordings has almost always been flawless.

Since moving to the trunk/0.23 audio code, for the last month or so of The Tonight Show with Conan O'Brien before cancelation, its AC3 track would usually confuse mythfrontend. The issue may be caused by the transition between non-AC3 and AC3 audio in the same recording. Four samples from the last episode are available, each 100MB (about 55 seconds) in length.

*conan.mpg Taken from the middle of the recording. Audio plays properly.

*conan2.mpg Taken from the beginning of the recording. The non-AC3 track from the local-news program preceding Tonight plays correctly; the AC3 track from Tonight does not.

*conan3.mpg Starts a second or two after Tonight begins. Audio plays correctly.

*conan4.mpg Starts just before or after (hard to tell) Tonight begins. Audio does not play correctly.

This issue also exists with other NBC programs, but not consistently as with Tonight; last night's episode of Community does, but previous ones did not. Both recordings are from over-the-air; unfortunately I do not know if other NBC recordings I've seen with the issue were also from OTA as opposed to FireWire?.

Change History (8)

comment:1 in reply to:  description Changed 10 years ago by Yeechang Lee <ylee@…>

Replying to Yeechang Lee <ylee@…>:

The issue may be caused by the transition between non-AC3 and AC3 audio in the same recording.

After further testing, the issue requires a) a transition between non-AC3 and AC3 audio and b) more than one audio track in the recording, and c) can be worked around via using timestretch. See the thread beginning at http://www.gossamer-threads.com/lists/mythtv/dev/423098#423098 .

comment:2 Changed 10 years ago by tralph

Milestone: unknown0.23
Priority: minormajor

comment:3 Changed 10 years ago by tralph

Yeechang, I wasn't able to download your samples. Could you provide them again?

comment:4 in reply to:  3 Changed 10 years ago by ylee@…

Replying to tralph:

Yeechang, I wasn't able to download your samples. Could you provide them again?

I've reuploaded the clips. (They might've been deleted due to overzealous anti-piracy measures, not realizing that each clip is each less than a minute of a 60-minute program uploaded purely for diagnostic purposes, so I suggest downloading them sooner rather than later if possible.)

*conan.mpg
*conan2.mpg
*conan3.mpg
*conan4.mpg

comment:5 Changed 10 years ago by JYA

I have finally some times this week-end, and I will be working on it...

comment:6 Changed 10 years ago by JYA

Priority: majorminor

Some notes... All Audio tracks in those samples are AC3 ; it just changes from AC3 2ch to 6ch

Index: libs/libmythtv/avformatdecoder.cpp =================================================================== --- libs/libmythtv/avformatdecoder.cpp (revision 23613) +++ libs/libmythtv/avformatdecoder.cpp (working copy) @@ -3951,7 +3951,10 @@

{

if (hdr.channels != last_ac3_channels) {

  • last_ac3_channels = curstream->codec->channels = hdr.channels;

+ VERBOSE(VB_AUDIO, LOC + QString("from %1 to %2 channels").arg(last_ac3_channels).arg(hdr.channels)); + if (hdr.channels < last_ac3_channels) + curstream->codec->channels = hdr.channels; + last_ac3_channels = hdr.channels;

SetupAudioStream?();

}

}

Will show whenever a number of channels change occurs in the AC3 audio track... You will see in that video that the number of channels change from 2 to 6 to 2 to 6 etc... 2010-02-27 02:16:43.404 AFD: from 2 to 6 channels 2010-02-27 02:16:43.804 AFD: from 6 to 2 channels 2010-02-27 02:16:43.805 AFD: from 2 to 6 channels 2010-02-27 02:16:43.971 AFD: from 6 to 2 channels 2010-02-27 02:16:43.971 AFD: from 2 to 6 channels 2010-02-27 02:16:44.138 AFD: from 6 to 2 channels etc...

When timestretch is activated once, digital passthrough is disabled for the remaining of the playback; this has the side effect of mythtv to then stop checking if the number of channels has changed and will only decode the stereo channels. *But* the number of channels change continue to occur... So the problem is still there, it's just hidden.

The patch above will change the decoding to the least amount of channels present when a number of channels change occur. This is not the ideal solution, because should a genuine change in the number of channels occur then it won't happen.

The ideal work-around would be to disable the number of channels tracking only if it occurs too quickly...

Same issues occur with mplayer... (I get no sound during the pure stereo tracks)

Change bug to minor as the problem is with the content... Note that the same issue is found in all those videos ...

So I believe you should complain to NBC

comment:7 Changed 10 years ago by JYA

Summary: AC3 track confuses trunk audio code*confusing* AC3 track confuses trunk audio code

comment:8 Changed 10 years ago by JYA

Resolution: fixed
Status: newclosed

(In [23614]) Ignore AC3 channels change if they occur less than 30 read frames appart. This allows to properly play the audio track for corrupted files. Fix #8030

Note: See TracTickets for help on using tickets.