[mythtv] audio.isPaused not working for OpenSLES audio

Peter Bennett pb.mythtv at gmail.com
Sat Jul 21 12:14:25 UTC 2018



On 07/21/2018 03:09 AM, Mark Spieth wrote:
> On 7/21/2018 9:04 AM, Peter Bennett wrote:
>>
>>
>> On 07/20/2018 06:19 PM, Mark Spieth wrote:
>>> On 7/21/2018 3:48 AM, Peter Bennett wrote:
>>>> Hi Mark
>>>>
>>>> I assume you created the android OpenSLES audio support in MythTV. 
>>>> I found that audio.isPaused() always returns true, even in the 
>>>> middle of playing audio and video. This was causing audio-video 
>>>> sync to not work correctly. I fixed it by taking that check out. It 
>>>> was not necessary to check audio.isPaused() before calling Pause(). 
>>>> I just made it unconditionally call Pause() whether it was already 
>>>> paused or not. However I wonder if there is an error that is 
>>>> causing it to always return isPaused() as true and whether that may 
>>>> cause other problems.
>>>>
>>> That is strange. All the paused processing is in AudioOutputBase, 
>>> and except for Jack and CA there is nothing in any of the other 
>>> drivers.
>>> This is probably affecting many drivers then.
>>>
>>> Is this with or without stretch enabled? There is a bit of a 
>>> difference there. I will dig some more today.
>>>
>>> Mark
>> Stretch was not enabled. This is the code that pauses audio right at 
>> the start of live tv to allow the video to catch up. the audio was 
>> never being paused. MythPlayer::PrebufferEnoughFrames - also 
>> MythPlayer::AVSync where audio.isPaused is checked before audio.pause(). 
> What it should be doing is initially its in pause until bufferred 
> mode. If you ry an unpause it will stay in that mode until the first 
> audio data is written/queued.
> So when you start playing, yes it is in paused mode until you write 
> the first audio data, when it un-pauses.
> If you are withholding audio data, then it will stay paused until you 
> write the first data.
> Can you post a patch as to what you are trying to do and I will see if 
> there is a better way.
> Building your latest patch with master now.
>
> Mark
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
It is working as it should with my latest patch.
The attached two patches are part of my big patch, and they remove tests 
of audio.isPaused. Those audio.isPaused calls are in the existing code 
and are not necessary since you can call Pause when it is paused anyway.
If you revert these two patches, then start Live TV on Shield, it jerks 
and hiccups forever, until you manually pause and resume.
I think it is best to leave these two places not calling isPaused. I was 
just concerned that other things may be affected by the isPause being wrong.

Peter



-------------- next part --------------
A non-text attachment was scrubbed...
Name: mythplayer.cpp.002.patch
Type: text/x-patch
Size: 494 bytes
Desc: not available
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20180721/b78c0990/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mythplayer.cpp.005.patch
Type: text/x-patch
Size: 698 bytes
Desc: not available
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20180721/b78c0990/attachment-0001.bin>


More information about the mythtv-dev mailing list