Scanning the framebuffer for changes

Posted on 2006-06-22
Last Modified: 2010-08-05
Hey folks,

I'm developing a remote desktop app similar to VNC. I'm trying to scan the framebuffer for changes  but it takes a REALLY long time. I'm using methods similar to other VNC apps, with the difference that I can't go through X, but need look directly at the framebuffer.

I mmap the local framebuffer to a char* buffer, but for some reason comparing portions of it to what I have in my "check against" buffer take much longer than I expected.

What I mean is, using memcmp to compare two data buffers I've created takes almost no time, whereas comparing a data buffer I've created to a portion of the mmap'ed framebuffer takes many times longer.

Are there VNC or VNC-like apps out there that don't go through X, and are they any good?

Do I need to go even lower, to the drivers?

Many many thanks for your help.
Question by:quadrille01
  • 2
  • 2

Expert Comment

ID: 17057502
what about using DirectFb library.

Manish Regmi

Author Comment

ID: 17058453
I looked at DirectFB but from what I can tell its accellerated for write but not read. From some other reading I've learned that most video cards don't provide much bandwidth for reading. I mean at the hardware level. I'm looking at Xvfb right now. That keeps the framebuffer in system memory.


Accepted Solution

manish_regmi earned 250 total points
ID: 17060672
There is another library which directly access hardware. Its called svgalib ( It is used in application where X cannot perform well like video games. Doom and Quake are already ported to that library.
You can give it a try.

Manish Regmi
LVL 34

Assisted Solution

by:Duncan Roe
Duncan Roe earned 250 total points
ID: 17063137
We used svgalib in a project at work: were never able to read the sceen back at all. We wanted screen shots for the user manual but had to resort to Windows screenscraper while running it under VMWare. So it may not suit your needs.
Must say I did find the framebuffer X driver to be very slow when I tried it, compared to one that drove the chip directly. So it would seem there might be something inherently slow in the implementation. If so, could it be improved?
That would need someone (you?) to look with fresh eyes at how Linux is doing it now. Wish I could help you more, best of luck anyway

Author Comment

ID: 17063480
Overall video performance(by which I mean frames-per-second) is less of an issue right now than the CPU cycles that framebuffer scanning eats up.I wonder if there's a scanning algorithm thats been tested as mathematically the most efficient or something.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now