Opened 19 years ago

Closed 13 years ago

Last modified 13 years ago

#3260 closed Bug Report - General (Won't Fix)

Internal player chooses wrong audio track for default playback

Reported by: Yeechang Lee <ylee@…> Owned by: stuartm
Priority: major Milestone: 0.26.1
Component: MythTV - DVD Playback Version: 0.20
Severity: medium Keywords: internal player audio tracks
Cc: Ticket locked: no

Description

I use 0.20-fixes. I have an AVI rip of a DVD of a movie with two audio tracks. The first track is the soundtrack and the second is a commentary. The movie was filmed in the early 1960s and so has glorious mono sound. The commentary was done recently in stereo. Because the commentary track has more sound channels than the actual soundtrack the internal player picks it as the default audio track to play, which of course isn't the desired behavior.

I suggest that the following decision tree be followed:

  • Play the first available 5.1 track. (It's unlikely a commentary will done in surround sound.) Else . . .
  • Play the first audio track, regardless of whether a later track has more channels.

If the above is too cumbersome, I suppose that a simple

  • Play the first audio track by default

will still be an improvement over the current arrangement, which is too smart for its own good.

PS - Although I listed this under MythVideo, apparently the issue exists with MythDVD as well.

Attachments (6)

mythfrontend.log (8.2 KB ) - added by Yeechang Lee <ylee@…> 19 years ago.
'mythfrontend -v playback' output
mythdvd_fix_for_ticket_3260.diff (561 bytes ) - added by skamithi 19 years ago.
remove qbubblesort for audio tracks. its meant for the subtitle tracks since they are sometimes not sorted when parsed by AVformatdecoder::scanstreams. Audio tracks look sorted already and the qbubblesort doesn't take into account audio streams of different codecs.
dont_apply_audio_autoselect_on_videos.diff (516 bytes ) - added by skamithi 19 years ago.
patch prevents the audio autoselection code from executing if you play a file flagged as a video (non-dvd). Shouldn't affect regular recordings.
remove_audio_streams.diff (3.9 KB ) - added by skamithi 19 years ago.
remove audio streams from the stream list during title transitions. resolves problem mentioned problem but sometimes during the transition audio is disabled and never reenabled. still testing patch.
audio_track_final_fix.diff (12.5 KB ) - added by skamithi 19 years ago.
created a qmap in DVDRingPriv that maps streamids to dvd track numbers. this map is used to ensure that the proper audio tracks are in the AFD audio table and that it is in the right order.
audio_track_final_fix_v2.diff (12.3 KB ) - added by skamithi 19 years ago.
audio_track_final patch with some bugfixes. found some problems with it on the jet li heros dvd.

Download all attachments as: .zip

Change History (46)

comment:1 by skamithi, 19 years ago

Owner: changed from Anduin Withers to skamithi

comment:2 by skamithi, 19 years ago

please attach the "mythfrontend -v playback" output from the time the movie starts to the time you exit the video. Only play the video for 1 minute or until the problem starts.

by Yeechang Lee <ylee@…>, 19 years ago

Attachment: mythfrontend.log added

'mythfrontend -v playback' output

in reply to:  2 comment:3 by Yeechang Lee <ylee@…>, 19 years ago

Replying to skamithi:

please attach the "mythfrontend -v playback" output from the time the movie starts to the time you exit the video.

OK, log attached. Looking it over, I'm puzzled and surprised by the

2007-03-24 17:35:53.959 Dec: Selecting first track
2007-03-24 17:35:53.959 Dec: Selected track #1 in the Unknown language(0)

because that's definitely not what I see; the internal player always insists on playing the second track (as seen in Menu|Select Audio Track) by default when playback starts.

comment:4 by halovanic@…, 19 years ago

Oops disregard that first attachment, I forgot I had bookmarks enabled on that one so the DVD probably just selected the audio track I had going the last time.

In the OSD menu, the commentary track appears first in the list. This doesn't seem right as mplayer and vlc both show the main audio track appearing first. However, xine shows the commentary track first as well, although it auto-selects the main track properly. Interestingly enough, using the DVD's own audio/language menu in Myth causes the commentary track to play when I select the main audio track and vice versa.

comment:5 by J.Pilk@…, 19 years ago

I'm in the UK using the ATrpms 'Bleeding' trunk_r13045 build on FC5. Mytharchive creates mp2 audio by default (Don't re-encode from DVB-T). All DVDs created like this are silent in the internal player until the alternative audio track is selected. The OSD identifies the tracks as (1 Unknown AC3 2Ch) and (2 Unknown MP2 1Ch)- although I think I'm getting stereo.

