Dienstag, 27. September 2011

Nokia N9 .... and no glory at all :(

So finally Nokia made sure the N9 wont succeed by setting an unrealistic high price point.
The first Nokia mobile with very positive reviews in a very long time and Nokia desperatly tries to make it loose - just to legitimate the switch to Windows Phone.

I wonder what had to go wrong, to make a company like Nokia decide to make itself completly dependent on a single software company and let in-house know-how and potential accumulated over the past 10 years just go away. Take Samsung for comparison - their Android smartphonse do really well - but just in case something unfourtunate would happen - they still have plenty of other options like Bada.

I can't help but to feel a bit sad, the 770 and N800 were great development platforms. Instead of just using the linux kernel and some non-unix userland (owned and controlled by a single company), that platform really was linux on a phone. My 770 is still used as internet gateway, firewall and postgresql server.

Donnerstag, 1. September 2011

WebSockets for rescue

Today I hacked together a prototype using WebSockets for data transfer, just to see how much it would gain - and the results are impressive! Over my high-latency line (~120ms ping) using http caciocavallo-web was barely useable, using websockets there was only a slight delay. Even moving internal frames arround felt almost smooth.

So it seems after all the work there is a chance for it to be more than a nice demo =)
Unfourtunatly by hacking the prototype together, almost all of the existing stuff has been broken - and it will require some serious refactoring to integrate it smoothly. But for sure it would be worth the effort :)

Now it's up to the html5/browser guys/girls, to finally spec WebSockets and implement the missing features like binary data transfer.

Dienstag, 23. August 2011

Load testers wanted ;)

After fighting with memory-leaks in the demo-applications, as well as a concurrency bug in java.awt.EventQueue, cacio-web should be ... almost ... rock solid finally.
Guess AWT simply was never tested with 20+ concurrent sessions ;)

Even if tried already, in case you have some time left, please play arround a bit:

Would be great to see it behaves also well under real-world load :)

Mittwoch, 17. August 2011

SwingSet2 demo online - and focus issues resolved :)

After a coding session last evening with Roman and Mario, we were finally able to sort out the remaining focus issues. Together with some event-handling fixes (no swallowed events anymore) and memory-leaks-plugs (one caused by SwingSet2 itself) I implemented things are coming together quite nicely.

Roman was so kind to host SwingSet2 on his vServer: http://icedrobot.de:9091/SessionInitializer?cls=SwingSet2

Enjoy :)

PS1: No idea wether it can handle the load, at the first announcement it ran out of servlet threads almost immediatly. Update: Ok server overloaded again, please don't leave it open for ages to avoid lurking sessions.
PS2: Keep in mind this was designed for low-latency lines
PS3: It still only supports german keyboards :p

Montag, 25. Juli 2011

RLE - image encoding

As PNG was rather expensive for real-time image encoding, I implemented server-side RLE encoding. Compression for "typical" UIs yields about 120-200% the size of the equivalent png, however at a speed of about 300-1000mb/s on my 4 year old Notebook.

The data is sent to the client in binary format, and is decoded using JavaScript.
XHR1 for binary data transfer is also supported, but since XHR1 was never intended for binary-data-transfer it causes a performance hit.

IE9 was running on Win7 in Virtualbox (as all XHR1-Win7), however even under the same conditions, Opera/FireFox/Chrome were twice as fast.

Montag, 18. Juli 2011

Browser Benchmarks

Cacio-Web needs to send image-data as well as a command-stream to the browser which is quite tricky to do. It currently supports three different ways to transport data to the client/browser:
  • XHR, text transfer, image data encoded as Base64. (traffic+, server load+, client load-)
  • XHR2, binary transfer, encoded to Base64 on client-side. (traffic-, server load, client load+)
  • PngImage, command-stream encoded in image and extracted with getImageData. Should be fast, but causes browsers to crash and eat tons of memory - so not benchmarked for now. (traffic-, server load-, client load?)
Long talk, short story - here are the results for rendering a 33.6k png image over and over measuring browser-only performance. FireFox does quite well, when more time is spent executing javascript code (XHR2) Chrome catches up:

All in all, its amazing in how many ways things can be done - all of them beeing suboptimal. I have to render an image to a canvas (which can cause precission loss) to be able to access its pixel-values. Even if I have the binary data in a ArrayBuffer, I have to pass image-data using data-URIs - that sucks.

Mittwoch, 13. Juli 2011

Prebuilt demo release available

With GSoC2011 midterm evaluations approaching, I've created a runnable demo release, available at:

To run your favourite app, (e.g. SwingSet2), simply:
  1. Untar the archive
  2. download recent jre/jdk7 bundle from jdk7.dev.java.net for 32-bit Linux
  3. copy libcacio-web.so into jre/lib/i386/ (or add it to the JAVA_LIBRARY_PATH)
  4. Start the server environment:
    java -cp cacio-web-runtime.jar:SwingSet2.jar net.java.openjdk.cacio.server.CacioServer
  5. Start the app in your browser: http://localhost:8080/AppStarter?cls=SwingSet2

Please keep in mind this is only a demo release, a lot of stuff hasn't been implemented or is disabled to avoid problems, For now only german keyboard layouts is (somewhat) properly supported, however for toying arround the input support for us keyboards should be sufficient.

Have Fun :)

Sonntag, 3. Juli 2011

Interesting & ugly stuff

