-
-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pcm multichannel audio for Tvs #3422
base: master
Are you sure you want to change the base?
Fix pcm multichannel audio for Tvs #3422
Conversation
@@ -862,6 +863,16 @@ | |||
return currIndex; | |||
} | |||
|
|||
public Integer getNumberOfChannels() { |
Check notice
Code scanning / Android Lint
Unknown nullness Note
6596201
to
bb76c2d
Compare
bb76c2d
to
b11e3b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not introduce new behavior that relies on the manufacturer/model of the device. Use feature testing instead.
New tests were added based on features. |
!packageManager.hasSystemFeature("android.hardware.camera") and | ||
!packageManager.hasSystemFeature("android.hardware.location.gps") and | ||
!packageManager.hasSystemFeature("android.hardware.screen.portrait") | ||
} |
Check warning
Code scanning / detekt
Checks whether files end with a line separator. Warning
If you want to know whether an audio codec is supported or not you should not test for various system features but for that specific audio codec. |
Testing the audio codec will not work for this issue. The issue is not the lack of codec support from the TV, it’s the fact that TV apps are not allowed to output multichannel PCM, which is what Jellyfin sends for Non-DD (+)/DTS media. If the app is running directly from the TV, testing for Non-DD (+)/DTS codecs would come back as true if supported, but if the media is multichannel then only stereo audio will be played b/c of these limitations. TVs can passthrough multichannel PCM from external devices plugged in via HDMI. So this is not an issue for any connected devices, e.g., Shields, Fire TVs, Chromecast, etc. There are only two ways to solve this. Either detect if an app running from a TV and transcode multichannel PCM formats to DD, which this does. Or give users the option to bypass manually. Because automatic codec detection will not work for this issue. |
|
Maybe it would make more sense to just have a setting in the menu, something like a toggle to turn on transcoding of all surround (that's not already DD, DD+, or DTS) into Dolby or DTS. That'll fix AAC, OGG, TrueHD and DTS-HD MA all at once on the devices in question. People who don't bother to turn on the setting are probably the same people who wouldn't notice/care about the issue, right? |
I actually agree and that's how it's done in Emby, just a setting to transcode all unsupported to DD which works really well |
Same in Kodi, there is a toggle to transcode all unsupported audio to AC3. Works like charm. |
Changes
Android apps running on Smart TVs are limited to PCM 2.0 Audio, while DD(+) and DTS have full support. This causes multichannel formats such as AAC and Opus to output stereo audio when playing directly from a TV to a receiver. This change identifies what is a TV based on feature testing and will transcode non-DD (+)/DTS multichannel audio if the app is running on a TV.
Also, add a condition for enabling/disabling DTS. The bitstreaming option in the preference menu isn't tied to any action.
Issues
Fixes #2991 #3294 #3152 #520