A DVD that I created using the standard re-encoding (to go from an unusual transmitted 544*576 resolution to DVD-standards-compliant 720*576) has ac3 audio. This is seen as the only audio track and plays immediately. The same recording, burned without re-encoding, plays ok but needs the usual selection of the alternative track.

comment:6 by J.Pilk@…, 19 years ago

I've just found that navigation using the number/arrow combination from the keyboard will often lock up the internal player; it doesn't seem to happen with the mouse roller. With normal frontend evocation I then get continuous reports of prebuffering pause; with the -v playback option the report is: 2007-03-26 16:21:12.295 DVDNAV_CELL_CHANGE: pg_length == 86367600, pgc_length == 691516800, cell_start == 0, pg_start == 0, title == 1, part == 1 titleParts 8 2007-03-26 16:21:12.295 DVDNAV_SPU_CLUT_CHANGE happened. 2007-03-26 16:21:12.295 DVDNAV_SPU_STREAM_CHANGE: physical_wide==-1, physical_letterbox==-1, physical_pan_scan==-1, logical==1081472

repeated indefinitely. Maybe it doesn't belong on this ticket ? - but it's happening :-)

comment:7 by skamithi, 19 years ago

Milestone: unknown0.21
Status: newassigned

comment:8 by skamithi, 19 years ago

Summary: Internal player chooses wrong audio track for default playbackInternal dvd player chooses wrong audio track for default playback

by skamithi, 19 years ago

remove qbubblesort for audio tracks. its meant for the subtitle tracks since they are sometimes not sorted when parsed by AVformatdecoder::scanstreams. Audio tracks look sorted already and the qbubblesort doesn't take into account audio streams of different codecs.

comment:9 by skamithi, 19 years ago

please note that the problem i'm addressing only relates to files flagged as dvds.

comment:10 by skamithi, 19 years ago

(In [13209]) Refs #3260. internal dvd player. do not apply sort algorithm on the list of learnt dvd audio tracks. let me know if you get a case where the dvd audio tracks are out of order when stream scanning occurs.

comment:11 by skamithi, 19 years ago

Resolution: fixed
Status: assignedclosed

comment:12 by skamithi, 19 years ago

(In [13292]) internal dvd player: Backport [13209] to 0.20 fixes. Refs #3260

comment:13 by J.Pilk@…, 19 years ago

Resolution: fixed
Status: closedreopened

Sorry I didn't respond earlier. I'm now running trunk_r13228, so the changes above should be in place. I still have the same behaviour, with mp2 audio not selected by default. ffmpeg -i doesn't find any other audio streams. Input #0, mpeg, from 'VTS_01_1.VOB':

Duration: 01:02:17.4, start: 0.120000, bitrate: 2298 kb/s Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576, 15000 kb/s, 25.00 fps(r) Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, stereo, 160 kb/s

Applies to both internal DVD player and the Mytharchive 'play iso image'. And jump forward from the keyboard still hangs... Reopening to get it flagged up.

in reply to:  12 comment:14 by ylee@…, 19 years ago

Replying to skamithi:

(In [13292]) internal dvd player: Backport [13209] to 0.20 fixes. Refs #3260

I can confirm that, sadly, applying r13292 to 0.20-fixes does not change the behavior I previously reported.

comment:15 by skamithi, 19 years ago

Summary: Internal dvd player chooses wrong audio track for default playbackInternal player chooses wrong audio track for default playback

by skamithi, 19 years ago

patch prevents the audio autoselection code from executing if you play a file flagged as a video (non-dvd). Shouldn't affect regular recordings.

comment:16 by ylee@…, 19 years ago

I am pleased to report that Stanley Kamithi's most-recent patch has taken care of my wrong audio-track in-AVI issue. Thank you!

comment:17 by skamithi, 19 years ago

(In [13327]) Refs #3260. prevent the audio autoselection code from executing if you play a file flagged as a video (non-dvd). Shouldn't affect regular recordings.

comment:18 by skamithi, 19 years ago

(In [13332]) Refs #3260. remove [13327]. auto-select audio track is useful after all for some types of vids like vobs.

comment:19 by J.Pilk@…, 19 years ago