The last few days I've been working on implementing copyArea acceleration, which is really a useful feature for faster scrolling. Instead of re-painting the whole scrolled area, only a small image of the "uncovered" are is sent to the browser - while the content already on screen is simply moved.
Supporting accelerated operations like this required quite a bit of tinkering with the code-base - accalerated operations require invalidated regions to be preserved before (which is why it wouldn't be wise to accelerate other primitives like fillRect too).
Long talk ... it still needs more work, because there are still artifacts. Other than that I am pleased with the performance results.

Now the ugly - keyboard events for now only work for basic characters on german keyboards.
Browsers are really broken in this regard. Sometimes the same keyCode is generated for different keys, sometimes keys can only differentiate by the order the keyPressed/Typed/Released events are generated.
All this is of course highly browser specific and without having an idea what keyboard layout is used actually, there isn't really a cure for the mess. Not so great idea to make a scripted document viewer the dominant runtime for distributed applications :/
Thanks a lot to the Joel Martin (Author of noVNC) who allows me to base my code on top of noVNC's input handling.

Mittwoch, 29. Juni 2011

AppContext for rescue

Yesterday I had a talk with Roman and Mario about AppContexts, and it turns out to be really useful.
Basically AppContexts are used inside AWT to shield one application/applet from others, create seperate Event-Dispatch-Threads for each app and so on.

Originally introduced for Applets I guess, this is exactly what I was looking for. Furthermore it solves the problem of out-of-http-request access to the surface. During an http-access I of course now which session I am on - but what if an application starts its own threads? Well, now each app knows its Session, as its stored in its AppContext.

It also allows for multiple LnFs set in the same server:

Dienstag, 7. Juni 2011

OpenGL pipeline works with the i915 open-source drivers

Recently I updated my i945GM based notebook to Fedora-15 (mesa 7.11 pre-release) and gave the java2d-OpenGL pipeline a try again.

To my surprise, it worked:
jconsole -J-Dsun.java2d.opengl=True
OpenGL pipeline enabled for default config on screen 0
i915_program_error: Exceeded max nr indirect texture lookups (6 out of 4)
i915_program_error: Unsupported opcode: DDX

Its still dog-slow and crashes every now and then - but it clearly shows things are improving in the open-source opengl driver world. The OpenGL pipeline seems to be a rather tough beast, as it requires lots of extension/feature and even the proprietary nvidia driver break it from time to time.

Donnerstag, 12. Mai 2011

Caciocavallo-Web at GSoC2011

The Caciocavallo-Web proposal made it - during Summer I'll work on Caciocavallo-Web as part of GSoC2011.
Lets bring Swing to Web :)

Donnerstag, 7. April 2011

Caciocavallo-Web proposed at GSoC 2011

I proposed Caciocavallo-Web for Google Summer of Code 2011, the proposal is located at: http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/linuxhippy/1

Would be great to work on a fun project and getting paid for, however competition will be tough, many really cool ideas have been proposed under the GNU umbrella.

If you like the idea ... I am thankful for all support I can get ;)

Dienstag, 29. März 2011

Now even with amd64 support ;)

Over the last few weeks I fixed a few bugs oracle's QA Team found, ranging from XErrors caused by Xorg's weird way of freeing pictures asscociated with a Drawable, fixes to the SHM fallback path (this also affects the traditional X11 backend) and some bugs in the XRender glyph cache causing a Java2Demo running all night eating all your resources and causing your machine to crash ;)
What I never noticed however was, that the pipeline didn't work on AMD64. It seems nobody gave it a try on 64-bit machines. When text was rendered - only the first half was displayed.
The reason was that XIDs are defined as "unsigned long", even if they only contain 4-byte values as which the pipeline treated them.

Things look quite good so far for JDK7, except for one bug which causes IntelliJ's editor to be completly unuseable, caused by a different definition of the SRC operator with antialising enabled. Java2D still blends with the background, whereas XRender doesn't blend at all.
A simple solution would be to fall-back to software for SRC, better would be to switch to SRC_OVER when possible (src doesn't contain alpha), hope I'll find some time for that soon...

Freitag, 4. März 2011

Caciocavallo goes Web

Currently I am working on a small university project to "port" AWT/Swing to html5/canvas ... basically its more or less like VNC, except that browsers are far more clumsy to work with. (its only a scriptable document viewer after all).
The project is based on Caciocavallo, which already saved me a lot of work - all you need to provide is more or less a framebuffer and Caciocavallo takes care of the rest.

Although for now only rendering works (only for a single app) and input-event support is non-existent, the screenshot already looks quite nice :

Mittwoch, 9. Februar 2011

Chaos 2011

This year my trip to Fosdem was surrounded by chaos....

On Friday my Flight to brussels was delayed because of fog (in fact, we had to take a 2h bus trip to another airport), after ~14h of traveling I was just too tired to join you guys drinking ;)

The sightseeing planned on Friday now had to be done on Saturday/Sunday morning. When I arrived at Fosdem many talks I was interested in were full. Unfourtunatly no evening-event on Saturday.

On Sunday my backpack was stolen, including my passport. Missed the Gervill presentation, not in mood for evening-event...
Even with a notice of loss issued by the police and a copy of my passport I was not allowed to leave. Went by train, without a passport.
Had luck however, met David in the train who also attends the technical university vienna =)

So even if Fosdem-2011 was great again this year, I am a bit disappointed - didn't even find the time to talk to other attendees, which was what I was looking foreward to most.

After all, the talks as well as the exhibiting projects (really should give Haiku-OS a try soon) were awesome! Thanks everybody!