Auto refresh rate kicks in late and prevents smooth Live TV playback
#1
Scenario:
When switching Live TV channels XBMC tries to set the best display refresh rate if option "adjust display refresh rate to match video" is enabled. I already set the mode "1980x1080@50p" as initial X11 default (System info in XBMC confirms this). However, switching to a ASTRA/HOTBIRD satellite channel forces XBMC to do something about 5 seconds after the channel switch. The display goes blank for a couple of milliseconds and sometimes video playback is not smooth afterwards. This behavior does not occur when option "adjust display refresh rate to match video" is disabled.

My questions:
- Why is XBMC trying to change the refresh rate? It's already set to "1920x1080@50p", which is the best setting for viewing satellite TV in my region (PAL).
- Is there any chance to configure XBMC to alsways use "1920x1080@50p" for Live TV?
- I played around with different settings and encountered another strange behavior: When "1920x1080@60p" is set as default, XBMC switches perfectly to "1920x1080@50p" when switching to a Live TV channel. The only thing is it takes about 5 seconds after a channel switch until XBMC decides to switch to "1920x1080@50p" which isn't really acceptable to me.
- Any other tips?

Additional Information:
- Hardware: Mac Mini with 2.4GHz, NVidia 320M graphic card
- XBMC 2:11.0-pvr+pulse8~git20120911.db0474f-0ubuntu1~build99~precise
- Tvheadend 2.99.53.4502158
- Technisat SkyStar HD2 USB Tuner
- X11 Configuration:

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 295.40 ([email protected]) Thu Apr 5 22:40:54 PDT 2012

Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
HorizSync 28.0 - 33.0
VertRefresh 43.0 - 72.0
Option "DPMS"
Option "ExactModeTimingsDVI" "TRUE"
ModeLine "1920x1080@50p" 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
ModeLine "1920x1080@60p" 148.35 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
ModeLine "1920x1080@24p" 74.16 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
Option "DynamicTwinView" "0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080@50p" "1920x1080@60p" "1920x1080@24p"
EndSubSection
EndSection

Reply
#2
Quote:Why is XBMC trying to change the refresh rate? It's already set to "1920x1080@50p", which is the best setting for viewing satellite TV in my region (PAL).

It you run the GUI at 50Hz, XBMC won't switch refresh rate if you select a channel unless something is wrong with you config. Which is most likely the case. Your xorg.con is missing e.g. Option "FlatPanelProperties" "Scaling = Native".