It seems that my 'problem' here is not precisely the one described in the current title. It is that the player does not play as default the *only* audio track present in the main VOB files if the audio track in the menu had a different format. I can still play the audio by selecting the 'other' track that the player says it has found, so the effect is not as serious as misidentification in mythtranscode, which leads after two iterations to complete loss of the wanted stream. All this refers only to DVDs created by Mytharchive. It does seem that wiping the slate clean between playing menu and playing content is what is needed to get the expected behaviour.

by skamithi, 19 years ago

Attachment: remove_audio_streams.diff added

remove audio streams from the stream list during title transitions. resolves problem mentioned problem but sometimes during the transition audio is disabled and never reenabled. still testing patch.

comment:20 by skamithi, 19 years ago

(In [13427]) Refs #3260. commit log for [13426]. accidentally commited without commit log. internal dvd player: refresh audio track list from the context during dvd title transitions. some dvds have ac3 track in the dvd menu and mp2 track only in the title. refreshing the audio list makes it play the right track at the right time. let me know if this causes audio problems for others. tested it for a couple of weeks with no problem.

comment:21 by skamithi, 19 years ago

Resolution: fixed
Status: reopenedclosed

comment:22 by stuartm, 19 years ago

Resolution: fixed
Status: closedreopened

Just checked and it's not yet fixed. I realise the rental DVD from last night asked for the audio language up front so it wasn't auto-selected.

Log with -v playback, audio attached.

comment:23 by J.Pilk@…, 19 years ago

Now using ATrpms trunk_r13460, Mythburn iso image with ac3 for menu and mp2 stereo in chapters.

Still mute on changeover from menu to content. '+' key unmutes but now repeating this does *not* affect the sound, and no 'change audio channel' item appears in the menu - ie, no phantom channels now. In the chapter menu some chapters usually start with sound, some don't.

Here's a brief log extract on initial entry and title selection:

[mpeg2video @ 0x7bf8284]00 motion_type at 2 34
[mpeg2video @ 0x7bf8284]00 motion_type at 1 35
2007-05-22 23:27:02.342 AFD: Warning, video codec 0xbecddc0 id(MPEG2VIDEO) type (Video) already open.
2007-05-22 23:27:02.343 AFD: Opened codec 0xc2331f0, id(AC3) type(Audio)
2007-05-22 23:27:04.534 WriteAudio: buffer underrun
2007-05-22 23:27:05.337 WriteAudio: buffer underrun
2007-05-22 23:27:11.496 AFD: Warning, audio codec 0xc2331f0 id(AC3) type (Audio) already open, leaving it alone.
2007-05-22 23:27:11.503 AFD: Warning, video codec 0xbecddc0 id(MPEG2VIDEO) type (Video) already open.
2007-05-22 23:27:11.503 AFD: Warning, audio codec 0xc2331f0 id(AC3) type (Audio) already open, leaving it alone.
2007-05-22 23:27:11.504 AFD: Opened codec 0xcbe0900, id(MP2) type(Audio)
2007-05-22 23:27:11.509 NVP: Disabling Audio, params(0,-1,-1)
2007-05-22 23:27:11.516 AFD: Warning, video codec 0xbecddc0 id(MPEG2VIDEO) type (Video) already open.
2007-05-22 23:27:11.516 AFD: Opened codec 0xc235ce0, id(MP2) type(Audio)
2007-05-22 23:27:11.517 NVP: Disabling Audio, params(16,2,0)
[mpeg2video @ 0x7bf8284]00 motion_type at 7 7
[mpeg2video @ 0x7bf8284]slice mismatch
[mpeg2video @ 0x7bf8284]ac-tex damaged at 2 9

and on hitting the + key

mpeg2video @ 0x7bf8284]00 motion_type at 7 34
[mpeg2video @ 0x7bf8284]00 motion_type at 4 35
2007-05-22 23:27:12.403 GetNextFreeFrame() served a busy frame D. Dropping. UUUuLUUuUuUUUUUUUuUuUUUUUUUuUuU
2007-05-22 23:28:38.651 Opening ALSA audio device 'default'.
2007-05-22 23:28:38.660 NVP: Enabling Audio
2007-05-22 23:31:36.598 AFD: Warning, audio codec 0xc235ce0 id(MP2) type (Audio) already open, leaving it alone.
[mpeg2video @ 0x7bf8284]00 motion_type at 2 4
[mpeg2video @ 0x7bf8284]00 motion_type at 1 5

comment:24 by skamithi, 19 years ago

Milestone: 0.21unknown

comment:25 by bwobbones, 19 years ago

