Opened 12 years ago

Closed 9 years ago

Last modified 9 years ago

#4976 closed defect (fixed)

Cannot change Audio Channels in DVB Streams

Reported by: anonymous Owned by: Isaac Richards
Priority: major Milestone: 0.23-fixes
Component: MythTV - Video Playback Version: 0.22-fixes
Severity: medium Keywords: dvb audio channel
Cc: Ticket locked: no

Description

I'm encountering a problem switching audio channels in (DVB-C) Live-TV and recordings: Although the correct channels are displayed in the menu, switching channels doesn't actually work.

Additionaly, after switching to an audio channel from the menu and then entering the same menu again shows different audio channel selections than the last time ... I remember having seen this bug previously in MythTV?

And yes, the DVB-C hardware is allright: Playing (switching audio channels) with MPlayer works perfectly (even recordings by MythTV).

Attachments (5)

screen1.png (126.2 KB) - added by oheinz@… 12 years ago.
audio selection problem (1)
screen2.png (126.6 KB) - added by oheinz@… 12 years ago.
audio selection problem (2)
bug4976.log (4.9 KB) - added by Markus Schulz <msc@…> 11 years ago.
log output with my small hack
bug4976.diff (1.1 KB) - added by Markus Schulz <msc@…> 11 years ago.
quick hack
t4976_increment_lang_index_for_dual_streams.diff (1.5 KB) - added by Janne Grunau 10 years ago.

Download all attachments as: .zip

Change History (31)

comment:1 Changed 12 years ago by oheinz@…

I think I might have the same problem. It seems to happen only on some channels (notably german public channels ard & zdf). I will attach 2 screen shots the first is the one before selecting the ac3 audio trace the second one after selecting it.

Log says:

2008-03-21 12:29:18.023 AFD: Opened codec 0x9aa5bd0, id(MPEG2VIDEO) type(Video) 2008-03-21 12:29:18.024 AFD: codec MP3 has 2 channels 2008-03-21 12:29:18.024 AFD: Opened codec 0x9b1fd90, id(MP3) type(Audio) 2008-03-21 12:29:18.024 AFD: codec MP3 has 2 channels 2008-03-21 12:29:18.024 AFD: Opened codec 0x9b20110, id(MP3) type(Audio) 2008-03-21 12:29:18.024 AFD: codec AC3 has 2 channels No accelerated IMDCT transform found 2008-03-21 12:29:18.025 AFD: Opened codec 0x9b20810, id(AC3) type(Audio)

I do have a small capture file (23mb) so if someone needs the stream recording for debugging feel free to contact me (or if you need more information)

Changed 12 years ago by oheinz@…

Attachment: screen1.png added

audio selection problem (1)

Changed 12 years ago by oheinz@…

Attachment: screen2.png added

audio selection problem (2)

comment:2 Changed 11 years ago by Markus Schulz <msc@…>

same problem here, but only with one channel (german ARD on dvb-s(astra19.2) and dvb-c). A recording plays fine with mplayer but there was no language code for each stream (mplayer remarks them all as unknown language)

comment:3 Changed 11 years ago by Markus Schulz <msc@…>

with -v audio i've seen the problem. the channel has no language information (or wrong language informations?) and myth tries to reselect permanently the audio channel and can't reselect the same as the user has selected manually cause the loop breaks for same language index and all streams has language_index == 0.

output with enabled debugging inside: int AvFormatDecoder::AutoSelectAudioTrack?(void)

looks then like this: 2008-06-20 19:26:47.209 AFD: Selected track 1: German MP2 2ch (A/V Stream #1) 2008-06-20 19:26:47.209 AFD: * id( MP3) 48000Hz 2ch 16bps 2008-06-20 19:26:47.211 AFD: * id( MP3) 48000Hz 2ch 16bps 2008-06-20 19:26:47.211 AFD: * id( MP3) 48000Hz 2ch 16bps 2008-06-20 19:26:47.211 AFD: * id( MP3) 48000Hz 2ch 16bps 2008-06-20 19:26:47.211 AFD: * id( AC3) 48000Hz 6ch 16bps 2008-06-20 19:26:47.212 AFD: Trying to reselect audio track 2008-06-20 19:26:47.212 AFD: Selected track 2: German MP2 2ch (A/V Stream #1) 2008-06-20 19:26:47.230 AFD: * id( MP3) 48000Hz 2ch 16bps 2008-06-20 19:26:47.231 AFD: * id( MP3) 48000Hz 2ch 16bps 2008-06-20 19:26:47.231 AFD: * id( MP3) 48000Hz 2ch 16bps 2008-06-20 19:26:47.231 AFD: * id( AC3) 48000Hz 6ch 16bps 2008-06-20 19:26:47.231 AFD: Trying to reselect audio track 2008-06-20 19:26:47.231 AFD: Selected track 1: German MP2 2ch (A/V Stream #1) 2008-06-20 19:26:47.270 AFD: * id( MP3) 48000Hz 2ch 16bps 2008-06-20 19:26:47.270 AFD: * id( MP3) 48000Hz 2ch 16bps 2008-06-20 19:26:47.270 AFD: * id( MP3) 48000Hz 2ch 16bps 2008-06-20 19:26:47.270 AFD: * id( MP3) 48000Hz 2ch 16bps 2008-06-20 19:26:47.270 AFD: * id( AC3) 48000Hz 6ch 16bps ...

this spams permanently on this channel.

with this short hack you can then permanently select the ac3 stream:


Index: avformatdecoder.cpp =================================================================== --- avformatdecoder.cpp (Revision 17504) +++ avformatdecoder.cpp (Arbeitskopie) @@ -2876,8 +2876,8 @@

if (wlang == atracks[i].language)

selTrack = i;

  • if (windx == atracks[i].language_index)
  • break;

+ if (windx == atracks[i].language_index) + break;

}

}