Devug logs are always welcome otherwise it's just guessing.
Reply
#3
Thank you for your reply. Unfortunately this is not true in my case. As described 50Hz is set as default for X11 and XBMC. When I switch to a Live TV channel XBMC blanks (black) the screen about 5 secounds after the channel switch for a couple of milliseconds (I'm not saying it really changes the refresh rate, but this behavior only occurs when option "adjust display refresh rate to match video" is enabled). Afterwards playback sometimes is smooth and sometimes not.
I'll try your suggested settings Option "FlatPanelProperties" "Scaling = Native".

Do you have any additional tips or settings I could try out?
Should I post any other settings here to help isolating the problem? (by the way: how do I enable debug logs and to which file are they written on Ubuntu 12.04)

Thank you very much for your help
Reply
#4
Hi, is there any chance someone could explain me how to attach the debug log to a forum post? ... I just couldn't figure out how to attach a file ...
Reply
#5
use pastebin.com and put the link in here.
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
#6
Thank you,

Here is the xbmc debug log:
http://pastebin.com/y5VWc0ut

The described problem appeard a couple of seconds after switching to the channel "DMAX HD".

Thanks again for helping me with this issue.
Reply
#7
please post output of <path to>/xbmc-xrandr after you have powered up your machine.
Reply
#8
Unfortunately I cannot post the output of xbmc-xrandr because I start the "XBMC" session from lightdm. When I start a regular "Ubuntu-2D" session Ubuntu always put my NVidia graphic card to 60Hz ... there seems to be no setting on earth to fix this (I tried already hours with different X11/nvidia settings, it's just hopeless. See http://askubuntu.com/questions/190724/ub...fter-login)

However, when launching directly the "XBMC" session, 1980x1080@50p is set. I attached the most recent X11 startup log which shows 1920x1080p@50p is the current mode. Also XBMC "System"->"System Info"->"Video" dialog is displaying "Screen resolution: [email protected] - Full screen (50.00fps).

X11 log:
http://pastebin.com/iZGee3Nt

When option "adjust display refresh rate to match video" is enabled, the screen blanks for a couple of milliseconds about 5 seconds after a channel switch. I am not really sure XBMC changes the refresh rate, maybe just the "check" if the optimal refresh rate is already set which is causing the blank (black) screen?

After playing around with different X11 / XBMC settings today I also came to the conclusion that ocassional stuttering of Live TV playback seems to have no relation to the "blank screen" issue. Live TV is also stuttering sometimes even if option "adjust display refresh rate to match video" is disabled.

So finally it looks like I now have two (independent / not related) issues:
- Black screen for a duration of a couple of milliseconds after Live TV channel switch (delayed by about 5 seconds)
- Sometimes video playback is just not smooth (minor stuttering - visible in scrolling text). Stop and restart the Live TV channel fixes it, but every channel switch makes me praying for smooth playback ;-)

Any help is very welcome!
Reply
#9
Quote:Unfortunately I cannot post the output of xbmc-xrandr because I start the "XBMC" session from lightdm.

I don get this. xbmc-xrandr is not dependent on any window manager. Why don't you ssh to your box and run this command?
Reply
#10
Because of this (via SSH, X11 Forwarding is already disabled):

cgrimm@server:~$ /usr/lib/xbmc/xbmc-xrandr
Can't open display
cgrimm@server:~$
Reply
#11
You need set display variable: export DISPLAY=:0
Reply
#12
Okay, that worked. Here's the output:

cgrimm@server:~$ /usr/lib/xbmc/xbmc-xrandr
<screen id="0" minimum_w="320" minimum_h="175" current_w="1920" current_h="1080" maximum_w="1920" maximum_h="1080">
<output name="default" connected="true" w="1920" h="1080" x="0" y="0" wmm="0" hmm="0">
<mode id="0x164" name="1920x1080" w="1920" h="1080" hz="50.00000" current="true" preferred="false"/>
<mode id="0x165" name="1920x1080" w="1920" h="1080" hz="60.00000" current="false" preferred="false"/>
<mode id="0x166" name="1920x1080" w="1920" h="1080" hz="24.00000" current="false" preferred="false"/>
<mode id="0x167" name="1680x1050" w="1680" h="1050" hz="60.00000" current="false" preferred="false"/>
<mode id="0x168" name="1440x900" w="1440" h="900" hz="60.00000" current="false" preferred="false"/>
<mode id="0x169" name="1400x1050" w="1400" h="1050" hz="70.00000" current="false" preferred="false"/>
<mode id="0x16a" name="1400x1050" w="1400" h="1050" hz="60.00000" current="false" preferred="false"/>
<mode id="0x16b" name="1360x768" w="1360" h="768" hz="60.00000" current="false" preferred="false"/>
<mode id="0x16c" name="1280x1024" w="1280" h="1024" hz="75.00000" current="false" preferred="false"/>
<mode id="0x16d" name="1280x1024" w="1280" h="1024" hz="60.00000" current="false" preferred="false"/>
<mode id="0x16e" name="1280x960" w="1280" h="960" hz="85.00000" current="false" preferred="false"/>
<mode id="0x16f" name="1280x960" w="1280" h="960" hz="60.00000" current="false" preferred="false"/>
<mode id="0x170" name="1280x720" w="1280" h="720" hz="60.00000" current="false" preferred="false"/>
<mode id="0x171" name="1280x720" w="1280" h="720" hz="50.00000" current="false" preferred="false"/>
<mode id="0x172" name="1152x864" w="1152" h="864" hz="100.00000" current="false" preferred="false"/>
<mode id="0x173" name="1152x864" w="1152" h="864" hz="85.00000" current="false" preferred="false"/>
<mode id="0x174" name="1152x864" w="1152" h="864" hz="75.00000" current="false" preferred="false"/>
<mode id="0x175" name="1152x864" w="1152" h="864" hz="70.00000" current="false" preferred="false"/>
<mode id="0x176" name="1152x864" w="1152" h="864" hz="60.00000" current="false" preferred="false"/>
<mode id="0x177" name="1024x768" w="1024" h="768" hz="85.00000" current="false" preferred="false"/>
<mode id="0x178" name="1024x768" w="1024" h="768" hz="87.00000" current="false" preferred="false"/>
<mode id="0x179" name="1024x768" w="1024" h="768" hz="75.00000" current="false" preferred="false"/>
<mode id="0x17a" name="1024x768" w="1024" h="768" hz="70.00000" current="false" preferred="false"/>
<mode id="0x17b" name="1024x768" w="1024" h="768" hz="60.00000" current="false" preferred="false"/>
<mode id="0x17c" name="960x600" w="960" h="600" hz="60.00000" current="false" preferred="false"/>
<mode id="0x17d" name="960x540" w="960" h="540" hz="60.00000" current="false" preferred="false"/>
<mode id="0x17e" name="840x525" w="840" h="525" hz="85.00000" current="false" preferred="false"/>
<mode id="0x17f" name="840x525" w="840" h="525" hz="75.00000" current="false" preferred="false"/>
<mode id="0x180" name="840x525" w="840" h="525" hz="70.00000" current="false" preferred="false"/>
<mode id="0x181" name="840x525" w="840" h="525" hz="60.00000" current="false" preferred="false"/>
<mode id="0x182" name="832x624" w="832" h="624" hz="75.00000" current="false" preferred="false"/>
<mode id="0x183" name="800x600" w="800" h="600" hz="85.00000" current="false" preferred="false"/>
<mode id="0x184" name="800x600" w="800" h="600" hz="75.00000" current="false" preferred="false"/>
<mode id="0x185" name="800x600" w="800" h="600" hz="72.00000" current="false" preferred="false"/>
<mode id="0x186" name="800x600" w="800" h="600" hz="60.00000" current="false" preferred="false"/>
<mode id="0x187" name="800x600" w="800" h="600" hz="56.00000" current="false" preferred="false"/>
<mode id="0x188" name="720x576" w="720" h="576" hz="50.00000" current="false" preferred="false"/>
<mode id="0x189" name="720x480" w="720" h="480" hz="60.00000" current="false" preferred="false"/>
<mode id="0x18a" name="720x450" w="720" h="450" hz="60.00000" current="false" preferred="false"/>
<mode id="0x18b" name="720x400" w="720" h="400" hz="85.00000" current="false" preferred="false"/>
<mode id="0x18c" name="700x525" w="700" h="525" hz="75.00000" current="false" preferred="false"/>
<mode id="0x18d" name="700x525" w="700" h="525" hz="60.00000" current="false" preferred="false"/>
<mode id="0x18e" name="680x384" w="680" h="384" hz="60.00000" current="false" preferred="false"/>
<mode id="0x18f" name="640x480" w="640" h="480" hz="85.00000" current="false" preferred="false"/>
<mode id="0x190" name="640x480" w="640" h="480" hz="75.00000" current="false" preferred="false"/>
<mode id="0x191" name="640x480" w="640" h="480" hz="73.00000" current="false" preferred="false"/>
<mode id="0x192" name="640x480" w="640" h="480" hz="60.00000" current="false" preferred="false"/>
<mode id="0x193" name="640x400" w="640" h="400" hz="85.00000" current="false" preferred="false"/>
<mode id="0x194" name="640x350" w="640" h="350" hz="85.00000" current="false" preferred="false"/>
<mode id="0x195" name="512x384" w="512" h="384" hz="70.00000" current="false" preferred="false"/>
<mode id="0x196" name="512x384" w="512" h="384" hz="87.00000" current="false" preferred="false"/>
<mode id="0x197" name="512x384" w="512" h="384" hz="60.00000" current="false" preferred="false"/>
<mode id="0x198" name="400x300" w="400" h="300" hz="72.00000" current="false" preferred="false"/>
<mode id="0x199" name="320x240" w="320" h="240" hz="73.00000" current="false" preferred="false"/>
<mode id="0x19a" name="320x240" w="320" h="240" hz="60.00000" current="false" preferred="false"/>
<mode id="0x19b" name="320x175" w="320" h="175" hz="85.00000" current="false" preferred="false"/>
</output>
</screen>
Reply
#13
Sad 
Same problem here Sad

I have this problem since ~ 1.5 years on "Ubuntu + XBMC" and openelec.
And disable Auto refresh rate is a real pain in the ass because of 24p blurays
Reply
#14
XBMC uses xrandr to switch refresh rates and xrandr won't do anything if you switch to the same refresh rate. I think the problem is in your setups. NVidia driver uses meta modes and has to sync them with xrandr. I have seen cases where this did not work correctly. You can verify this by setting the mode with xrandr. In the case of ChristianG this would be:
xrandr --output default --mode 0x164
to set it to 50hz. The screen won't go black if your are already on 50Hz and sync has worked. I prefer using xrandr for setting the mode before starting XBMC, modes in the screen section of xorg.conf are interpreted as meta modes by NVIdia driver.

@ ChristianG
boot your system, use xbmc-xrandr to check your current mode, then use xrandr to switch to the same mode. What do you see?

ssh to your box and run xbmc-xrandr when XBMC is running. Then start a TV channel and check for changes in refresh rate. Check again with xbmc-xrandr.
Reply
#15
Results:

Step 1) System startup, checking current mode:

