Active Topics

 


Reply
Thread Tools
Posts: 310 | Thanked: 383 times | Joined on Jan 2010
#1
Hey everyone,

I've been spending the last few days trying to reduce tearing on pannable widgets (ie. photo browser) and the desktop.

I'm just starting this thread as a placeholder; as I make progress I'll post updates here. And, of course, if anyone has any insight I'd appreciate it. I'm a C coder and have fairly extensive experience with Qt, but virtually none with gtk, gles, hildon, clutter, etc. If any experts on this stuff are reading this you'll no doubt cringe at my haphazard and uneducated approach to this.

So far I've identified an ioctl() that seems to wait for vsync.

I assumed it didn't exist, but after applying a kernel patch to implement FBIO_WAITFORVSYNC I found by Brian Swetland against drivers/video/omap, I realized that the n900 doesn't seem to use that driver at all. It seems to use the one under omap2.

In looking through omap2/omapfb/omapfb-ioctl.c I discovered OMAPFB_WAITFORVSYNC, which seems to work!

According to my quick test, it cycles ~60 times/second, which I would assume is the default frame rate while the device is active. Interestingly, when the screen is off, that rate drops dramatically (I assume for power saving).

Now, I inserted this ioctl() into hildon-pannable-area.c (hildon_pannable_area_timeout) just prior to gdk_window_process_updates (), just to see what would happen.

Unfortunately it didn't seem to have the desired effect. Now I don't know enough about what happens, so my guesses would be:

1. gdk_window_process_updates () doesn't actually block and swap frames; frame swapping is asynchronous
2. updates are so slow the frame swapping occurs between frames anyway
3. it's not double buffered, and updates take longer than one frame

Again, apologies if the answer is obvious and I'm off the mark.. I'm still learning.

In any case, it appears the hildon desktop uses clutter and its own method for panning (ie. not hildon-pannable-area), and it was the main thing I was trying to fix, I so put hildon-pannable-area on hold, and focused on clutter.

I assume clutter is using the eglx backend on the n900?

All I've done so far is implement OMAPFB_WAITFORVSYNC and some debug code in clutter_backend_egl_redraw(), but it doesn't seem to get called on the device. Still trying to figure this one out.

I know enabling WSEGL_UseHWSync is supposed to have some sort of effect but I don't really see it (still tears badly), and I can't find any references to that variable anywhere in hildon-desktop, except in the bundled hildon-desktop.ini.

Another alternative I wanted to explore was reducing the LCD's refresh rate to 30hz, as this would reduce tearing even without frame sync. And there's no reason to have it any higher that I can think of. I assume it's just a matter of adjusting the pixel clock/timings.

Anyway, if anyone has any insights or words of wisdom to share (like I'm going in completely the wrong direction), please do share.

Last edited by nightfire; 2011-03-05 at 22:20.
 

The Following 18 Users Say Thank You to nightfire For This Useful Post:
Posts: 110 | Thanked: 127 times | Joined on May 2010
#2
Originally Posted by nightfire View Post
Another alternative I wanted to explore was reducing the LCD's refresh rate to 30hz, as this would reduce tearing even without frame sync. And there's no reason to have it any higher that I can think of.
Think of the Angry Birds. And maybe mplayer too...

If there was a way to make the LCD refresh a control-panel / gconf-selectable value, it would make testing various apps easier.

I can't speak for specific HW side effects or whether it's a good idea more generally, but I'm curious where the 30Hz rabbit-hole goes. Let us know
 
Posts: 842 | Thanked: 1,197 times | Joined on May 2010
#3
Not sure if you tried this or not, but I found that enabling "WSEGL_UseHWSync" in "/etc/powervr.d/hildon-desktop.ini" reduces tearing in transitions, though doesn't have much effect elsewhere.
I've heard that setting this value can make some systems unstable(which is why it's disabled by default), but I've had no issues, even at 1ghz.
__________________
My projects: BackupMenu - OS Backup & restore | Video: Flashing your n900(LiveCD)
My devices: N770 + 8GB SD card soldered internally, N900 with 8GB SD card + Custom OC(125-950 typically).
OC freqs: 0:22,90 125:22,90 250:28,180 500:30,360 550:32,400 600:34,430 700:39,430 750:41,430 805:45,430 850:47,500 900:50,500 950:54,500 1000:58,500 1100:67,520 1150:71,520
 

The Following User Says Thank You to RobbieThe1st For This Useful Post:
HellFlyer's Avatar
Posts: 1,148 | Thanked: 613 times | Joined on Mar 2010 @ Toronto
#4
Fixed in Harmattan
__________________
The quieter you become the more you are able to hear


"I'm a N900 user, can I haz Flash 10 plz?!11!?" © Jaffa


Elopocalypse started on 11.02.2011
 