then he permanently selects the ac3. not nice but a quick hack until someone founds out why he permanently tries to reselect.

Changed 11 years ago by Markus Schulz <msc@…>

Attachment: bug4976.log added

log output with my small hack

Changed 11 years ago by Markus Schulz <msc@…>

Attachment: bug4976.diff added

quick hack

comment:4 Changed 11 years ago by stuartm

Component: mythtvVideo Playback

comment:5 Changed 11 years ago by Markus Schulz <msc@…>

i've done some further investigations. the avcodec_dual_language variable flips between 0-1 every 1-2 frames in avformatdecoder.cpp::GetFrame? loop. Therefore myth tries to split this supposed bilingual audio stream into two and the number of selectable streams changes always. Eventually you cant select a stream after the sometimes "bilingual" audio stream. It happens all the time on the channel "Das Erste"@Astra19.2 (DVB-S (QPSK) - 11836.50 H - 27500 3/4 - NID:1 - TID:1101) and for much two-audio-stream containing avi files.

comment:6 Changed 11 years ago by jan@…

Ping? Did any developer have a chance to look into this?

comment:7 in reply to:  3 Changed 10 years ago by rho

I'm using this patch for quite some time now, working splendid. I'd love to see this problem properly addressed though. I second the 'Ping' below

comment:8 Changed 10 years ago by stuartm

Status: newinfoneeded_new

Is anyone seeing this problem with trunk?

comment:9 Changed 10 years ago by Nick Morrott <knowledgejunkie (at) gmail (dot) com>

Running trunk r20830 with DVB-S, I still have problmes changing to another audio channel. Testing with BBC England on Freesat (UK) which reports 2 audio streams in the menu gave (-v audio):