I noticed that this problem still exists in the 0.21 branch, any idea when the patches will be rolled into there?

comment:26 by skamithi, 19 years ago

for all those who reported wrong dvd audio track selection, please test the latest patch. it'll hopefully resolve all remaining scenarios of this problem.

comment:27 by skamithi, 19 years ago

Milestone: unknown0.21

by skamithi, 19 years ago

Attachment: audio_track_final_fix.diff added

created a qmap in DVDRingPriv that maps streamids to dvd track numbers. this map is used to ensure that the proper audio tracks are in the AFD audio table and that it is in the right order.

by skamithi, 19 years ago

audio_track_final patch with some bugfixes. found some problems with it on the jet li heros dvd.

comment:28 by skamithi, 19 years ago

Resolution: fixed
Status: reopenedclosed

(In [13601]) Closes #3260. internal dvd player. should fix remaining dvd audio track ordering problems.

comment:29 by skamithi, 18 years ago

(In [13710]) Refs #3260 . internal dvd player. remove a line i added recently, that is causing audio to be disabled during a title change and the title contains only one audio track.

comment:30 by skamithi, 18 years ago

(In [14137]) Refs #3260. internal dvd player. remove code added in #3260 that is causing chapter selection to be wrong on certain dvds where the chapter start point is not the same as the cell start.

comment:31 by Yeechang Lee <ylee@…>, 13 years ago

Hello, 5 1/2 years later I regret to report that this bug was never fixed despite being closed, or it returned some time ago. With 0.24 and 0.25 (possibly earlier too), the internal player still plays the wrong audio track by default in the situation that I describe in the original ticket, and as in comment 3 mythfrontend's log still erroneously says it chose the first track when it did not.

In addition to the original movie, I have a second DVD rip that exhibits the same issue. It also has two tracks, with the first being the original mono soundtrack and the second being a modern stereo commentary.

comment:32 by Yeechang Lee <ylee@…>, 13 years ago

Resolution: fixed
Status: closednew

comment:33 by stuartm, 13 years ago

Component: mythvideoMythTV - DVD Playback
Milestone: 0.210.26.1
Owner: changed from skamithi to stuartm
Priority: minormajor
Status: newaccepted
Type: defectBug Report - General

comment:34 by J.Pilk@…, 13 years ago

This change in priority is welcome but makes me nervous. I now have a large collection of DVDs with a single mp2 stereo track in both menu and programme sections. They play on all the systems I have. I'd like it to stay that way. Thanks!

comment:35 by Stuart Morgan <smorgan@…>, 13 years ago

Resolution: fixed
Status: acceptedclosed

In ee375344e4ac309917fb85f51c9e05ca2b4761c2/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:36 by Stuart Morgan <smorgan@…>, 13 years ago

In 17c0c77ddbb2e6f085be6b08bac31a9361b682ab/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:37 by Stuart Morgan <smorgan@…>, 13 years ago

In f176258deffd55595058be121bef8f1af2c8106c/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:38 by stuartm, 13 years ago

Resolution: fixed
Status: closednew

comment:39 by stuartm, 13 years ago

I'm re-closing this as "Won't Fix" instead of fixed. As Yeechang has pointed out this was a little different from the other 'wrong DVD track' tickets because it involves rips of DVDs without preserving the audio track metadata. It's therefore neither fixed nor fixable within MythTV.

The suggestion of simply going with the first audio track or the first multi-channel audio just won't work, it can't work since many broadcast videos place AD or commentary tracks as the first track. Those tracks are also sometimes multi-channel and in several cases (e.g. Chuck Series 5 DVDs) the commentary track is 5.1 while the main audio is stereo. The audio track auto-selection code exists because we used to use the first track and that consistently resulted in the wrong audio being played for many.

What I've recently implemented in Master (0.27pre) for videos and 0.25/0.26 for DVDs is filtering of commentary (et al) tracks when performing auto-selection for containers where this information is stored. This has been tested as working with mpegts (broadcast) and DVDs, and in theory other containers such as Matroska should be supported so long as ffmpeg supports reading of those attributes.

I would suggest re-ripping the DVDs in question to another more modern container with a ripping application that will preserve the metadata. Or failing that ISOs should work correctly.

Last edited 13 years ago by stuartm (previous) (diff)

comment:40 by stuartm, 13 years ago

Resolution: Won't Fix
Status: newclosed

Oops, actually close the ticket

Note: See TracTickets for help on using tickets.