Kodi Community Forum
OS X "adjust display refresh rate" causes stuttering. - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Mac OS X (https://forum.kodi.tv/forumdisplay.php?fid=56)
+---- Thread: OS X "adjust display refresh rate" causes stuttering. (/showthread.php?tid=159849)

Pages: 1 2


"adjust display refresh rate" causes stuttering. - trasz - 2013-03-20

Under 12.0 and 12.1, running under 10.8.2 and 10.8.3 on Mac Mini 2012 connected via HDMI to receiver and TV, enabling the "adjust display refresh rate to match video" option causes video stuttering and no audio. What happens is, after the playback starts, the output rate gets changed correctly (as reported by my TV), then for about a second playback is ok (although without sound), and after that the framerate drops to about 1fps.

Any idea what might be wrong, or how I can help to debug this? Thanks!


RE: "adjust display refresh rate" causes stuttering. - Memphiz - 2013-03-20

Known issue - not able to be fixed yet (and i tried alot).


RE: "adjust display refresh rate" causes stuttering. - trasz - 2013-03-20

Do you have the problem analysed, or is it that the cause is unknown?


RE: "adjust display refresh rate" causes stuttering. - Memphiz - 2013-03-20

Analysed as far as i could. Apple does something to the audio device while switching refreshrate without notifying us - so i don't have a clue in which state the audio stuff is and where the problem really is. All recovery calls after display is back on didn't work out.

This btw doesn't happen on my hackintosh (10.8.2) - there is no such problem after refreshrate switching (same setup as on the macmini by using hdmi).


RE: "adjust display refresh rate" causes stuttering. - User 34959 - 2013-03-20

With my equipment i have to set it to pause for 0.1 seconds when changing the refresh rate, otherwise passthrough audio will not initialize correctly and it will fail every single time.


RE: "adjust display refresh rate" causes stuttering. - mfrelink - 2013-03-20

Thanks toiva! That seems to fix it for a lot of movies I tried.
I really hope you will be able to find a fix someday Memphiz Smile


RE: "adjust display refresh rate" causes stuttering. - trasz - 2013-03-20

(2013-03-20, 19:26)Memphiz Wrote: Analysed as far as i could. Apple does something to the audio device while switching refreshrate without notifying us - so i don't have a clue in which state the audio stuff is and where the problem really is. All recovery calls after display is back on didn't work out.

This btw doesn't happen on my hackintosh (10.8.2) - there is no such problem after refreshrate switching (same setup as on the macmini by using hdmi).

So the root of the problem is the audio. Why does the video stutter - is it because it's synchronised to the audio? Could you perhaps tell me which part of code handles the audio during output rate change?


"adjust display refresh rate" causes stuttering. - Memphiz - 2013-03-21

yeah video stutters because the player has nothing to stuff the audio data in because audio device doesn't consume the data but gets filled up.

https://github.com/xbmc/xbmc/blob/master/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAE.cpp

on my hackintosh the audio device vanishes during refreshrate switching and comes back after. That callback on the top of the file gets called there and reinits the audio device.

However this callback is not called on the macmini (maybe the audio device doesn't vanish there but it gets altered in a way where it doesn't work nice anymore).

I tried to fix it by utilising another callback from the windowing system (which gets called when the display vanishs during refreshrate change) - but this didn't work out.

For this see my branch here:

https://github.com/Memphiz/xbmc/commit/4ace19727ddd5cf755a4940ca82692bdd66abad4

Would be great if you could have a look (though most of the time i point other devs to our code i hear nothing back - might be demotivating to do so...).


RE: "adjust display refresh rate" causes stuttering. - FriendlyG - 2013-03-21

Do you think this could also cause digital noise in some files some of the time?
I have been struggling with occasional digital noise (as in completely undecoded screeching noise) on files that normally work fine on my mac mini.
It seems like sometimes during the course of using XBMC (loading, playing, pausing, exiting, loading another movie, playing, fast forwarding, pausing etc etc) it will either give an unable to initialize audio device error - or I won't get an error, but will get the digital noise horror, which seems to sometimes be fixed by going to settings and changing the audio out from built-in output to something else, then back again.


RE: "adjust display refresh rate" causes stuttering. - seven5 - 2013-03-21

The delay trick has been hit or miss for me. I've been able to get it to work at 0.1s but it's also failed. Same goes for all the way up to 1.5. It's just inconsistent and unreliable. It seems to be worse when resuming video.

It's a real bummer to because the 24hz feature is one of my favorite features. It makes a big difference.

You can also change the audio track (I have it mapped to a button on my remote) and it seems to reinit audio, because everything works after you do it. But this is a terrible way to resolve it.

So are people really using this feature consistently? Is my receiver just a little slow?

I really hope it can get stable one day. Though the reason it isn't now, sounds tough.


RE: "adjust display refresh rate" causes stuttering. - trasz - 2013-03-21

The workaround with changing outputs works - start playback, wait for stuttering, bring up OSD, click on the 'sound', change output from HDMI to digital and back to HDMI, et voila - it works properly. Thanks, seven5!

Memphiz, what exactly didn't work? The callback wouldn't get run, or it did run, but calling AudioDevicesChanged() didn't have the expected effect? If the latter, perhaps you could try to emulate what happens when user switches audio outputs?


RE: "adjust display refresh rate" causes stuttering. - Memphiz - 2013-03-21

One of both callback is called - effect was missing. And if i'm not completly stupid (which really might be the case) it is already doing what the output switch does (re-initing the hw).


RE: "adjust display refresh rate" causes stuttering. - MrMario64 - 2013-03-24

sidenote to Memphiz, just for your information, the stuttering you get with this issue looks exactly the same in the other stutter bug after 46/62 minutes.
Exactly the same result, only difference is that it occurs after a period of time.


RE: "adjust display refresh rate" causes stuttering. - r_deckard - 2013-03-30

It doesn't help you, but I can confirm this issue too.

I'm just testing XBMC 12.1 on a 10.8.3 Mac mini (2012) with no other software or plugins installed.

With "adjust display refresh rate" enabled, the video (only MKV tested) starts with 1fps. I'm using HDMI with AC3/DTS passthrough.

With disabling this option and setting the correct refresh rate in OS X display settings, the video is playing fine. (Only played TV-shows around 45 mins so far)
Sometimes (at least one time per episode, random position) I got a freeze for about 1 to a couple seconds, but the video resumes automatically (correctly). I guess, this is not XBMC related (movie files are coming from a W2K8 server with only 100mbit LAN to the Mac mini. So, this could be a network issue.)

Is there any way to manually switch the refresh rate from inside XBMC? There are some applescripts, which are properly doing the switch (e.g. with cscreen tool). But I don't know how to integrate such a script in XBMC, so we could start it there with a customized command. (I'm mostly controlling XBMC with a remote app on my iPad)


RE: "adjust display refresh rate" causes stuttering. - Ayla - 2013-06-23

Apple changed something in relation to connecting/disconnecting a new display in 10.9 Mavericks, so I was hoping that this 'bug' would be fixed - sadly it's not Sad