Android - Passthrough Changes with v17

  Thread Rating:
  • 5 Vote(s) - 4.6 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
fritsch Offline
Team-Kodi Developer
Posts: 17,986
Joined: Aug 2011
Reputation: 560
Location: Stuttgart*
Music  Passthrough Changes with v17
Post: #1
Passthrough Changes
Audiotrack-Sink for Android was revisited the last days and made it API conform. That means, everyone gets what the official Android API supports: https://developer.android.com/reference/...CODING_AC3
Concerning passthrough that means:

< v21 API: nothing
v21, v22 API: AC3, EAC3 (broken on most firmware, please bug your vendor)
v23: AC3, EAC3, DTS, DTS-HD (if supported, not on the Nexus 5)
v24 (Android N): AC3, EAC3, DTS with the new IEC API, we miss hardware / software to implement dts-hd, truehd
On Nvidia Shield: AC3, EAC3, DTS, DTS-HD, TrueHD

For old AML devices (<= 5.0) I ported the AML specific API, dependend on this you will get: AC3, EAC3, DTS or even DTS-HD, TrueHD which I implemented last March with a core device by wetek. This does not (!) count for the broken release chinese boxes with pseudo Android 6.0 (see below).

Why was the old method of PT removed?
Starting with newer API there is a FLOAT mixer internally, which might harm your ears, as mixing is going on and that might produce a significant noise. We were warned by Android Audio staff to not use these hacks.

Whenever the first of you has Android N device (not on Nexus) available, please ping me - happy to fully implement DTS-HD, TrueHD for these.

Vendor firmware bugs
- Some Android TVs only support 384 kb/s AC3 and error out on 640 kb/s
- EAC3 7.1 is broken on all FireTV firmware. I suggest disabling EAC3 and use Dolby Transcoding _and_ speakers set to 2.0. It makes no sense to passthrough if you can output 6 or more PCM channels

Help my DTS stopped working - but it did in Jarvis - you broke my system - you are damn idiots, Team Kodi 111!!!111
If you have a broken firmware, download the shitty builds. They are named matching your firmware. Currently on this list are:
FireTV 1 and 2, Some prerelease AMLogic Android 6 versions that ship a broken, e.g. shitty FW, never released as final by AMLogic.

Current shitty version: http://mirrors.kodi.tv/test-builds/android/arm/ (Updated 17/03/9) - Handle with care, you are warned. This version can kill your ears as it fakes passthrough via PCM as Jarvis did.

For semi broken firmware, e.g. Android Sony TV, Philips TV, some others with AC3 640 issues:
PCM speakers: 2.0
Enable AC3
Enable AC3-Transcoding
and (!) Enable Sync Playback to Display. This is need to force transcoding even of native AC3 Input as that might be 640 kbit/s and the FW cannot use it.

My SPDIF output on the shield does not work anymore:
Yeah FW bug. Nvidia has just forgotten about their spdif users. The only workaround for this is the shitty build from above

What if I don't understand all of this?
The PCM-Hack does the following: PT audio in IEC mode is shipped in so called IEC frames. Those frames tell what they have in it. Those IEC frames are transmitted via a 16 bit format. They are using a certain bandwidth. E.g. DTS / AC3 are send via 48 khz (44.1 khz) and 2 channels. DTS-HD / TrueHD via 192 khz and 8 channels. Channels in that regard are only used to describe the bandwidth.

You can think of a IEC package like a birthday present. The very moment the receiver knows how to unpack these, it will succesfully unpack the DTS / AC3 / EAC3 ... in it and it will play well. Now there is a problem though. The very moment the postman that ships these IEC packages does not know if those packages can be e.g. combined with certain other packages (resampled) or pushed a little (set volume), which would be a problem for the inner content of these packages.

So the good case:
Android sees the data coming in as 16 bit wise shipped packages and does neither resample them and does not change the packages volume. If that is given - everything is fine and the AVR will successfully receiver the content of the packages. In order to do that. We tell Android: Ey Android - please set your volume to 100% to not touch anything, so that we can savely unpack the IEC packages later on.

