Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
speechles
Roku Guru

Why does headphones plugged in/out not trigger getInfo().audioCodecCapabilityChanged?

Basically 9.1 introduced the ability to detect audio or video codec capabilities changes when EnableCodecCapChangedEvent(true) is set to true.

 

Setting this in the main while(true) loop and looking for the event:

if msgType = "roDeviceInfoEvent" and msg.isStatusMessage()
scene.audioChanged = msg.getInfo().audioCodecCapabilityChanged

 

Now this forwards to the scene where it can forward on but that part isn't relevant. It is not even getting this far when running the code. It seems when you unplug or plug in headphones it does not trigger the CodecCapChangedEvent and this in turn makes it so you cannot immediately detect when headphones are plugged in so you can check audioDecodeInfo() again for correct capabilities.

 

It seems if you QUERY/DEVICE-INFO you can see if the headphones are used or not.

 

<supports-private-listening>false</supports-private-listening>

<headphones-connected>false</headphones-connected>

 

But you have to POLL to know this? 

 

Is there no way to immediately tell when someone plugs the headphones into their remote? The reason I ask is DOLBY cannot decode this way. The AudioDecodeInfo() changes when you plug in headphones to show no support for DTS or DOLBY. 

 

This change in AudioDecodeInfo() should cause the audioCodecCapabilityChanged to throw true which in turn should throw the accompanying roDeviceInfoEvent along with isStatusMessage=true.

 

Why isn't it doing this? I am using firmware 9.1 and this does NOT work.

 

Can someone explain how this works or how you detect the moment someone has plugged in or removed the headphones from the remote?

 

Thanks. 🙂

 

 

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.