Modify

Ticket #3260 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Internal player chooses wrong audio track for default playback

Reported by: Yeechang Lee <ylee@…> Owned by: skamithi
Priority: minor Milestone: 0.21
Component: mythvideo 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

mythfrontend.log (8.2 KB) - added by Yeechang Lee <ylee@…> 5 years ago.
'mythfrontend -v playback' output
mythdvd_fix_for_ticket_3260.diff (561 bytes) - added by skamithi 5 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 5 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 5 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 5 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 5 years ago.
audio_track_final patch with some bugfixes. found some problems with it on the jet li heros dvd.

Change History

comment:1 Changed 5 years ago by skamithi

  • Owner changed from awithers to skamithi

comment:2 follow-up: ↓ 3 Changed 5 years ago by skamithi

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.

Changed 5 years ago by Yeechang Lee <ylee@…>

'mythfrontend -v playback' output

comment:3 in reply to: ↑ 2 Changed 5 years ago by Yeechang Lee <ylee@…>

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 Changed 5 years ago by halovanic@…

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 Changed 5 years ago by J.Pilk@…

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 Changed 5 years ago by J.Pilk@…

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 Changed 5 years ago by skamithi

  • Status changed from new to assigned
  • Milestone changed from unknown to 0.21

comment:8 Changed 5 years ago by skamithi

  • Summary changed from Internal player chooses wrong audio track for default playback to Internal dvd player chooses wrong audio track for default playback

Changed 5 years ago by skamithi

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 Changed 5 years ago by skamithi

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

comment:10 Changed 5 years ago by skamithi

(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 Changed 5 years ago by skamithi

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

comment:12 follow-up: ↓ 14 Changed 5 years ago by skamithi

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

comment:13 Changed 5 years ago by J.Pilk@…

  • Status changed from closed to reopened
  • Resolution fixed deleted

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.

comment:14 in reply to: ↑ 12 Changed 5 years ago by ylee@…

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 Changed 5 years ago by skamithi

  • Summary changed from Internal dvd player chooses wrong audio track for default playback to Internal player chooses wrong audio track for default playback

Changed 5 years ago by skamithi

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 Changed 5 years ago by ylee@…

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 Changed 5 years ago by skamithi

(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 Changed 5 years ago by skamithi

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

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

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.

Changed 5 years ago by skamithi

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 Changed 5 years ago by skamithi

(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 Changed 5 years ago by skamithi

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

comment:22 Changed 5 years ago by stuartm

  • Status changed from closed to reopened
  • Resolution fixed deleted

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 Changed 5 years ago by J.Pilk@…

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 Changed 5 years ago by skamithi

  • Milestone changed from 0.21 to unknown

comment:25 Changed 5 years ago by bwobbones

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

comment:26 Changed 5 years ago by skamithi

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 Changed 5 years ago by skamithi

  • Milestone changed from unknown to 0.21

Changed 5 years ago by skamithi

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.

Changed 5 years ago by skamithi

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

comment:28 Changed 5 years ago by skamithi

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

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

comment:29 Changed 5 years ago by skamithi

(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 Changed 5 years ago by skamithi

(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.

View

Add a 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.