But now something evil (might happen). Beginning with Android 5 - the AudioTrack (the postman sending audio packages) has a certain shelf where it might store the packages, trying to combine the packages with others, trying to alter the packages (resampling) to better fit in the current post-car. If this happens the non interpretable content of your package gets broken.

If this happens: you will hear plain noise on your AVR in full volume - this will kill your ears.

Therefore we changed that in kodi v17. We only ship the passtrhough audio stuff if there is a special, secure post-service, that e.g. tells us: Yes, I got it - i won't touch the packet content, I won't mix it - I will even block the post-car so long until all your packages are transmitted.

The "shitty" build reintroduces the Jarvis behaviour of sending PT audio. A sidenote: The so called PCM hack in Jarvis is even more dangerous as it is now in v17. As in Jarvis plain "zeros", e.g. packages with the packaging the receiver / AVR was not able to unpack properly, were sent. Therefore it's quite common in Jarvis that you get a seconf of noise on start and after stop by default.

Any questions left?

Version 17.1 builds to be found here:
Notsoshitty / Shitty: http://mirrors.kodi.tv/test-builds/android/arm/

"Your most vocal users are not reflective of your userbase" J.M.
"Of course, they [XP Users and people with outdated hardware] need to tell the world about the kind of hero they are, and block innovation for everyone else because their decades old OS / hardware needs to work =p" nevcairiel (ffmpeg)
No Debug Log no issue.
(This post was last modified: 2017-04-12 19:53 by fritsch.)
find quote
AFTVboy Offline
Junior Member
Posts: 3
Joined: Aug 2016
Reputation: 0
Location: Canada
Post: #2
MOD EDIT - wrxtasy

Posting relevant information for Kodi Krypton:

https://kodi.tv/kodi-v17-krypton-release-candidate-1/

Quote:Welcome to Android MediaCodec standards

One of the last custom implementation we had was Amlogic related code which was the device were it all started with Kodi on Android. We had to resolve to this custom implementation back then to access certain hardware parts which Android officially couldn’t yet. Due to this legacy and how we had things implemented we couldn’t switch this off just yet in past releases.

Over the past months with the help of MINIX we have been working closely with the Amlogic to get everything in order and we can say Android Marshmallow and onward will have the best experience possible for devices containing these chipsets.

Amlogic even went as far as adding the IEC61937 audio passthrough back into Android Marshmallow which normally is only available since Android Nougat. We would certainly like to thank Amlogic and MINIX for going to this extend of cooperation making the experience and support of Kodi on Android a bit better.
Now Amlogic has done their part on proving a good bases it’s up to (all Android) manufacturers and vendors to supply updates for their devices (Firmware) over coming months....

Android Firmware that meets the IEC61937 Audio passthrough standard used in SPMC 16.6.0 / Kodi Krypton v17 currently includes the Xiaomi Mi Box, MINIX U9-H, nVIDIA Shield (Nougat), WeTek Hub and Play2 with the MM Firmware update.

Any other Android Kodi boxes not implementing the IEC standard in Firmware will have DTS, DTS-HD and TrueHD Audio Passthrough issues with Kodi Krypton. These devices must use Kodi Jarvis for DTS & HD Audio passthrough (usually only AML S812/S905 MINIX and WeTek) - OR Transcode the DTS Audio to AC3, using the following Kodi Audio settings:

NOTE: In Kodi Settings > Player > Video > Sync playback to Display ...must be disabled to get any working Passthrough Audio

Start by: Kodi Settings > System Settings > Audio > Reset above settings to default

Number of Channels: 2.0
Passthrough: On
AC3: Yes
AC3 Transcoding: Yes
DTS: No

OR if you want full HD Audio passthrough with Kodi Krypton on an AMLogic S905 device, flash LibreELEC Kodi to a Samsung EVO or Sandisk Class 10 microSDHC card.

