nova-video-player / aos-AVP

NOVA opeN sOurce Video plAyer: main repository to build them all
Apache License 2.0
3.14k stars 188 forks source link

Audio Pass-trough Mode 2 causes erratic playback speed in some videos #40

Open lucianolingnau opened 5 years ago

lucianolingnau commented 5 years ago

I was trying to find the source of this issue for a long time and finally tested it out until I found the culprit: When using audio Pass-trough Mode 2 the playback speed of some videos is very fast (and there is no sound. But even if it was it wouldn't be watchable, because the playback is seriously fast).

The file I played was an MKV with the following properties:

Video: MPEG4 Video (H264) 1280x528 23.976fps [V: h264 high L4.1, yuv420p, 1280x528 [default]]
Audio: DTS 48000Hz 6ch 1536kbps [A: English [eng] (dts, 48000 Hz, 5.1, 1536 kb/s) [default]]
Subtitle: UTF-8 [S: English [eng] (subrip) [default]]
Subtitle: UTF-8 [S: Romanian [rum] (subrip)]
Subtitle: UTF-8 [S: No subtitles]

By switching to Audio passtrough mode to 1 or disabled the issue is resolved. The downsides are, that mode 1 doesn't work for many files/formats (results in high-pitched and distorted sound) and disabled of course disables the pass-trough completely.

This was tested/reproduced on an Nvidia Shield running on the Shield Software level 7.2.1 (Based on Android 8.0). This happened while using the latest version of the Nova Player.

Needless to say, I'd be very happy to use Mode 2 without this issue. I'd be happy to provide any information/details necessary to get this fix.

courville commented 5 years ago

Should be fixed by latest beta: https://www.reddit.com/r/NovaVideoPlayer/comments/albjko/new_beta_release_of_nova_video_player/

lucianolingnau commented 5 years ago

Hi @courville - I just managed to update the app to beta (Version is 1.0-20190130.1101) but I've confirmed the issue persists. :( Any other ideas? How could I help troubleshoot/investigate?

courville commented 5 years ago

I have detailed a bit passthrough here: https://www.reddit.com/r/NovaVideoPlayer/comments/aif64n/audio_passthrough_mode_1_and_2_what_is_the/

Are you using ARC? What kind of connectivity and 5.1 equipment is used?

If you could share privately your or part of your sample, I could try to reproduce.

courville commented 5 years ago

OK reproduced some issues with specific files.

lucianolingnau commented 5 years ago

Hi @courville and thank you for the swift reply. Yes, I'm using ARC. Is that a problem? I don't believe my setup supports eARC.

The setup is basically an nVidia Shield hooked to a TX-55FZW804 via HDMI, which in turn is also hooked via HDMI to a HEOS BAR. I should be able to plug the Shield directly into an input of the HEOS BAR, if you think this could make any sort of difference.

Codec-wise, the HEOS Bar (my "receiver") should support everything there is to support at the moment:

You've mentioned you were able to reproduce the issue in your later reply. If you still need the file to reproduce the issue let me know and I'll find a way to share it. :)

Cheers and thank you for the help so far!

hpn789 commented 5 years ago

Hi @courville, I also have some issues as @lucianolingnau playing video soundtrack in

courville commented 5 years ago

Cf. https://www.reddit.com/r/NovaVideoPlayer/comments/azqow3/new_beta_release_of_nova_video_player_v33/ on a Mecool KM8 certified by Google with Android TV 8.0.0:

I was testing the Mode 2 audio option with different audio codecs, my device has two important audio modes: one mode is the "Auto" mode and the other one is a mode called "Always", I'll explain to you what they do:

I made the test with both options along with "Disable" and "Mode 2" of NOVA so here is the result. By the way, my TV doesn't have Dolby/DTS decoding by HDMI so I didn't get audio from the speakers on some videos, however, it's was useful to make this test this way to verify how NOVA behaves:

  AUTO + DISABLE ALWAYS + DISABLE AUTO + MODE 2 ALWAYS + MODE 2
Dolby Digital Video plays in normal speed with downmixed audio to stereo Video plays in normal speed but audio is not downmixed to stereo, I only heard the discrete left and discrete right channels on the TV Video plays in normal speed without audio output Video plays in normal speed without audio output
Dolby Digital Plus Video plays in normal speed with downmixed audio to stereo Video plays in normal speed but audio is not downmixed to stereo, I only heard the discrete left and discrete right channels on the TV Video plays fast without audio output Video plays in normal speed without audio output
Dolby TrueHD Video plays in normal speed with downmixed audio to stereo Video plays in normal speed but audio is not downmixed to stereo, I only heard the discrete left and discrete right channels on the TV Video plays fast without audio output Video plays fast without audio output
DTS Video plays in normal speed with downmixed audio to stereo Video plays in normal speed but audio is not downmixed to stereo, I only heard the discrete left and discrete right channels on the TV Video plays fast without audio output Video plays in normal speed without audio output
DTS-HD Master Audio Video plays in normal speed with downmixed audio to stereo Video plays in normal speed but audio is not downmixed to stereo, I only heard the discrete left and discrete right channels on the TV Video plays fast without audio output Video plays fast without audio output
AAC 2.0 Video plays in normal speed with stereo audio output Video plays in normal speed with stereo audio output Video plays in normal speed with stereo audio output Video plays in normal speed with stereo audio output
AAC 5.1 Video plays in normal speed with downmixed audio to stereo Video plays in normal speed but audio is not downmixed to stereo, I only heard the discrete left and discrete right channels on the TV Video playback starts after 6 seconds with audio out of sync Video playback starts after 6 seconds with audio out of sync and it's not downmixed to stereo, I only heard the discrete left and discrete right channels
courville commented 5 years ago

