-
Notifications
You must be signed in to change notification settings - Fork 6k
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
How do detect optical cable(S/PDIF) using exoplayer? #7617
Comments
@andrewlewis Do you know if there is way to detect that? Our |
Last time I tested this I found that the HDMI audio plug intent was updated for optical connection too (that was on a Sony TV, I think). Which device are you using? If that intent doesn't help, you could try using registering an audio device callback (from API 23). #1993 is somewhat related and could be broadened to track listening for audio device changes both via the HDMI intent and the audio device callback (depending on API version) as well as allowing selection. |
I am testing this on TCL android tv (Os 9). |
@PratimMallick Please first check that the HDMI audio plug intent (which we already have a helper for) doesn't expose the required information, and, if not, give the audio device callback approach mentioned in my previous comment a try. You can build an @tonihei Regarding track selection based on channel count, the audio renderer |
If the track selection is covered by the |
@andrewlewis The HDMI audio plug intent does not give the required information in this TV when optical cable is connected. It gives correct info when HDMI ARC is connected to the Tv. Will check the second option you mentioned |
@andrewlewis The The issue here is while playing EAC3 encoded stream on Android TV when optical cable is connected, the How to solve this issue for AndroidTVs? |
Hm, that's quite surprising. Are you certain the callback is set up correctly? I guess a good way to check is to try plugging in HDMI and checking that notifies the callback. If you call |
@andrewlewis I re-checked with HDMI ARC connected. This Callback gives correct result, that is |
I've asked the audio framework team for guidance and will update here when they reply [Internal ref: b/161525145]. |
Thanks @andrewlewis . Will wait for an update here. In the meantime, I have figured out that reading the Global setting key |
The audio framework team indicated that providing an API to detect this is not feasible in general, as there is no kernel event for S/PDIF device connection and not all devices have physical detection for whether it's plugged in. Regarding |
Update: rereading your previous comment it sounds like |
Yes that's right @andrewlewis. Neither FYI: |
Is there any other way of knowing if passthrough is enabled by the user or not? Is there any other standard global key that can be checked at app level? |
There is the global setting As/when other new APIs are available for querying this we can use them but I don't think there's anything actionable left on our side for this so I will close the issue. |
To determine whether to serve dolby or stereo content, out app needs to determine whether the device(androidTv or android box) is connected to a surround sound system or not.
This is possible when the sound system connects to the device via HDMI ARC by reading the
AudioCapabilities
. But this does not help when the sound system is connected via optical cable or S/PDIF. How do we detect if the output supports surround sound (Dolby or DTS) when connected via optical cableThe text was updated successfully, but these errors were encountered: