DaRk_St0rM
Posts: 33
Joined: Sat Feb 14, 2015 9:43 pm

Pi 2 1080p@60fps videos out of sync with omxplayer and Kodi

Tue Feb 24, 2015 7:32 pm

I've been trying to play some 1080p videos @ 60 fps stored in my USB HDD on my Raspberry Pi 2 (all of them downloaded from YouTube).
Both with omxplayer and Kodi audio and video are out of sync (audio plays like a second ahead of video).The problem is not present with videos at 30 fps.
Both video and audio are being output through HDMI. I have set 128 MB of RAM for the GPU, but using 256 didn't work either, at least in omxplayer.

A friend of mine has reported being able to play videos at 60 fps flawlessly in Kodi with his Pi 1.

rikardo1979
Posts: 13
Joined: Thu Jun 28, 2012 8:23 pm

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Tue Feb 24, 2015 8:20 pm

this is way to much to play on RPi

DaRk_St0rM
Posts: 33
Joined: Sat Feb 14, 2015 9:43 pm

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Tue Feb 24, 2015 8:57 pm

(If I correctly understood your reply)

As I said, my friend was able to successfuly play this kind of stuff in his, which has half of RAM (and he only has 64 MB dedicated to the GPU that I'm aware of), and a less powerful processor, and I've seen other posts about it.

My opinion is that it's rather a problem in the way YouTube encodes those videos.

User avatar
topguy
Posts: 7213
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Tue Feb 24, 2015 9:01 pm

Press 'o' while watching those videos and note stuff like bandwidth for audio and video and which codecs are used.

Are you playing videos downloaded from Youtube ? And is it the same types of videos that your friend is playing ?

DaRk_St0rM
Posts: 33
Joined: Sat Feb 14, 2015 9:43 pm

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Tue Feb 24, 2015 9:36 pm

In omxplayer or Kodi?

Yes, all the 60 fps videos I've tried are downloaded from YouTube, in mp4.
My friend says he thinks they weren't from YouTube, they were H.264 inside Matroska (AAC for audio I guess).

User avatar
topguy
Posts: 7213
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Wed Feb 25, 2015 11:16 am

DaRk_St0rM wrote:In omxplayer or Kodi?
I meant in Kodi.

MKV is usuallt rips from Bluray or TV, but they are usually not 1080p@60, either 1080i@60 or 1080p@30/24.

DaRk_St0rM
Posts: 33
Joined: Sat Feb 14, 2015 9:43 pm

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Wed Feb 25, 2015 6:13 pm

I will try it when I can.

He said it was some kind of "test" video of korean girls dancing, or something like that, that was available in diferent resolutions, I don't know if it was 1080p or 1080i, but he's sure that it was 60 fps.

User avatar
Mequa
Posts: 172
Joined: Sun Sep 09, 2012 9:54 pm
Location: England
Contact: Website

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Thu Feb 26, 2015 7:11 am

The following overclock settings in config.txt get some (perhaps not all) 1080p@60fps videos running smoothly on my Raspberry Pi 2 Model B with a 2A power supply, both under Raspbian (with Kodi or omxplayer) and under OpenELEC with Kodi:

Code: Select all

arm_freq=1000
sdram_freq=500
core_freq=500
h624_freq=750
isp_freq=750
v3d_freq=750
over_voltage=2

gpu_mem=384
gpu_mem_1024=384
hvs_priority=0x32ff
If you don't mind voiding your warranty, you can also add the following for even more speedup:

Code: Select all

force_turbo=1
h264_freq=750 is very high overclock (normal speed is 250), and the same for isp_freq=750 and v3d_freq=750. This is stable on my Pi 2 but perhaps not on all models, so you may want to start with 400 or 500.

To edit them, simply do this from a Terminal, add the above settings, and make sure the above settings are not duplicated:

Code: Select all

sudo leafpad /boot/config.txt
Then save the file and restart your Pi 2.

You may want to add a heat sink if you are using a non-ventilated case. I do not recommend a power supply lower than 2A if you are trying this level of overclock.

On the top right corner of the screen there may appear a warning square. If it's rainbow coloured, your power supply is inadequate and may benefit from an upgrade to a 2A model. If it's red, your Pi's SoC is getting too hot (usually 85 Celsius) and may benefit from a heat sink and/or ventilation.

For a sample video in 1080p@60fps, try Big Buck Bunny. The linked video (downloaded and played in Kodi or omxplayer) is choppy without overclock, yet smooth as butter with overclock settings like the above.

DaRk_St0rM
Posts: 33
Joined: Sat Feb 14, 2015 9:43 pm

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Thu Feb 26, 2015 10:38 am

Tried your settings, at least with the ones you mentioned at 400 instead of 750, my YouTube videos play as smooth as before, but the audio is still out of sync.
The video you posted plays fine at the beginning, but afterwards gets lagged.
I think my Pi can handle the kind of videos that I usually play, probably even without overclocking, since they're not that resource-consuming even though they are at 1080p@60fps, it's just that audio and video are desynced.

It's frustrating that, for example, if I have that problem on my PC (which I don't with the files I'm taking about), I can just solve it quickly in mpc-hc and it's giving me much trouble here.

Update: setting those options to 750 seems to make it play more smoothly, however audio and video are out of sync, too, and it's much more noticeable.

User avatar
topguy
Posts: 7213
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Thu Feb 26, 2015 1:02 pm

DaRk_St0rM wrote: I can just solve it quickly in mpc-hc and it's giving me much trouble here.
How would you "fix" it in mpc-hc ?
Have you seen that you can change audio-offset while playing: http://kodi.wiki/view/Video_playback#OS ... e_settings

DaRk_St0rM
Posts: 33
Joined: Sat Feb 14, 2015 9:43 pm

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Thu Feb 26, 2015 2:24 pm

topguy wrote:
DaRk_St0rM wrote: I can just solve it quickly in mpc-hc and it's giving me much trouble here.
How would you "fix" it in mpc-hc ?
Have you seen that you can change audio-offset while playing: http://kodi.wiki/view/Video_playback#OS ... e_settings
Hmm, I'm not sure if that option was available, I only remember there was some option for audio/video sync that didn't work for me.
I'll have to check.
Btw, I tried to take a picture of the info given by pressing 'o' but my phone's shitty camera didn't give exactly good results.
Guess I could write it down.

User avatar
topguy
Posts: 7213
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Thu Feb 26, 2015 3:44 pm

It was more intended for you to compare with your friend to make sure you were actually comparing performance with the same type of videos.

DaRk_St0rM
Posts: 33
Joined: Sat Feb 14, 2015 9:43 pm

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Fri Feb 27, 2015 1:46 pm

Btw, when I exit Kodi I'm getting a black screen and it gets stuck there.
I saw a post which mentioned that commenting out the last 3 lines of /usr/bin/kodi-standalone would solve it, but it didn't.
Is there any solution?

DaRk_St0rM
Posts: 33
Joined: Sat Feb 14, 2015 9:43 pm

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Sat Feb 28, 2015 7:56 pm

The audio offset option didn't work.If I set it to, for example, 1 second, and start playing the video, the audio starts playing but the video doesn't until 1 second later, so it's as if it does nothing.

gkreidl
Posts: 6345
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Sat Feb 28, 2015 8:25 pm

DaRk_St0rM wrote:The audio offset option didn't work.If I set it to, for example, 1 second, and start playing the video, the audio starts playing but the video doesn't until 1 second later, so it's as if it does nothing.
No chance, as the video is playing too slow and so sound is moving ahead more and more.
The H264 unit of the SOC is specified for up to 1080p30, not more.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

DaRk_St0rM
Posts: 33
Joined: Sat Feb 14, 2015 9:43 pm

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Sat Feb 28, 2015 8:58 pm

gkreidl wrote:
DaRk_St0rM wrote:The audio offset option didn't work.If I set it to, for example, 1 second, and start playing the video, the audio starts playing but the video doesn't until 1 second later, so it's as if it does nothing.
No chance, as the video is playing too slow and so sound is moving ahead more and more.
The H264 unit of the SOC is specified for up to 1080p30, not more.
So bad if that's true. So, does anyone know of any good site for downloading YouTube videos @ 1080p?
I've been using http://www.clipconverter.cc, but it only allows me to download 1080@60fps, not 30.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5803
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Tue Mar 03, 2015 4:35 pm

There has been a bug in recent firmware that meant h264_freq / v3d_freq / isp_freq weren't taking effect.
That has been resolved with today's update.

With h264_freq=350 and force_turbo=1 I can play the 60fps Big Buck Bunny clip smoothly.
You might also need over_voltage to be set (warning that in conjunction with force_turbo will set your warranty bit).

Note: If you were setting any of the gpu clock to 750, then that's a good indication that overclock is not working.
Anything much above: core_freq=600, sdram_freq=600, h264_freq=450, v3d_freq=350 and I'd start to suspect the overclock is not working.

Use:

Code: Select all

vcgencmd measure_clock arm
vcgencmd measure_clock core
vcgencmd measure_clock v3d
vcgencmd measure_clock h264
as a sanity check to check the frequencies you ask for are actually working.

DaRk_St0rM
Posts: 33
Joined: Sat Feb 14, 2015 9:43 pm

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Wed Mar 04, 2015 3:36 pm

dom wrote:There has been a bug in recent firmware that meant h264_freq / v3d_freq / isp_freq weren't taking effect.
That has been resolved with today's update.

With h264_freq=350 and force_turbo=1 I can play the 60fps Big Buck Bunny clip smoothly.
You might also need over_voltage to be set (warning that in conjunction with force_turbo will set your warranty bit).

Note: If you were setting any of the gpu clock to 750, then that's a good indication that overclock is not working.
Anything much above: core_freq=600, sdram_freq=600, h264_freq=450, v3d_freq=350 and I'd start to suspect the overclock is not working.

Use:

Code: Select all

vcgencmd measure_clock arm
vcgencmd measure_clock core
vcgencmd measure_clock v3d
vcgencmd measure_clock h264
as a sanity check to check the frequencies you ask for are actually working.
So, which values would you recommend for each clock for this particular case? I'm a complete novice in terms of any kind of OC or whatever.
I can post the current values if necessary.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5803
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Wed Mar 04, 2015 6:49 pm

If you want to play 60fps Big Buck Bunny and you don't care about warranty bit, I'd suggest:

Code: Select all

h264_freq=350
over_voltage=6 
force_turbo=1
for Pi1. For Pi2, over_voltage=2 would be recommended.

You can also add:

Code: Select all

arm_freq=1000
core_freq=500
for more speed, but I don't think that is essential for this file.

You will need to have run rpi-update to get the fix for overclocking h264.

DaRk_St0rM
Posts: 33
Joined: Sat Feb 14, 2015 9:43 pm

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Wed Mar 04, 2015 6:58 pm

I'll try it.
But, I think I read somewhere that OC didn't void your warranty anymore? Shall I be concerned about that warranty bit then?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5803
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Pi 2 1080p@60fps videos out of sync with omxplayer and K

Wed Mar 04, 2015 6:59 pm

DaRk_St0rM wrote:I'll try it.
But, I think I read somewhere that OC didn't void your warranty anymore? Shall I be concerned about that warranty bit then?
force_turbo in conjunction with over_voltage does set the warranty bit. Depends how old your pi is and how much you care.

Return to “Troubleshooting”