On 2/17/2019 8:02 AM, mythtv wrote:
> On 2/16/19 2:53 PM, Peter Bennett wrote:
>>
>> On 2/16/19 3:48 PM, John Pilkington wrote:
>>> On 16/02/2019 20:36, mythtv wrote:
>>>> On 2/16/19 1:56 PM, Peter Bennett wrote:
>>>>>
>>>>> On 2/16/19 2:47 PM, mythtv wrote:
>>>>>> Thanks for the links. I cloned them but I'm not seeing the android
>>>>>> source. Am I missing it or does it get pulled down via one of the
>>>>>> shell
>>>>>> scripts?
>>>>> The same source works for Android and Linux. In some cases #ifdef in
>>>>> the code references different pieces of code where necessary, and
>>>>> there are a few modules that are only used for android (for example
>>>>> libs/libmyth/audio/audiooutputopensles.cpp).
>>>>>
>>>>>
>>>> I'm looking more for the audio output modules. I'd like to see about
>>>> getting surround sound working on the firestick. I've done some other
>>>> audio playback code in android in a different app and thought I'd
>>>> take a
>>>> look at it.
>>> I saw a post some time ago about this and wasn't clear how it might
>>> work. My firestick 4k has only HDMI output, so won't you need to do
>>> audio passthrough to an external multi-channel audio system?
>>>
>>> John P
>>>
>> That is correct - I take the optical output from the TV and plug it
>> into the sound system. It works for me with the Shield (which also
>> only has hdmi output), but I have not yet tried the fire stick.
>>
>> Peter
>>
> I am just running HDMI to the receiver, and then on to the TV. I may not
> be much help after all. My audio work was in Java. I've done a lot of
> C++ in the past but not much in linux, and the Qt stuff just makes my
> head spin trying to work with it. I hope surround works someday, I
> really don't like Kodi but I want to use these firesticks.
>
I'm not sure how 5.1 is working with the opensles driver at all as it
wasn't designed to.
That said since it works sometimes (white noise which Ive seen), I
suspect the 10ms buffer size chosen could be adjusted to be a multiple
of the AC3 packet size and that should fix the white noise issue
(without adding noise when audio is silent as peter has mentioned in the
past).
For those interested, the buffer is allocated in
AudioOutputOpenSLES::StartPlayer. The number of channels is set to 2 so
if AC3 is working, it must be using this setting. The buffer it
allocates however is proportional to m_bytes_per_frame so this is a bit
sus by itself. I dont know what I was thinking at the time but it worked
and haven't touched it since.
An AC3 packet is notionally 1536 bytes for 32ms so all buffers should be
a multiple of 1536 bytes.
A buffer size of 8ms achieves this (OPENSLES_BUFLEN). Maybe bump up
OPENSLES_BUFFERS to 12 to keep the total duration reasonably constant
but this was arbitrary too. YMMV.
I will give this a try today and see, but anyone is free to try it too.
The other curious one is POSITIONUPDATEPERIOD and Ive forgotten what
that one does. A bit more research is required.
Cheers
Mark
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus _______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev http://wiki.mythtv.org/Mailing_List_etiquette MythTV Forums:
https://forum.mythtv.org