YadifDeint: size changed from 0 x 0 -> 720 x 576
YadifDeint: Using existing thread.
2009-07-08 20:02:08.450 VideoOutputXv: XVideo Adaptor Name: 'Intel(R) Textured Video'
2009-07-08 20:02:08.861 AFD: Opened codec 0xb4efec0, id(MPEG2VIDEO) type(Video)
2009-07-08 20:02:08.861 AFD: codec MP2 has 2 channels
2009-07-08 20:02:08.861 AFD: Opened codec 0x9eff440, id(MP2) type(Audio)
2009-07-08 20:02:08.861 AFD: Audio Track #1 is A/V stream #1 and has 2 channels in the English language(6647399).
2009-07-08 20:02:08.861 AFD: codec MP2 has 2 channels
2009-07-08 20:02:08.861 AFD: Opened codec 0xb4d9e80, id(MP2) type(Audio)
2009-07-08 20:02:08.861 AFD: Audio Track #2 is A/V stream #2 and has 2 channels in the Unknown language(5128530).
2009-07-08 20:02:08.861 AFD: Opened codec 0xb06a750, id(DVB_SUBTITLE) type(Subtitle)
2009-07-08 20:02:09.002 AFD: Trying to select audio track (w/lang)
2009-07-08 20:02:09.003 AFD: Selected track 1: English MP2 2ch (A/V Stream #1)
2009-07-08 20:02:09.003 AFD: Initializing audio parms from audio track #1
2009-07-08 20:02:09.003 AFD: Audio format changed 
			from id(NONE)    -1Hz -1ch   0bps    ; id(NONE)    -1Hz -1ch   0bps   
			to   id( MP2) 48000Hz  2ch  16bps    ; id( MP2) 48000Hz  2ch  16bps   
2009-07-08 20:02:09.008 AO: Killing AudioOutputDSP
2009-07-08 20:02:09.008 Opening audio device 'default'. ch 2(2) sr 48000
2009-07-08 20:02:09.008 Opening ALSA audio device 'default'.
2009-07-08 20:02:09.019 in SetParameters(format=2, channels=2, rate=48000, buffer_time=400000, period_time=25000)
2009-07-08 20:02:09.020 ALSA, Warning: mmap not available, attempting to fall back to slow writes.
2009-07-08 20:02:09.020 get_buffer_size returned 19200
2009-07-08 20:02:09.020 set_period_time_near returned 25000
2009-07-08 20:02:09.020 get_period_size returned 1200
2009-07-08 20:02:09.080 AO: Audio fragment size: 6144
2009-07-08 20:02:09.082 AO: Audio Stretch Factor: 1
2009-07-08 20:02:09.082 Audio Codec Used: not set
2009-07-08 20:02:09.083 AO: Ending reconfigure
2009-07-08 20:02:09.083 NVP(0): Enabling Audio
2009-07-08 20:02:09.083 AO: kickoffOutputAudioLoop: pid = 4172
2009-07-08 20:02:09.083 AO: no change exiting
2009-07-08 20:02:09.083 AO: OutputAudioLoop: Play Event
2009-07-08 20:02:09.130 AO: Pause 1
2009-07-08 20:02:09.130 AO: OutputAudioLoop: audio paused
2009-07-08 20:02:09.206 AO: Pause 0
2009-07-08 20:02:09.217 AO: OutputAudioLoop: Play Event
2009-07-08 20:02:09.244 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.287 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.318 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.351 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.356 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.387 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.393 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.398 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.403 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.408 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.413 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.418 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.424 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.429 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.434 AO: dropping back audio_buffer_unused
2009-07-08 20:02:09.439 AO: dropping back audio_buffer_unused
SetSubtitleMode ResidentProgram is not implemented
2009-07-08 20:02:38.051 AFD: Audio stream type not changed.
2009-07-08 20:02:51.426 AFD: Audio stream type not changed.
2009-07-08 20:03:28.026 TV: Attempting to change from Watching WatchingLiveTV to None
2009-07-08 20:03:28.053 AO: Killing AudioOutputDSP
2009-07-08 20:03:28.062 AO: OutputAudioLoop: Stop Event
2009-07-08 20:03:28.062 AO: kickoffOutputAudioLoop exiting
2009-07-08 20:03:28.984 TV: Changing from Watching WatchingLiveTV to None

The audio channel list contained two 2 entries. Changing to the second did not happen - default track kept playing, although the newly chosen channel was checked when next entering the change audio track menu. Changing back to the default audio channel did not interrupt the audio stream and did reselect the first audio track in the menu again.

comment:10 Changed 10 years ago by Markus Schulz <msc@…>

same problem as i described above with trunk@20837....

comment:11 Changed 10 years ago by stuartm

Milestone: 0.21.1unknown
Status: infoneeded_newnew

comment:12 Changed 10 years ago by Rouven Schuerch <rho@…>

Bug still persists on trunk revision 20930. I can provide several recordings showing the problematic behaviour. And it would be fantastic if this problem could be addressed for the 0.22 release. Manually patching/building Ubuntu packages is tiresome ...

comment:13 Changed 10 years ago by stuartm

Component: Video PlaybackMythTV - Video Playback

comment:14 in reply to:  13 Changed 10 years ago by anonymous

Replying to stuartm: *Ping* Bug still active on latest 0.22 version.

comment:15 Changed 10 years ago by stuartm

Milestone: unknown0.23
Version: 0.21-fixes0.22-fixes

comment:16 Changed 10 years ago by stuartm

Status: newinfoneeded_new

Is this still an issue with 0.23 RC2 or later?

comment:17 Changed 10 years ago by Nick Morrott <knowledgejunkie (at) gmail (dot) com>

Testing with trunk @ r24200, I still see the issue. Initial testing of DVB-T suggested it was fixed, but testing on DVB-S (BBC1/2 channels reporting 2 audio streams) resulted in the primary audio stream continuing to play after manually changing stream via the menu. The selected stream indicator was updated, but the stream itself was not.

comment:18 Changed 10 years ago by robertm

Status: infoneeded_newnew

Changed 10 years ago by Janne Grunau

comment:19 Changed 10 years ago by Janne Grunau

Status: newinfoneeded_new

please test if t4976_increment_lang_index_for_dual_streams.diff fixes the issue

comment:20 Changed 10 years ago by Janne Grunau

(In [24362]) AVFD: increment language_index for the second substream dual language stream

also simplifies audio/subtitle index generation code, Refs #4976

comment:21 Changed 10 years ago by robertm

Status: infoneeded_newnew

comment:22 Changed 10 years ago by Stuart Auchterlonie

Milestone: 0.230.23-fixes

comment:23 Changed 10 years ago by robertm

Status: newinfoneeded_new

I have no idea why I set this back to new, setting back to infoneeded

comment:24 Changed 9 years ago by martin.adler@…

This seems fixed for me with 0.23. At least for german stations ARD and ZDF which where initially having this issue.

comment:25 Changed 9 years ago by sphery

Resolution: fixed
Status: infoneeded_newclosed

Seems to have been fixed by [24362]

comment:26 in reply to:  25 Changed 9 years ago by Nick Morrott <knowledgejunkie (at) gmail (dot) com>

Replying to mdean:

Seems to have been fixed by [24362]

Not 100% sure if it is fixed. Just upgraded to current trunk (r25149) and changing tracks on a DVB-S channel (UK Channel 4, from English 2ch to Unknown 2ch) results in a change of the selector but not of the track, as far as I can tell. Is this expected with an "unknown" audio track?

Note: See TracTickets for help on using tickets.