Slow refresh rate change with Baytrail
#1
Issue: Slow refresh rate change. It takes some ~4 seconds. When clicking video, it starts playing audio, screen flickers.. freezes, changes rate, starts playing. This takes ~4 seconds.

However, this used to work almost instantaneously before.
I used to have Ubuntu 14.04 with Kodi added on top of it. After some upgrades this started happening.
Installed latest KodiBuntu - and same issue still there.

From logs this seems to be issue:
Code:
22:29:26 T:139759041115904  NOTICE: CDVDVideoCodecFFmpeg::Open() Using codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
22:29:26 T:139759041115904  NOTICE: Creating video thread
22:29:26 T:139759041115904  NOTICE: Opening stream: 1 source: 256
22:29:26 T:139759007545088  NOTICE: Thread DVDPlayerVideo start, auto delete: false
22:29:26 T:139759007545088  NOTICE: running thread: video_thread
22:29:26 T:139759041115904  NOTICE: Finding audio codec for: 86019
22:29:26 T:139759041115904  NOTICE: Creating audio thread
22:29:26 T:139758999152384  NOTICE: Thread DVDPlayerAudio start, auto delete: false
22:29:26 T:139758999152384  NOTICE: running thread: CDVDPlayerAudio::Process()
22:29:26 T:139758999152384  NOTICE: Creating audio stream (codec id: 86019, channels: 2, sample rate: 48000, pass-through)
22:29:26 T:139758990759680  NOTICE: Thread Vaapi-Output start, auto delete: false
22:29:26 T:139758990759680  NOTICE: COutput::OnStartup: Output Thread created
22:29:26 T:139758898505472  NOTICE: Thread Vaapi-Output start, auto delete: false
22:29:26 T:139758898505472  NOTICE: COutput::OnStartup: Output Thread created
22:29:26 T:139759007545088  NOTICE: VAAPI::Close
22:29:26 T:139758990759680  NOTICE: COutput::OnExit: Output Thread terminated
22:29:26 T:139759007545088  NOTICE:  fps: 23.976024, pwidth: 1280, pheight: 720, dwidth: 1280, dheight: 720
22:29:26 T:139759007545088  NOTICE: Display resolution ADJUST : HDMI2: 1920x1080 @ 23.98Hz (21) (weight: 0.000)
22:29:26 T:139760531208128  NOTICE: CWinSystemX11::SetFullScreen - calling xrandr
22:29:32 T:139760531208128  NOTICE: Using GL_TEXTURE_2D
22:29:32 T:139760531208128  NOTICE: GL: Using VAAPI render method
22:29:32 T:139760531208128  NOTICE: GL: NPOT texture support detected
22:29:32 T:139760531208128  NOTICE: GL: Using GL_ARB_pixel_buffer_object

Actual 'issue' is after 'calling xrandr' - it takes 6 seconds for next part to happen.
Same when ending video:
Code:
22:32:02 T:139760531208128  NOTICE: DVDPlayer: finished waiting
22:32:02 T:139760531208128  NOTICE: VAAPI::Close
22:32:02 T:139758898505472  NOTICE: COutput::OnExit: Output Thread terminated
22:32:02 T:139760531208128  NOTICE: VAAPI::Close - closing decoder context
22:32:02 T:139760531208128  NOTICE: CWinSystemX11::SetFullScreen - calling xrandr
22:32:05 T:139758898505472  NOTICE: Thread BackgroundLoader start, auto delete: false
22:32:06 T:139760531208128   ERROR: CRenderManager::PrepareNextRender - asked to prepare with nothing available
22:32:06 T:139760531208128  NOTICE: CDVDPlayer::CloseFile()
22:32:06 T:139760531208128  NOTICE: DVDPlayer: waiting for threads to exit

Latest install is from: http://mirrors.xbmc.org/releases/kodibun..._amd64.iso
Info:
Code:
18:35:48 T:139760531208128  NOTICE: Starting Kodi (14.0 Git:ad747d9). Platform: Linux x86 64-bit
18:35:48 T:139760531208128  NOTICE: Using Release Kodi x64 build
18:35:48 T:139760531208128  NOTICE: Kodi compiled Dec 23 2014 by GCC 4.8.2 for Linux x86 64-bit version 3.13.11 (199947)
18:35:48 T:139760531208128  NOTICE: Running on Ubuntu 14.04.1 LTS, kernel: Linux x86 64-bit version 3.13.0-46-generic
18:35:48 T:139760531208128  NOTICE: FFmpeg statically linked, version: 2.4.4-xbmc-2.4.4-Helix
18:35:48 T:139760531208128  NOTICE: Host CPU: Intel(R) Celeron(R) CPU J1900 @ 1.99GHz, 4 cores available