W.
(This post was last modified: 2017-07-18 21:01 by wrxtasy.)
find quote
mjbxx Offline
Fan
Posts: 583
Joined: Apr 2014
Reputation: 11
Location: NC, USA
Post: #3
(2016-09-05 20:37)fritsch Wrote:  Hi,
I revisted the Audiotrack-Sink for Android the last days and made it API conform. That means, everyone gets what the official Android API supports:
Never fully understood any of this after utilizing SPMC starting with v16.2.0 but it kinda makes sense to me now. Kodi will only support the newest Android API in regard to audio codecs in v17. If correct then that will be a big win for Kodi/Android development going forward to all that conform.
find quote
Calzor Suzay Offline
Member
Posts: 68
Joined: Jan 2015
Reputation: 2
Post: #4
Anyone know what version the FireTV 2 is on?
aka would it pass everything through? Smile
find quote
waldo22 Offline
Donor
Posts: 783
Joined: Sep 2007
Reputation: 14
Location: Chapel Hill, NC, USA
Post: #5
(2016-09-06 07:15)mjbxx Wrote:  
(2016-09-05 20:37)fritsch Wrote:  Hi,
I revisted the Audiotrack-Sink for Android the last days and made it API conform. That means, everyone gets what the official Android API supports:
Never fully understood any of this after utilizing SPMC starting with v16.2.0 but it kinda makes sense to me now. Kodi will only support the newest Android API in regard to audio codecs in v17. If correct then that will be a big win for Kodi/Android development going forward to all that conform.

Well, not necessarily the newest API, just the official API.

They won't be doing hacks to get audio to work anymore.

Basically there are too many different types of boxes to support them all if the box makers don't conform to the official specs.
find quote
mjbxx Offline
Fan
Posts: 583
Joined: Apr 2014
Reputation: 11
Location: NC, USA
Post: #6
(2016-09-06 14:07)Calzor Suzay Wrote:  Anyone know what version the FireTV 2 is on?
From Amazon:
"Fire OS 5 is our Android-based operating system that powers Fire tablets, Amazon Fire TV and Fire TV Stick. Fire OS 5 is based on Android 5.1 (Lollipop MR1) and API 22 and is more compatible with existing Android apps than ever before."
find quote
Wurtzelsepp Offline
Junior Member
Posts: 9
Joined: Feb 2013
Reputation: 0
Post: #7
I tested the Passthrough today an a up to date FireTV(FirstGen) with the 17Beta and the latest Dev version(kodi-20160905-06588de-master-armeabi-v7a).

Passthrough is not working.
I switched back to 16.1 and now it is working again on DD and DTS.
find quote
fritsch Offline
Team-Kodi Developer
Posts: 17,986
Joined: Aug 2011
Reputation: 560
Location: Stuttgart*
Post: #8
Congratulations! Old hw with old sw versions, a well known match since windows 95 :-)

DTS shall not work, cause your vendor does not support. I don't take responsibility for the ears of your children after being warned by Android staff.

For AC3: works on team's firetv as it should.

"Your most vocal users are not reflective of your userbase" J.M.
"Of course, they [XP Users and people with outdated hardware] need to tell the world about the kind of hero they are, and block innovation for everyone else because their decades old OS / hardware needs to work =p" nevcairiel (ffmpeg)
No Debug Log no issue.
find quote
Calzor Suzay Offline
Member
Posts: 68
Joined: Jan 2015
Reputation: 2
Post: #9
(2016-09-06 22:50)mjbxx Wrote:  From Amazon:
"Fire OS 5 is our Android-based operating system that powers Fire tablets, Amazon Fire TV and Fire TV Stick. Fire OS 5 is based on Android 5.1 (Lollipop MR1) and API 22 and is more compatible with existing Android apps than ever before."

