Jump to content

audio sync at 24fps


lifespeed

Recommended Posts

lifespeed

The audio is ahead of the video by a couple seconds when playing 24fps content at a matched refresh rate.  It is bad enough as to make Emby unusable for watching anything at this frame rate.  Interpolation is not turned on, it did not appear to be a smooth substitute for the proper refresh rate anyway.

 

I have checked this playing audio out an analog sound card, ASUS D2X, as well as digitally over HDMI to the TV.  Completely different hardware and drivers, same problem with audio leading the video.  MPC-BE, VLC and WMP all sync the audio to video just fine.

 

Surely I am not the only one experiencing this problem, please look into it and let me know if there is any info I can provide.  Logs attached.

 

Edit:  turned off video display syncing for a small improvement in audio sync, but it is still off at 24fps, while 60fps syncs perfectly.

theater-63632648115.txt

ffmpeg-directstream-c7af8cf4-58a1-44d6-810a-473f1150cd86.txt

server-63632637797.txt

Edited by lifespeed
Link to comment
Share on other sites

lifespeed

What other video settings have you configured?

Turned on CUDA acceleration and OpenGL.  Haven't found a combination that helps the audio sync yet.  Screenshots attached.

 

Edit:  turned off everything I could think of; hardware acceleration, de-interlacing and OpenGL.  Audio is still out of sync when the frame rate is manually set to 24fps.

post-44858-0-57194100-1497162224_thumb.png

post-44858-0-00463100-1497162231_thumb.png

post-44858-0-96713700-1497162236_thumb.png

Edited by lifespeed
Link to comment
Share on other sites

lifespeed

I set all the video configurations to "auto", audio still leads the video by a half second.  Both of my PCs behave this way.  MadVR always had sync problems on the older versions of Emby, actually worse than MPV player.

Link to comment
Share on other sites

lifespeed

So are you saying you just need an audio delay setting?

I suppose that would be one way of addressing the problem.  To be honest, I think MPV player should keep the audio in sync at common frame rates like 24fps and 60fps without user intervention into adjustable audio delays.  All my other media players like WMP, MPC-BE and VLC (the first two use directshow codecs, the third is self-contained) manage to do this without the need for me to set an adjustable audio delay.

Link to comment
Share on other sites

Jdiesel

I suppose that would be one way of addressing the problem.  To be honest, I think MPV player should keep the audio in sync at common frame rates like 24fps and 60fps without user intervention into adjustable audio delays.  All my other media players like WMP, MPC-BE and VLC (the first two use directshow codecs, the third is self-contained) manage to do this without the need for me to set an adjustable audio delay.

The problem is that it can be, and often is, hardware related. Displays often add processing to 24hz modes that causing lipsync issues. This is compounded by audio processing (bitstreaming versus decoding versus resampling). All you have to do is Google "24hz lipsync" to find thousands of results dating back to the early 2000's about this issue. The problem is that is very hard to reproduce and will most will not experience or notice this phenomenon, the ones that do are driven mad by it. To make matters worse the issue tends to only exist at 24hz and not 50 or 60hz meaning that setting a global delay is problematic. If delay settings are added it MUST be done on a per refresh rate basis. This is what Plex Media Player does and can be done in Kodi too. Kodi actually has a -175ms delay hard coded in for 24hz referesh rates.

 

I struggled with this issue for years on my Panasonic Plasma but do not experience it at all since moving to a Samsung Plasma TV.  

Edited by Jdiesel
Link to comment
Share on other sites

lifespeed

The problem is that it can be, and often is, hardware related.

 

While I don't deny that specific TV interpolation algorithms can cause audio sync problems, I have to point out that I have two separate TVs and HTPCs that I have checked for this issue (three if you count one setup that uses an analog soundcard, but can also send digital sound over HDMI to the TV).  They all have the same audio sync problem using Emby at 24fps.  Additionally, all of these systems exhibit perfect audio sync with the three different media players previously mentioned.

 

In this case there can be no doubt this is solely an Emby issue.

Link to comment
Share on other sites

Jdiesel

While I don't deny that specific TV interpolation algorithms can cause audio sync problems, I have to point out that I have two separate TVs and HTPCs that I have checked for this issue (three if you count one setup that uses an analog soundcard, but can also send digital sound over HDMI to the TV).  They all have the same audio sync problem using Emby at 24fps.  Additionally, all of these systems exhibit perfect audio sync with the three different media players previously mentioned.

 

In this case there can be no doubt this is solely an Emby issue.

Absolutely. Have your tried using standalone MPV to see if the sync issue is present? Sync issues with MPV was one of the reasons I stopped testing PMP back when I was using Plex. 

Link to comment
Share on other sites

lifespeed

The version of MPV dated 6/11 from this link has audio sync issues the same as Emby.  I checked the other players more carefully, and only WMP plays without audio leading the video.  MPC-BE and VLC both have audio sync problems similar to MPV.

 

Really too bad the folks developing MPV aren't getting this right.  There is nothing more annoying than out-of-sync media.

Edited by lifespeed
Link to comment
Share on other sites

puithove

This is something that Kodi battled for a long time.  They ended up adding a default 125ms audio delay for 24/25 hz modes and 0ms for 50/60 hz because that was where they found a reasonable average across hardware.  They also included the ability to adjust the delay independently for the various modes.

 

@@Luke, this would probably be a good idea to add to ET.

Link to comment
Share on other sites

lifespeed

This is something that Kodi battled for a long time.  They ended up adding a default 125ms audio delay for 24/25 hz modes and 0ms for 50/60 hz because that was where they found a reasonable average across hardware.  They also included the ability to adjust the delay independently for the various modes.

 

@@Luke, this would probably be a good idea to add to ET.

 