cgrimm@server:~$ /usr/lib/xbmc/xbmc-xrandr
<screen id="0" minimum_w="320" minimum_h="175" current_w="1920" current_h="1080" maximum_w="1920" maximum_h="1080">
<output name="default" connected="true" w="1920" h="1080" x="0" y="0" wmm="0" hmm="0">
<mode id="0x164" name="1920x1080" w="1920" h="1080" hz="50.00000" current="true" preferred="false"/>
<mode id="0x165" name="1920x1080" w="1920" h="1080" hz="60.00000" current="false" preferred="false"/>
...
</output>
</screen>

Step 2) Use xrandr to switch to the same mode (while in XBMC main menu):
cgrimm@server:~$ /usr/lib/xbmc/xbmc-xrandr --output default --mode 0x164
Effect: None, no black screen. Xrandr seems to do nothing - good so far.

Step 3) Start Live TV, switch to a channel and execute xrandr again
cgrimm@server:~$ /usr/lib/xbmc/xbmc-xrandr --output default --mode 0x164
Effect: No black screen but the current live tv stream stutters slightly when setting the mode 0x164 again. I executed the same xrandr command multiple times to make sure of this - and yes, xrandr causes the live tv stream to quicky stutter (only visible on scrolling text, it probably wouldn't be notable on a regular tv movie).

Step 4) Stop Live TV, go to "System"->"Settings"->"Video"->"Playback" and enable "Adjust display refresh rate to match video" (this option was disabled for all prior steps listed above). After this, I started Live TV again.
Effect: After about 5 seconds of watching a Live TV channel the display quickly goes black for a couple of milliseconds.