Posts: 842 | Thanked: 1,197 times | Joined on May 2010
#5
Originally Posted by HellFlyer View Post
Fixed in Harmattan
But, erm... Some of us -like- Maemo. Meego's not debian-based, so it's at -least- one step below maemo.
__________________
My projects: BackupMenu - OS Backup & restore | Video: Flashing your n900(LiveCD)
My devices: N770 + 8GB SD card soldered internally, N900 with 8GB SD card + Custom OC(125-950 typically).
OC freqs: 0:22,90 125:22,90 250:28,180 500:30,360 550:32,400 600:34,430 700:39,430 750:41,430 805:45,430 850:47,500 900:50,500 950:54,500 1000:58,500 1100:67,520 1150:71,520
 

The Following User Says Thank You to RobbieThe1st For This Useful Post:
Posts: 1,746 | Thanked: 2,100 times | Joined on Sep 2009
#6
Originally Posted by RobbieThe1st View Post
But, erm... Some of us -like- Maemo. Meego's not debian-based, so it's at -least- one step below maemo.
The packaging aspect is irrelevant to a great degree, since most people have an issue with the front-end rather than the back-end.

MeeGo will probably have actual vsync well before Maemo ever does, and rather than trying to migrate all of that stuff over to a hack on top of a hack that would be a Maemo rebuild (that you couldn't redistribute anyway,) you'd be better off just using Cordia on MeeGo DE and moving on.

In good time, of course.
 

The Following 2 Users Say Thank You to wmarone For This Useful Post:
Posts: 842 | Thanked: 1,197 times | Joined on May 2010
#7
I suppose some people don't. But as a developer, I can like whatever I want, for any reasons I want. And I like Debian.

The OP here is attempting to solve a problem in a -currently- available piece of software that's been released to the public. You guys are saying(essentially) "Don't bother fixing it, the next version will have it". Only problem is, MeeGo won't be officially released to the users on the N900 - sure, it'll be possible for devs etc. to install it, but without much official support.

I'd personally prefer -maemo-, which already -works- nicely, than MeeGo, which -might- get to the same point... Provided nokia doesn't drop it before it's done - Not too much of a stretch considering what's happened in the past.
__________________
My projects: BackupMenu - OS Backup & restore | Video: Flashing your n900(LiveCD)
My devices: N770 + 8GB SD card soldered internally, N900 with 8GB SD card + Custom OC(125-950 typically).
OC freqs: 0:22,90 125:22,90 250:28,180 500:30,360 550:32,400 600:34,430 700:39,430 750:41,430 805:45,430 850:47,500 900:50,500 950:54,500 1000:58,500 1100:67,520 1150:71,520
 

The Following 6 Users Say Thank You to RobbieThe1st For This Useful Post:
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#8
Since you're trying...

Read:
http://lists.maemo.org/pipermail/mae...er/023281.html

Also, what you're proposing has been tried already:
http://maemo.gitorious.org/fremantle...9be0bac825e8c4

I at least pretty much agree with Eero here: vsync is a global problem that affects many applications, and cannot really be eliminated by editing just one of the pieces in the graphics stack: it has to be a coordinated effort.

In fact, you can easily see that there's still some tearing, albeit reduced, when removing hildon-desktop from the equation by either killing it or pressing Ctrl+Shift+N. While in this mode, you're neither using the SGX drivers, nor hildon-desktop, nor clutter, and yet there's still tearing that comes from Gtk+ and Xorg themselves.


Of course it is easier to fix in Meego, because Nokia now basically controls the toolkit.

Last edited by javispedro; 2011-03-06 at 03:42.
 

The Following 8 Users Say Thank You to javispedro For This Useful Post:
Posts: 310 | Thanked: 383 times | Joined on Jan 2010
#9
Originally Posted by HellFlyer View Post
Fixed in Harmattan
Hey HellFlyer,

Do you happen to know exactly where the problem was? In another thread someone mentioned backporting something kernel related, but as far as I can tell the kernel does offer a blocking vsync call.

Or do you mean the Meego UI just supports it, and hildon-desktop/clutter don't?
 
Posts: 310 | Thanked: 383 times | Joined on Jan 2010
#10
Originally Posted by javispedro View Post
Since you're trying...

Read:
http://lists.maemo.org/pipermail/mae...er/023281.html

Also, what you're proposing has been tried already:
http://maemo.gitorious.org/fremantle...9be0bac825e8c4

I at least pretty much agree with Eero here: vsync is a global problem that affects many applications, and cannot really be eliminated by editing just one of the pieces in the graphics stack: it has to be a coordinated effort.

In fact, you can easily see that there's still some tearing, albeit reduced, when removing hildon-desktop from the equation by either killing it or pressing Ctrl+Shift+N. While in this mode, you're neither using the SGX drivers, nor hildon-desktop, nor clutter, and yet there's still tearing that comes from Gtk+ and Xorg themselves.


Of course it is easier to fix in Meego, because Nokia now basically controls the toolkit.
Whoa.. that is freaky. Except that inexplicably that patch isn't using a global static and single open() on init... that's almost identical to what I've done.

I know I'm up against quite a challenge here but honestly if I can sync just the desktop panning... I'd be quite happy. It's the main one I find annoying and I bet it's possible.
 
Reply


 
Forum Jump


All times are GMT. The time now is 12:12.