That may be the only realistic way to address this issue.  I did not see variation across my different hardware, the sync time error was about the same regardless of which hardware I was using.  Now that Emby relies on an external software player, there may be little the developers can do outside of supported parameters passed to the player.

 

Hopefully audio delay is one of these, and it can be set by refresh rate.

 

Thanks for checking into this, I'll be interested to hear about any betas testing this feature.

Link to comment
Share on other sites

lifespeed

I struggled with this issue for years on my Panasonic Plasma but do not experience it at all since moving to a Samsung Plasma TV.  

 

Have you tried Emby 2.7.9 (uses MPV) at 24fps?  The error is small, much less than a second.  But can be noticed during the right scenes where audio alignment is obvious.  Closing a car door is one example, but there are others.

Link to comment
Share on other sites

Jdiesel

Back when I was battling this issue I ended up deciding that a fixed refreshrate of 60hz with madVR's Smoothmotion enabled (and a global delay on your AVR if needed) was the best compromise when it came to sync issues. Sure the video wasn't as smooth as 23.97/24hz but not having to deal with sync issues and display switching outweighed the benefits of 24p and overall motion was still quite good. I'm not sure how MPV's interpolation compares to smoothmotion but it might be a viable option. IMO the only player that gets all this stuff (correct and reliable refreshrate switching and proper audio sync) right is Kodi running LibreELEC on either a Intel GPU or a Amlogic s905 SOC. If you don't need to bitstream your audio resampling and enabling "sync to display" yields even better results yet.

Edited by Jdiesel
Link to comment
Share on other sites

Jdiesel

Have you tried Emby 2.7.9 (uses MPV) at 24fps?  The error is small, much less than a second.  But can be noticed during the right scenes where audio alignment is obvious.  Closing a car door is one example, but there are others.

 

I haven't been using the "new" ET and still have 2.5.40 installed. Well actually I haven't been using that either and have switched back to Kodi full time now.

Link to comment
Share on other sites

lifespeed

Back when I was battling this issue I ended up deciding that a fixed refreshrate of 60hz with madVR's Smoothmotion enabled (and a global delay on your AVR if needed) was the best compromise when it came to sync issues. Sure the video wasn't as smooth as 23.97/24hz but not having to deal with sync issues and display switching outweighed the benefits of 24p and overall motion was still quite good. I'm not sure how MPV's interpolation compares to smoothmotion but it might be a viable option. IMO the only player that gets all this stuff (correct and reliable refreshrate switching and proper audio sync) right is Kodi running LibreELEC on either a Intel GPU or a Amlogic s905 SOC. If you don't need to bitstream your audio resampling and enabling "sync to display" yields even better results yet.

 

Sounds like you haven't tried it.  MPV interpolation from 24 to 60fps looks pretty bad compared to 24fps direct to the TV, which interpolates to 120Hz.  I don't bitstream audio, I use analog direct to amplifiers.  I'm not sure how your comment applies to my use case, however.

 

I hope the developers can get a handle on this.  I am no longer using Emby to watch any 24fps content, Windows Media Player does a better job even with the added hassle of manual frame rate switching.

Link to comment
Share on other sites

lifespeed

I haven't been using the "new" ET and still have 2.5.40 installed. Well actually I haven't been using that either and have switched back to Kodi full time now.

I'll give the dev's a chance to address this first, but long term something will have to change.  2.5.40 was pretty good, although I couldn't use MadVR with 24fps either due to audio sync issues.  At least the EVR renderer got audio sync correct and automatically switched frame rates.

Link to comment
Share on other sites

lifespeed

I hope this is something that gets addressed.  I am done using the newer versions of Emby MPV, 24fps content is too big a part of media to put up with the borked playback.

Link to comment
Share on other sites

This is something that Kodi battled for a long time.  They ended up adding a default 125ms audio delay for 24/25 hz modes and 0ms for 50/60 hz because that was where they found a reasonable average across hardware.  They also included the ability to adjust the delay independently for the various modes.

 

@@Luke, this would probably be a good idea to add to ET.

 

@@puithove, so it's based purely on the display mode and not on the content?

Link to comment
Share on other sites

Jdiesel

Here is a link to one of the many threads on trying to pinpoint the issues. I don't know if a concensus has even been met but most with the issue need an audio delay of 175ms when using a 24hz refresh rate. It is most likely hardware related (image processing, AVR in the signal chain, edid or timing issues, vsync, or frame processing time on the player end). Not sure if there is an easy answer to this question.

 

https://forum.kodi.tv/showthread.php?tid=80247&page=21

 

I suspect this is a MPV issue and not a ET issues possibly one of the reasons refresh rate switching is only offered through a script and not in the core program.

Edited by Jdiesel
Link to comment
Share on other sites

puithove

@@puithove, so it's based purely on the display mode and not on the content?

 

Yes, correct. Kodi has the option to switch the display mode refresh rate to match the fps of the content.  So then it's based on the display mode (as apparently the AVR and TV processing of the "film" modes (23,24,25 Hz) causes a delay in video display.  So it adds a delay to the audio when the display refresh rate is one of those modes (whether Kodi has switched to it, or was in that mode initially) to make the audio more in sync.

Link to comment
Share on other sites

lifespeed

It sounds like auto frame switching includes awareness of the frame rate by Emby.  This would be used to apply (or not) an adjustable audio delay set with an appropriate default for 24fps content.  It appears as though the default delay for 60fps content would best be left at zero, at least that has been my observation.  I don't know where the audio delay is applied, is it a parameter passed to the MPV player?

 

These two features together would probably restore Emby Theater's lost functionality with respect to 24fps content.  I hope this is feasible.

Edited by lifespeed
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...