OS X "adjust display refresh rate" causes stuttering.
#1
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!
Reply
#2
Known issue - not able to be fixed yet (and i tried alot).
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#3
Do you have the problem analysed, or is it that the cause is unknown?
Reply
#4
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).
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#5
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.
Reply
#6
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
Reply
#7
(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?
Reply
#8
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...udioAE.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/4...bdd66abad4

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...).
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#9
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.
Reply
#10
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.
Reply
#11
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?
Reply
#12
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).
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#13
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.
Reply
#14
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)
Reply
#15
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
Reply

Logout Mark Read Team Forum Stats Members Help
"adjust display refresh rate" causes stuttering.0