SPMC it is then for now Smile
find quote
Martijn Offline
Team Kodi
Posts: 17,010
Joined: Jul 2011
Reputation: 311
Location: Dawn of time
Post: #10
(2016-09-07 11:04)Calzor Suzay Wrote:  
(2016-09-06 22:50)mjbxx Wrote:  From Amazon:
"Fire OS 5 is our Android-based operating system that powers Fire tablets, Amazon Fire TV and Fire TV Stick. Fire OS 5 is based on Android 5.1 (Lollipop MR1) and API 22 and is more compatible with existing Android apps than ever before."

SPMC it is then for now Smile

Why?
If Amazon uses API22 you can just use Kodi

Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
find quote
Calzor Suzay Offline
Member
Posts: 68
Joined: Jan 2015
Reputation: 2
Post: #11
v21, v22 API: AC3, EAC3 (broken on most firmware, please bug your vendor)
find quote
francesco_ita Offline
Junior Member
Posts: 7
Joined: Oct 2010
Reputation: 0
Post: #12
Tested Kodi 17 latest version on Beelink GT1 based on the new AMLogic S912.
Dolby AC3 passthrough works, DTS and DTS-HD no.
On Kodi 16.1 works both Dolby and DTS, but no DTS-HD.
In this way the most of the android box will became quite useless :-(
find quote
CiNcH Offline
Fan
Posts: 411
Joined: Jun 2014
Reputation: 1
Location: Austria
Post: #13
And for MediaTek based devices, not even AC3 works properly.

I would suggest to use SPMC for the time being, even though the PCM hack is dangerous. But either that or nothing...

Hopefully device related firmware/driver bugs will get fixed and there will be a fast adoption of Nougat. I have my doubts on both of these points. When I look at my Sony, bugs don't get fixed (and there are plenty with lots of obvious instabilities) and we are still on Lollipop. And there won't be a jump to Nougat. We might get Marshmallow at some point. So still no DTS. Probably in a year, if we get Nougat at all...

Sony BRAVIA 2015 (FW V3.885 / Android TV 6.0.1) | DVBViewer Media Server 2.0
(This post was last modified: 2016-09-14 09:58 by CiNcH.)
find quote
jjd-uk Offline
Team-Kodi Member
Posts: 6,256
Joined: Oct 2011
Reputation: 158
Post: #14
Sorry guys but the Team with limited manpower no longer has the will to build in workarounds for vendors not following the proper API's, we believe that while we continue to do this the vendors will continue to release buggy firmware that doesn't properly adhere to the API's. While we regret users getting caught up in the politics, with Kodi having such a big user base on Android, we think we are now in a position to flex some muscle by no longer supporting the hacks of the past, and by only sticking to the API's do think there's any hope of creating a change in attitude from the box/SoC vendors.

If users also only support boxes that do adhere to standards and boycott products which don't, then the box/Soc vendors will be further incentivise if they start getting hit where it hurts, by decreased sales and revenue. If you buy a product which doesn't support the formats it should for passthrough (see list from fritsch) then return the box clearly stating why.
find quote
fritsch Offline
Team-Kodi Developer
Posts: 17,986
Joined: Aug 2011
Reputation: 560
Location: Stuttgart*
Post: #15
(2016-09-14 09:06)francesco_ita Wrote:  Tested Kodi 17 latest version on Beelink GT1 based on the new AMLogic S912.
Dolby AC3 passthrough works, DTS and DTS-HD no.
On Kodi 16.1 works both Dolby and DTS, but no DTS-HD.
In this way the most of the android box will became quite useless :-(

AML situation is "more political" right now, sadly. As they live in the ivory tower for many years now - demanding projects to implement something AML special, which is even interfering with the official API. We still have this code, but don't build it. Cause either users should not buy from them or directly return the HW, cause that strategy is a no go.

And with AC3, you can at least use Dolby Transcoding - so multi channel works at least. I don't see 0.5 Android maintainers responsible for their failures.

"Your most vocal users are not reflective of your userbase" J.M.
"Of course, they [XP Users and people with outdated hardware] need to tell the world about the kind of hero they are, and block innovation for everyone else because their decades old OS / hardware needs to work =p" nevcairiel (ffmpeg)
No Debug Log no issue.
find quote
Post Reply