Output of xbmc-xrandr after the black-screen problem occured while still playing the same Live TV channel:
cgrimm@server:~$ /usr/lib/xbmc/xbmc-xrandr
<screen id="0" minimum_w="320" minimum_h="175" current_w="1920" current_h="1080" maximum_w="1920" maximum_h="1080">
<output name="default" connected="true" w="1920" h="1080" x="0" y="0" wmm="0" hmm="0">
<mode id="0x164" name="1920x1080" w="1920" h="1080" hz="50.00000" current="true" preferred="false"/>
<mode id="0x165" name="1920x1080" w="1920" h="1080" hz="60.00000" current="false" preferred="false"/>
...
</output>
</screen>

My personal conclusions:
1) The black screen issue seems to have nothing to do with changing display modes, but it's somehow related to the "Adjust display refresh rate to match video" feature.
2) Executing "xbmc-xrandr --output default --mode 0x1642" makes the Live TV playback stutter for quick moment. I personally think there's also room for improvement. Executing just "xbmc-xrandr" to query the current mode does not lead to a quick stuter. This leads me to the conclusion that "xbmc-xrandr --output default --mode 0x1642" certainly is doing something, even if the same mode is already set. It's not an issue for me right now (I just want to get rid of the black-screen thing) but I wanted to share this information with you - maybe an xbmc developer could optimize this in future releases.
Reply

Logout Mark Read Team Forum Stats Members Help
Auto refresh rate kicks in late and prevents smooth Live TV playback1