Reply to the previous post on reddit: Your table is indeed interesting.

Note that if your TV is behind a receiver the EDID reported should be the concatenation between the TV and receiver capabilities.

On your ALWAYS+DISABLE results it seems that your TV does not support 6 channels PCM and thus the TV processes only 2 channels resulting in the nok behavior since you are forcing it on the TV despite capabilities reporting (it is working in AUTO mode).

The AUTO+MODE2 result shows that we are forcing modes not supported by the TV. This is mainly due to the fact that audio device capabilities are not available on targeted API21 that we are using.

One evolution to mitigate this problem would be to use when the device supports it, API23+ methods of AudioDeviceInfo https://developer.android.com/reference/android/media/AudioDeviceInfo.html

With this framework of explanation in mind I seem to understand all the results presented and why the two last column are identical.

For now (just like VLC did) AUTO+DISABLE should be used by most for best result until further development is carried out.

courville commented 5 years ago

Please have a look at https://github.com/nova-video-player/aos-AVP/releases/tag/v3.11 to (released also on Google Play beta). This perhaps will help in fixing the issue experienced.

lucianolingnau commented 5 years ago

Hello @courville - Many thanks for the update. I'm already taking part in the beta program. I've updated last night and unfortunately, the issue persists even in the latest available beta. :(

I've sent you an E-mail with the link from which you can get the file that I'm using for testing. I hope it helps! Otherwise, please let me know if you want me to test anything else, I'd be more than happy to help.

Cheers!

courville commented 5 years ago

@lucianolingnau thx for the feedback and sharing the link. Will do more testing. For now unfortunately, I recommend to not use passthrough (multichannel support is still there).

lucianolingnau commented 5 years ago

@courville - no worries. I have it disabled at the moment, only re-enabled it yesterday to test the new beta version. Take your time!

lucianolingnau commented 4 years ago

@courville Hi Marc. Just a heads-up: In the beta from 3 days ago (1.0-20190822.2355) (Nova Video Player (v4.10) ) I can report that the playback speed is no no longer an issue. And regular DTS stuff actually plays "okay-ish" (I've tried three different titles). But the video and audio don't seem to be in sync which makes things unpleasant to watch. And also a minor thing I've noticed: There are some weird noises during fast forward).

Figured I should provide since I'm trying out the beta. :)

Cheers!

courville commented 4 years ago

@courville Hi Marc. Just a heads-up: In the beta from 3 days ago (1.0-20190822.2355) (Nova Video Player (v4.10) ) I can report that the playback speed is no no longer an issue. And regular DTS stuff actually plays "okay-ish" (I've tried three different titles). But the video and audio don't seem to be in sync which makes things unpleasant to watch.

Please try the v4.13 with passthrough disabled (this is your case), since we switched from openSLES to AudioTrack this should help with A/V delay (at least it does on some devices that were experiencing issues).

lucianolingnau commented 4 years ago

@courville - Hi Marc! Sorry if it wasn't clear in my previous comment, but whenever Pass-trough is disabled, everything is in sync, no problems at all. The issue I experienced was only while Pass-trough was enabled (I tried Mode 2)

But I did some more testing in the "current" beta version (09.09.2019) and I've noticed the following:

Since the majority of the things I have is AC3 or Dolby AC3, this is quite an improvement and I can watch most stuff with Pass-trough (Mode 2) enabled again. :)

Maybe someone else could share their findings with the latest version as well.

courville commented 4 years ago

Thx for the detailed feedback. What I do not understand is that if DTS is processed via passthrough this is your external AV device that handles decoding and volume (not NVP). The only explanation I would have is that somehow we revert to SWdec on DTS in your particular case but I guess that you would have noticed. Strange

svemonix commented 3 years ago

I do have the same behavior with DTS audio and passthrough on my Android TV box connected directly to my AV. According to the UI, it is using hardware decoding.

Disabling passthrough is not an option as it results in Stereo only output encapsulated in Dolby Digital Plus (EAC3). This is because my device like many others can't output multi-channel PCM but only stereo PCM, AC3, EAC3, DTS and DTS-HD.

It would be great if this bug could be fixed. Playing the same in VLC results in the right playback speed but a significant Audio/video sync issue.

kubycek commented 9 months ago

Hi, any news with mode 2 issue? It's very old issue and still not solved. I'm experiencing broken AV sync with not recognized 5.1 sound but without mode 2 I can't playback dolby or dts sound. This type of sound plays correctly.

Thanks Jakub