koying / SPMC

fork of xbmc/kodi
Other
632 stars 257 forks source link

No sound through headphones connected to controller #317

Open eliu001 opened 8 years ago

eliu001 commented 8 years ago

Recently set up my Nvidia Shield with SPMC. Everything seems to be working except for sound over headphones plugged into a controller. System sounds, YouTube, and sounds over GameStream switch between headphones and AVR when the headphones are connected/disconnected, but when I play a movie using SPMC, either there's no sound (start the movie with headphones connected, and remains silent even after disconnecting headphones), or the sound doesn't switch to the headphones (connect headphones after starting the movie). Because I do get sound over headphones under all other use cases, it makes me think it's an SPMC issue. Sorry I can't provide any of the SPMC settings since I don't have access to the Shield at the moment, but I've tried changing settings between PCM, IEC passthrough, and RAW passthrough, and switching output from 5.1 to 2.0, among other things I can't recall.

Sound through headphones works with the native video player, MX Player, and VLC.

Thanks in advance!

classicjazz commented 8 years ago

I see the issue in the following way:

If audio passthrough is enabled per the Wiki and you play, for example, a DTS-MA track, then you cannot hear any audio on the Shield WiFi Direct controller.

Manually disabling audio passthrough (so SPMC decodes to PCM) permits audio to be heard on headphones connected to the headphone jack of the Shield controller.

From a ease of use perspective., SPMC should automatically disable audio-passthrough when headphones are connected to the Shield controller. That assumes that there is an API that provides SPMC with a headphones connected state.

eliu001 commented 8 years ago

Thanks for the suggestions, classicjazz. I'll play around with the settings and see what happens.

eliu001 commented 8 years ago

classicjazz - it was exactly as you described. Once passthrough was disabled, sound played through the controller-attached headphones. The setting for "Audio output device" does not matter.

To the devs - Is this behavior as-designed?

Thanks again!

classicjazz commented 8 years ago

This is still an issue with 16.4, even though it includes "FIX: [shield] properly handle wifi direct headset"

Passthrough audio is enabled as described in the Wiki.

What I see when I plug headphones into the WiFi Direct controller is a message to switch my audio settings to stereo.

What I immediately hear (without changing any audio settings) is a loud, rapid fire chirping. If the video is playing when I plug the headphones in, then the chirping is heard on the stereo speakers. If the video is paused and then I plug in the headphones and resume playback, then the chirping is heard on the head set.

koying commented 8 years ago

Yeah, it's a shield thing. It does exactly the same in, e.g., Plex, so I guess there is no actual solution, besides deactivating passthrough. At least starting a video with the headphones in should work, now, iirc.

classicjazz commented 8 years ago

You are right. If you plug the headphones in and then press play (i.e. the video wasn't playing or paused when the headphones were plugged in), then it works as expected... switching the audio between the headphones and speakers. You can keep plugging/unplugging the headphones without hear the loud rapid chirping.

Looking at my AVR, the reason for this is that when the movie is started with the headphones on, the audio is PCM and remains that way even with the headphones unplugged until the movie is stopped and restarted.

Restarting the video without the headphones plugged in resumes the passthrough of the bitstream.

If a movie is playing or paused when the headphones are plugged in and audio is in passthrough, can you force it to switch to PCM (even if you have the pause the movie)? As a fallback, could you stop the video? This will avoid the loud chirping. The fact that it stays in PCM until stopped and restarted or that the user must manually restart playback is a minor price to pay.