[mythtv] AC3 passthrough and timestretch problems
Krzysztof Adamski
k at adamski.org
Thu May 1 18:24:19 UTC 2008
On Thu, 2008-01-05 at 13:14 -0400, Dan Wilga wrote:
> I really like the concept of the new(ish) audio upsampling code, but
> it seems to have problems with playback groups that use timestretch.
>
> This is with r16716. Before writing this message, I searched trac for
> tickets and newer revisions that might affect this problem, but did
> not find any.
>
> I'm using ALSA:iec958, so that it goes to the SPDIF connection. I've
> got a timestretch value of 1.3x in the playback group for certain
> programs. When I press play, the audio and video both appear to be
> going at something close to 1x, and about a half-second out of sync.
> My receiver thinks the audio stream is Dolby ProLogic.
>
> If I then hit "A" and adjust timestretch in either direction, there's
> a sudden pop in the audio. The receiver switches to Dolby Digital,
> and the audio and video are both playing at the correct rate and in
> sync.
>
> The following logs were produced with "-v audio". First, what happens
> when playback starts:
>
> 2008-04-30 20:16:02.717 TV: Attempting to change from None to
> WatchingPreRecorded
> 2008-04-30 20:16:02.892 AFD: Opened codec 0x8aa14e0, id(MPEG2VIDEO) type(Video)
> 2008-04-30 20:16:02.892 AFD: codec AC3 has 2 channels
> 2008-04-30 20:16:02.893 AFD: Opened codec 0x8aa1860, id(AC3) type(Audio)
> 2008-04-30 20:16:02.893 AFD: Audio Track #1 is A/V stream #1 and has
> 2 channels in the Undetermined language(7695972).
> 2008-04-30 20:16:02.893 AFD: codec AC3 has 2 channels
> 2008-04-30 20:16:02.894 AFD: Opened codec 0x8aa1d50, id(AC3) type(Audio)
> 2008-04-30 20:16:02.894 AFD: Audio Track #2 is A/V stream #2 and has
> 2 channels in the Undetermined language(7695972).
> 2008-04-30 20:16:02.894 AFD: Trying to select audio track (w/lang)
> 2008-04-30 20:16:02.894 AFD: Trying to select audio track (wo/lang)
> 2008-04-30 20:16:02.894 AFD: Selected track 1: Undetermined AC3 2ch
> (A/V Stream #1)
> 2008-04-30 20:16:02.894 AFD: Initializing audio parms from audio track #1
> 2008-04-30 20:16:02.894 AFD: Audio format changed digital passthrough
> id( AC3) 48000Hz 2ch 16bps pt
> from id(NONE) -1Hz -1ch 0bps ;
> id(NONE) -1Hz -1ch 0bps
> to id( AC3) 48000Hz 2ch 16bps pt ; id(
> AC3) 48000Hz 2ch 16bps pt
> 2008-04-30 20:16:02.898 AO: Killing AudioOutputDSP
> 2008-04-30 20:16:02.898 Opening audio device 'iec958'. ch 2(2) sr 48000
> 2008-04-30 20:16:02.898 Opening ALSA audio device 'iec958:{ AES0 0x07 }'.
> 2008-04-30 20:16:02.986 in SetParameters(format=2, channels=2,
> rate=48000, buffer_time=500000, period_time=125000)
> 2008-04-30 20:16:02.993 get_buffer_size returned 16384
> 2008-04-30 20:16:02.993 set_period_time_near returned 170666
> 2008-04-30 20:16:02.993 get_period_size returned 8192
> 2008-04-30 20:16:02.997 AO: Audio fragment size: 6144
> 2008-04-30 20:16:02.998 AO: Audio Stretch Factor: 1
> 2008-04-30 20:16:02.998 Audio Codec Used: not set
> 2008-04-30 20:16:02.998 AO: kickoffOutputAudioLoop: pid = 3254
> 2008-04-30 20:16:02.998 AO: OutputAudioLoop: Play Event
> 2008-04-30 20:16:02.998 AO: Ending reconfigure
> 2008-04-30 20:16:02.998 AO: Killing AudioOutputDSP
> 2008-04-30 20:16:03.000 AO: OutputAudioLoop: Stop Event
> 2008-04-30 20:16:03.000 AO: kickoffOutputAudioLoop exiting
> 2008-04-30 20:16:03.004 Opening audio device 'iec958'. ch 2(2) sr 48000
> 2008-04-30 20:16:03.004 Opening ALSA audio device 'iec958:{ AES0 0x07 }'.
> 2008-04-30 20:16:03.005 in SetParameters(format=2, channels=2,
> rate=48000, buffer_time=500000, period_time=125000)
> 2008-04-30 20:16:03.005 get_buffer_size returned 16384
> 2008-04-30 20:16:03.005 set_period_time_near returned 170666
> 2008-04-30 20:16:03.005 get_period_size returned 8192
> 2008-04-30 20:16:03.010 AO: Audio fragment size: 6144
> 2008-04-30 20:16:03.010 AO: Audio Stretch Factor: 1
> 2008-04-30 20:16:03.010 Audio Codec Used: AC3
> 2008-04-30 20:16:03.010 AO: kickoffOutputAudioLoop: pid = 3254
> 2008-04-30 20:16:03.010 AO: OutputAudioLoop: Play Event
> 2008-04-30 20:16:03.010 AO: Ending reconfigure
> 2008-04-30 20:16:03.076 AO: no change exiting
> 2008-04-30 20:16:03.076 AO: Pause 1
> 2008-04-30 20:16:03.076 AO: Using time stretch 1.3
> 2008-04-30 20:16:03.076 AO: Creating Encoder for codec 86020 origfs 1536
> 2008-04-30 20:16:03.076 DEnc: Init codecid=AC3, br=192000, sr=48000, ch=2
> 2008-04-30 20:16:03.076 AO: OutputAudioLoop: audio paused
> 2008-04-30 20:16:03.077 DigitalEncoder::Init fs=1536, bpf=4 ofb=6144
> 2008-04-30 20:16:03.096 VideoOutputXv: XVideo Adaptor Name: 'NV17
> Video Texture'
> 2008-04-30 20:16:03.140 OSD Theme Dimensions W: 1280 H: 720
> 2008-04-30 20:16:03.156 Unknown tag bold in font
> 2008-04-30 20:16:03.160 Unknown tag bold in font
> 2008-04-30 20:16:03.163 Unknown tag bold in font
> 2008-04-30 20:16:03.166 Unknown tag bold in font
> 2008-04-30 20:16:03.169 Unknown tag bold in font
> 2008-04-30 20:16:03.172 Unknown tag bold in font
> 2008-04-30 20:16:03.175 Unknown tag bold in font
> 2008-04-30 20:16:03.178 Unknown tag bold in font
> 2008-04-30 20:16:03.182 Unknown tag bold in font
> 2008-04-30 20:16:03.185 Unknown tag bold in font
> 2008-04-30 20:16:03.188 Unknown tag bold in font
> 2008-04-30 20:16:03.832 AO: Pause 1
> 2008-04-30 20:16:03.833 TV: Changing from None to WatchingPreRecorded
> 2008-04-30 20:16:03.834 AO: OutputAudioLoop: audio paused
> 2008-04-30 20:16:03.834 New DB connection, total: 3
> 2008-04-30 20:16:03.834 Using realtime priority.
> greedyhdeint: size changed from 0 x 0 -> 704 x 480
> 2008-04-30 20:16:03.837 Connected to database 'mythconverg' at host: dwilga
> 2008-04-30 20:16:03.848 AFD: Disabling pass through
> 2008-04-30 20:16:03.848 AFD: Initializing audio parms from audio track #1
> 2008-04-30 20:16:03.848 AFD: Audio format changed digital passthrough
> id( AC3) 48000Hz 2ch 16bps
> from id( AC3) 48000Hz 2ch 16bps pt ; id(
> AC3) 48000Hz 2ch 16bps pt
> to id( AC3) 48000Hz 2ch 16bps ; id(
> AC3) 48000Hz 2ch 16bps
> 2008-04-30 20:16:03.848 AO: SetEffDsp: 4800000
> 2008-04-30 20:16:03.848 AO: Killing AudioOutputDSP
> 2008-04-30 20:16:03.850 AO: OutputAudioLoop: Stop Event
> 2008-04-30 20:16:03.850 AO: kickoffOutputAudioLoop exiting
> 2008-04-30 20:16:03.854 Opening audio device 'iec958'. ch 2(2) sr 48000
> 2008-04-30 20:16:03.854 Opening ALSA audio device 'iec958'.
> 2008-04-30 20:16:03.855 in SetParameters(format=2, channels=2,
> rate=48000, buffer_time=500000, period_time=125000)
> 2008-04-30 20:16:03.855 get_buffer_size returned 16384
> 2008-04-30 20:16:03.855 set_period_time_near returned 170666
> 2008-04-30 20:16:03.855 get_period_size returned 8192
> 2008-04-30 20:16:03.859 AO: Audio fragment size: 6144
> 2008-04-30 20:16:03.859 AO: Audio Stretch Factor: 1.3
> 2008-04-30 20:16:03.859 Audio Codec Used: AC3
> 2008-04-30 20:16:03.859 AO: kickoffOutputAudioLoop: pid = 3254
> 2008-04-30 20:16:03.859 AO: OutputAudioLoop: Play Event
> 2008-04-30 20:16:03.859 AO: Ending reconfigure
> 2008-04-30 20:16:03.882 WriteAudio: buffer underrun
> 2008-04-30 20:16:03.899 WriteAudio: buffer underrun
> 2008-04-30 20:16:03.939 OpenGLVideoSync()
> 2008-04-30 20:16:04.175 Video sync method can't support double
> framerate (refresh rate too low for bob deint)
> greedyhdeint: size changed from 0 x 0 -> 704 x 480
> 2008-04-30 20:16:04.186 Video timing method: SGI OpenGL
> 2008-04-30 20:16:04.575 WriteAudio: buffer underrun
> 2008-04-30 20:16:04.577 WriteAudio: buffer underrun
> 2008-04-30 20:16:04.580 WriteAudio: buffer underrun
> 2008-04-30 20:16:04.582 WriteAudio: buffer underrun
> 2008-04-30 20:16:15.134 AO: Pause 1
> 2008-04-30 20:16:15.135 AO: OutputAudioLoop: audio paused
>
> ------- Now, when I adjust timestretch, it starts working correctly with:
>
> 2008-04-30 20:19:50.474 AO: Using time stretch 1.35
> 2008-04-30 20:19:50.474 AO: Creating Encoder for codec 86020 origfs 1536
> 2008-04-30 20:19:50.474 DEnc: Init codecid=AC3, br=192000, sr=48000, ch=2
> 2008-04-30 20:19:50.474 DigitalEncoder::Init fs=1536, bpf=4 ofb=6144
>
I would like to add that I'm having a similar problem with time stretch
and SPDIF passthrough. I been meaning to report this for a while.
When playing HD video with DolbyDigital through my receiver, the video
is running at the correct speed (1.10) but the audio is totaly
unlistenable, but even when I hit A and adjust it to x1.0 it still is
not listenable. My receiver is a Yamaha if that matters.
If I play the same thing on a different FE that has only 2 analog
speakers, everything works fine. Under 0.20 of Myth, the audio would
change from 5.1 to 2.0 when time stretch was used.
K
More information about the mythtv-dev
mailing list