Updating to latest updates (as of today) yields same issue.

Another interesting issue is when I open 'System menu', and hover mouse to 'Video output' - when it reaches it, it freezes for a few seconds too, before opening that panel.

Connected to TV via DVI 2 HDMI cable.
Again, this used to work perfectly fine, but at some point it got broken.
Reply
#2
I've tried disabling other unused ports via xorg.conf:
Code:
Section "Monitor"
        Identifier "HDMI1"
        Option "Ignore" "True"
EndSection
Section "Monitor"
        Identifier "VGA1"
        Option "Ignore" "True"
EndSection
Section "Monitor"
        Identifier "DP1"
        Option "Ignore" "True"
EndSection
Section "Monitor"
        Identifier "DP2"
        Option "Ignore" "True"
EndSection
This improved speed of 'xrandr -q' from about 1.2sec to 0.5sec.

However, what is interesting - if I log remotely and do 'xrandr -q' depending if in console window or in X window, I get waaay different results in speed:

In console window (CTRL+ALT+F1):
Code:
nfrances@xbmc:~$ time xrandr -q
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 32767 x 32767
HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 698mm x 392mm
   1920x1080      50.0*+   60.0     59.9     24.0     24.0
   1920x1080i     60.1     50.0     60.0
   1280x720       60.0     50.0     59.9
   1440x576i      50.1
   1440x480i      60.1     60.1
   720x576        50.0
   720x480        60.0     59.9
   640x480        60.0     59.9
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

real    0m0.008s
user    0m0.000s
sys     0m0.006s
nfrances@xbmc:~$

In X window (doesn't matter if KODI running, or X window session from KodiBuntu):
Code:
nfrances@xbmc:~$ time xrandr -q
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 32767 x 32767
HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 698mm x 392mm
   1920x1080      50.0*+   60.0     59.9     24.0     24.0
   1920x1080i     60.1     50.0     60.0
   1280x720       60.0     50.0     59.9
   1440x576i      50.1
   1440x480i      60.1     60.1
   720x576        50.0
   720x480        60.0     59.9
   640x480        60.0     59.9
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

real    0m0.438s
user    0m0.003s
sys     0m0.003s
nfrances@xbmc:~$
Any ideas?
Slow resolution change is really annoying Sad
Reply
#3
And what do you have set in kodi settings?

like for e.g http://kodi.wiki/view/Settings/Videos#Playback and more specifically under

Pause during refresh rate change
Inserts a pause for the computer to adjust refresh rate. Sometimes needed to prevent things like slight stuttering when a video starts. Range 0.1 milliseconds to 20 seconds. (default off)

and please pastebin a full and complete debug log of you just doing this. So enable debug, restart kodi and immediatly playback a file that triggers refresh rate chnage and after its done its business grab log and pastebinit.
Reply
#4
Spent few hours, and found the root cause.

It's video driver - i915_bdw

LiveCD KodiBuntu worked fine.
When i installed it to HDD, I noticed issues.

Checking for differences - noticed that LiveCD used i915 driver for video, while after installing it to disk it used i915_bdw driver.
I did upgrade to 3.13.0-48 kernel, and after blacklisting i915_bdw driver it used i915, however KODI was unusably slow and choppy, with few graphic artifacts.

I downgraded back to 3.13.0-43 kernel, also blacklisting i915_bdw driver, thus using i915 driver - and now it all worked fine!
Resolution change is instant.

So, issue is in i915_bdw driver.
Also, newer versions os i915 driver do not work good with J1900's graphic card.
Reply
#5
Try that kernel please: http://forum.kodi.tv/showthread.php?tid=...pid1952152
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#6
Tried it.
It loads i915 driver, even though I removed i915_bdw from blacklist.

So far it seems to work fine!
All running smooth!

Code:
nfrances@xbmc:~$ uname -a
Linux xbmc 3.19.1-legacy-turbo+ #1 SMP Tue Mar 10 07:53:10 CET 2015 x86_64 x86_64 x86_64 GNU/Linux
nfrances@xbmc:~$ lsmod|grep ^video
video                  20271  1 i915
nfrances@xbmc:~$
Reply

Logout Mark Read Team Forum Stats Members Help
Slow refresh rate change with Baytrail0