maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [BETA RELEASE] PhoneME Advanced (Java Mobile) (https://talk.maemo.org/showthread.php?t=81969)

DavyP 2012-03-29 19:35

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by freemangordon (Post 1185667)
@DavyP - thanks for the last patches, now opera runs. In short - everything is fine :)

I've played a little bit with cvm code and the result so far:

JBenchmark2, no overclock, charger connected, using max score from several runs:

landscape:
DavyP cvm - 862
freemangordon cvm - 874

portrait:
DavyP cvm - 760
freemangordon cvm - 774

not and impressive speedup (only about 2%) :D , but yet

Next thing I will do is to try to get rid of that memcpy(by passing cvm allocated buffer as screen buffer to libcvm), it should give us additional performance boost.

Again, thanks a lot for making this port to maemo and sharing your experience with us.

EDIT:
any chance to PM me a link to download JBenchmark, google finds a site when a registration is needed, but I don't want my inbox full with spam.

If you would repeat the experiment multiple times, you will notice
that the 2% below is even below the error margin. So I am very
doubtful there is any improvement at all :-)

And about the memcpy: I am pretty sure you will bump into
synchronization issues between two event loops (one of phoneme
and one of the Qt4 frontend). The phoneME backend calls a
method in the Qt4 frontend to say it is time to paint the buffer. The
Qt4 front-end will emit an asynchronous signal. By the time this
signal is processed the original buffer has changed, resulting in
flickering and painting of intermediate frames if you use the
original buffer.

But feel free to experiment, you never know ... :-)

Davy

DavyP 2012-03-29 19:36

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
JBenchmark:

http://davy.preuveneers.be/phoneme/p...mo/jbenchmark/

Note: only JBenchmark and JBenchmark2 work. The others require
more JSR support

Davy

freemangordon 2012-03-29 19:37

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by Estel (Post 1185727)
After first batch of optimization, maybe it will be time for extras-devel?

No way this could be swallowed by autobuilder :(. The only way it can be pushed is by binary distribution.

freemangordon 2012-03-29 19:43

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by DavyP (Post 1185731)
JBenchmark:

http://davy.preuveneers.be/phoneme/p...mo/jbenchmark/

Note: only JBenchmark and JBenchmark2 work. The others require
more JSR support

Davy

Thanks a lot.

OK, second optimization pass (memcpy is gone), JBenchmark2 result(same conditions)

landscape - 972
portrait - 804

going to try your benchmarks, will post theresults here.

DavyP 2012-03-29 19:46

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by freemangordon (Post 1185734)
Thanks a lot.

OK, second optimization pass (memcpy is gone), JBenchmark2 result(same conditions)

landscape - 972
portrait - 804

going to try your benchmarks, will post theresults here.

Nice! And no flickering?

Davy

freemangordon 2012-03-29 19:48

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by DavyP (Post 1185729)
If you would repeat the experiment multiple times, you will notice
that the 2% below is even below the error margin. So I am very
doubtful there is any improvement at all :-)

And about the memcpy: I am pretty sure you will bump into
synchronization issues between two event loops (one of phoneme
and one of the Qt4 frontend). The phoneME backend calls a
method in the Qt4 frontend to say it is time to paint the buffer. The
Qt4 front-end will emit an asynchronous signal. By the time this
signal is processed the original buffer has changed, resulting in
flickering and painting of intermediate frames if you use the
original buffer.

But feel free to experiment, you never know ... :-)

Davy

actually your libcvm.so build is set-up to use double-buffering :p

so... no flickering ;)

EDIT:
But anyway I will add some synchronization, just in case, it could lower the results a bit, but will make sure there will be no flicker under any conditions

EDIT2:
with DavyP's benchmarks:

JBenchmark, landscape only (seems does not like portrait) - 5845

JBenchmark2:
landscape - 978
portrait - 906

DavyP 2012-03-29 20:31

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Another remark:

It is possible that the above results are not accurate for another reason. The performance results are measured based on what happens in the event loop of phoneME. This event loop triggers in the Qt4 front-end app a signal emit. So most of what you measure is computation related, not screen IO related. The actual repainting is done in the event-loop of the Qt4 front-end, and it is possible that in this event-loop multiple repaint events are coalesced into a single one (i.e. a single screen update). So the actual painting time in the Qt4 event loop is not included in the benchmark, and the actual screen updates could be lower than what you measure.

Davy

freemangordon 2012-03-29 20:53

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by DavyP (Post 1185767)
Another remark:

It is possible that the above results are not accurate for another reason. The performance results are measured based on what happens in the event loop of phoneME. This event loop triggers in the Qt4 front-end app a signal emit. So most of what you measure is computation related, not screen IO related. The actual repainting is done in the event-loop of the Qt4 front-end, and it is possible that in this event-loop multiple repaint events are coalesced into a single one (i.e. a single screen update). So the actual painting time in the Qt4 event loop is not included in the benchmark, and the actual screen updates could be lower than what you measure.

Davy

But the same could happen with your code, i.e. there is no check if the current buffer has been painted before doing memcpy over it. And it is less possible to happen without memcpy, as there are 2 screens buffers used by libcvm, against just 1 when memcpy is used. Anyway, i will implement some buffer synchronization, I promise :).

On the other hand both threads are CPU bound, so when there is less overhead (because there is no memcpy for every screen buffer), the computational thread is given more CPU shares to do its job, so I believe the benchmark results are pretty corect.

DavyP 2012-03-29 22:00

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by freemangordon (Post 1185777)
But the same could happen with your code, i.e. there is no check if the current buffer has been painted before doing memcpy over it. And it is less possible to happen without memcpy, as there are 2 screens buffers used by libcvm, against just 1 when memcpy is used. Anyway, i will implement some buffer synchronization, I promise :).

On the other hand both threads are CPU bound, so when there is less overhead (because there is no memcpy for every screen buffer), the computational thread is given more CPU shares to do its job, so I believe the benchmark results are pretty corect.

True. I don't check before the memcpy either as I don't want to force paint every frame either if the device cannot keep up.

Anyway, I don't want to discourage you in any way. The only point I wanted to make is that I am always careful with interpreting benchmarks, especially if I don't know what they are measuring :-),
but any frame rate improvement you can squeeze out of it would be most welcome.

Cheers,
Davy

freemangordon 2012-03-29 22:44

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by DavyP (Post 1185808)
True. I don't check before the memcpy either as I don't want to force paint every frame either if the device cannot keep up.

So without memcpy it is better because of the 2 buffers.

Quote:

Anyway, I don't want to discourage you in any way. The only point I wanted to make is that I am always careful with interpreting benchmarks, especially if I don't know what they are measuring :-),
but any frame rate improvement you can squeeze out of it would be most welcome.

Cheers,
Davy
Well, I am not the one who would understand conversation like that as discouraging. Not that I could be discouraged easy :D . And yes, bencmarks could be pretty misleading, I fully agree with you, but while we lack a better tools, we have to stick to what we have :)

wwweagle 2012-03-30 06:37

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by DavyP (Post 1185205)
I actually had some fun disassembling the device. I bought a new digitizer to replace the scratched screen at Tmart.com for 8 EUR, but unfortunately it is missing the metal frame at the back with the 6 screw holes and I cannot seem to separate the metal frame from the original one. Should anyone have some tips where to buy this instead, they are most welcome :-).
Davy

First things first, thanks so much for everything.
We have whatever phone parts you can imagine on sell in China. I had fun changing my n900 screen once. And digitizer plus frame like this (titled"original n900 outer screen", price is 85CNY, roughly 8 euro) can be easily bought and mostly reliable (I can't guarantee they are 100% original though). If you have friends traveling in china, I can send them the part. Sending by mail is also possible but might be slow and a bit expensive.

freemangordon 2012-03-30 09:03

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
@DavyP

OK, buffer synchronization added, the results(same conditions as in previous runs):

JBenchmark - 3400 :o

JBenchmark2:
landscape - 1002
portrait - 920

After all there WERE multiple repaint events coalesced into a single one for JBenchmark :) , anyway, everything is fine now. What I did not expect is higher result for JBenchmark2 :confused:

Later today I will try to upload cvm code on gitorious, so you can look into it and run the benchmarks on your own if you wish. Just have in mind that my libcvm is compiled with -mvfp, -mcortex-a8 and export CVM_ARM_HAS_WMMX=true, so your result might be a little bit lower because of missing those optimizations . I suspect my cvm won't work correctly on Harmattan (as I removed pixmap rotation), but that could be easily fixed by using appropriate #ifdefs

I wonder if using QML or GLES will speed rendering. But as for now a speedup of 16% for landscape and 21% for portrait seems enough.

[DarkGUNMAN] 2012-03-30 14:21

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Unrelated to the technical discussion but relevant for Opera Mini users.. I'm curious to see if others are having the same problem.

As of last night Opera Mini v6.5 stopped downloading pages. Network test showed I had a working connection on WiFi or 2G.
I had a look around for other versions to try, found the official OM v4.4 - same issue since it is a new browser.

I tried downloading the Handler versions so I could try different servers or direct to the OM4 servers instead - still won't work since it detects the version of Mini you are running.


Only working versions at the moment are v4.2, and V5 (which I am using for the moment).

EDIT: V6 is working

hugh.jf.chen 2012-03-30 14:59

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by [DarkGUNMAN] (Post 1186083)
Unrelated to the technical discussion but relevant for Opera Mini users.. I'm curious to see if others are having the same problem.

As of last night Opera Mini v6.5 stopped downloading pages. Network test showed I had a working connection on WiFi or 2G.
I had a look around for other versions to try, found the official OM v4.4 - same issue since it is a new browser.

I tried downloading the Handler versions so I could try different servers or direct to the OM4 servers instead - still won't work since it detects the version of Mini you are running.


Only working versions at the moment are v4.2, and V5 (which I am using for the moment).

EDIT: V6 is working

I have no problem with Opera Mini 6.5.

DavyP 2012-03-31 13:32

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by freemangordon (Post 1185978)
@DavyP

OK, buffer synchronization added, the results(same conditions as in previous runs):

JBenchmark - 3400 :o

JBenchmark2:
landscape - 1002
portrait - 920

After all there WERE multiple repaint events coalesced into a single one for JBenchmark :) , anyway, everything is fine now. What I did not expect is higher result for JBenchmark2 :confused:

Later today I will try to upload cvm code on gitorious, so you can look into it and run the benchmarks on your own if you wish. Just have in mind that my libcvm is compiled with -mvfp, -mcortex-a8 and export CVM_ARM_HAS_WMMX=true, so your result might be a little bit lower because of missing those optimizations . I suspect my cvm won't work correctly on Harmattan (as I removed pixmap rotation), but that could be easily fixed by using appropriate #ifdefs

I wonder if using QML or GLES will speed rendering. But as for now a speedup of 16% for landscape and 21% for portrait seems enough.

Which cross-compiler are you using?

/scratchbox/compilers/cs2007q3-glibc2.5-arm7/bin/arm-none-linux-gnueabi-gcc does not like the -mvfp -mcortex-a8 command
line options.

Davy

freemangordon 2012-04-01 20:16

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
1 Attachment(s)
Quote:

Originally Posted by DavyP (Post 1186463)
Which cross-compiler are you using?

/scratchbox/compilers/cs2007q3-glibc2.5-arm7/bin/arm-none-linux-gnueabi-gcc does not like the -mvfp -mcortex-a8 command
line options.

Davy

Yep, the same. Find attached my build scripts.

Going to upload cvm sources on gitorious.

EDIT:

cvm sources here

Arthuro_Adam 2012-04-02 09:26

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by DavyP (Post 1184842)
I have not changed anything w.r.t to the N9 implementation.
On the N9 emulator, the midlets also start in landscape mode
when the device is positioned in portrait mode.
I cannot test auto-rotate with the emulator, though if I remember
correctly, some people claimed auto-rotation worked for them (I
might be wrong).

I presume you have the same issue with other midlets beyond
Opera Mini (e.g. microemu-demo)?

The only easy fix I can think of is adding another entry in the
midlet settings that would rotate the midlet in the other direction.

Davy

I have the same issue, but a few release back, Opera Mini start in portrait mode and you can choose landscape mode on the settings. Unfortunately I don't remember, what was the last release, the OM works great (except auto-rotation).

Thanks for your work.

DavyP 2012-04-03 11:58

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by Arthuro_Adam (Post 1187134)
I have the same issue, but a few release back, Opera Mini start in portrait mode and you can choose landscape mode on the settings. Unfortunately I don't remember, what was the last release, the OM works great (except auto-rotation).

Thanks for your work.

If you are willing to try which build worked for you before, I can
have a shot at figuring out which change broke portrait mode for
Opera Mini. Here you can find some old builds:

http://davy.preuveneers.be/phoneme/public/maemo/deb/

Also, since installation settings of Opera Mini remain after
reinstalling a different deb, it might be a good idea to clean the
/opt/phoneme directory.

Davy

Arthuro_Adam 2012-04-04 08:07

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by DavyP (Post 1187518)
If you are willing to try which build worked for you before, I can
have a shot at figuring out which change broke portrait mode for
Opera Mini. Here you can find some old builds:

http://davy.preuveneers.be/phoneme/public/maemo/deb/

Also, since installation settings of Opera Mini remain after
reinstalling a different deb, it might be a good idea to clean the
/opt/phoneme directory.

Davy

Ok, today I will test it.

Arthuro_Adam 2012-04-05 07:22

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
I tested it. The march 7 release had good Opera Mini orientation, but the march 8 had not.

I check the march 7 release. Sound was good, but didn't find the location.jad to check the GPS.

DavyP 2012-04-05 11:34

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by Arthuro_Adam (Post 1188270)
I tested it. The march 7 release had good Opera Mini orientation, but the march 8 had not.

I check the march 7 release. Sound was good, but didn't find the location.jad to check the GPS.

Thanks for testing! The location feature was added afterwards, so that is normal.

Just to be sure: you did install the MeeGo builds and not the Maemo builds right?

The reason why I ask is because I checked the source of 2 backups of March 5 and March 11, and I added a.o. a rotation feature:

#ifdef Q_WS_MAEMO_5
setAttribute(Qt::WA_Maemo5AutoOrientation, true);
setAttribute(Qt::WA_Maemo5NonComposited);
#endif

However, due to the ifdef macro, this code is excluded for the MeeGo builds (presuming you did not install the Maemo build on your MeeGo device).

Another change is the fact I added multimedia and location features that rely on the Qt Mobility libraries. So I may have to produce a few test builds to really identify which change caused the portrait mode issue.

Davy

Arthuro_Adam 2012-04-05 15:27

Quote:

Originally Posted by DavyP (Post 1188353)
Quote:

Originally Posted by Arthuro_Adam
I tested it. The march 7 release had good Opera Mini orientation, but the march 8 had not.

I check the march 7 release. Sound was good, but didn't find the location.jad to check the GPS.

Thanks for testing! The location feature was added afterwards, so that is normal.

Just to be sure: you did install the MeeGo builds and not the Maemo builds right?

The reason why I ask is because I checked the source of 2 backups of March 5 and March 11, and I added a.o. a rotation feature:

#ifdef Q_WS_MAEMO_5
setAttribute(Qt::WA_Maemo5AutoOrientation, true);
setAttribute(Qt::WA_Maemo5NonComposited);
#endif

However, due to the ifdef macro, this code is excluded for the MeeGo builds (presuming you did not install the Maemo build on your MeeGo device).

Another change is the fact I added multimedia and location features that rely on the Qt Mobility libraries. So I may have to produce a few test builds to really identify which change caused the portrait mode issue.

Davy

I installed the MeeGo one. Thanks for your work, I hope you'll find the problem.

demludi 2012-04-05 18:56

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Nimbuzz working on N900 !!!

http://talk.maemo.org/showthread.php...hlight=nimbuzz

octave 2012-04-06 09:57

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Whenever i chose http as proxy server on opera mini 6.5 it doesn't work.why

Dragoss91 2012-04-08 19:54

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
I can't run Nimbuzz , the app doesn't open when I use run MIDlet , it opens a white screen then close in a half of second . Same on N900

DavyP 2012-04-09 15:36

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by Arthuro_Adam (Post 1188444)
I installed the MeeGo one. Thanks for your work, I hope you'll find the problem.

Can I ask you another favor? I am not entirely sure the dates of the builds I put online before match with the dates of the backups (some local changes may only got integrated in a build I uploaded days after). Could you test the following builds again:

http://davy.preuveneers.be/phoneme/p...aemo/deb/test/

These do not match with the ones you tested earlier as I recompiled them again. However, this time I made sure I have the matching build configuration files and sources, which should help me to hopefully find the cause of the orientation problem.

Thanks,
Davy

ivgalvez 2012-04-09 16:05

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Hi DavyP,

Are you considering to optify (move the stuff out of rootfs) the application?. Actually 4 Mbs is way too much and I had to uninstall it to be able to update to latest CSSU.

Joseph9560 2012-04-09 19:45

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
it has already optified, try latest build.

Arthuro_Adam 2012-04-09 22:26

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by DavyP (Post 1190116)
Can I ask you another favor? I am not entirely sure the dates of the builds I put online before match with the dates of the backups (some local changes may only got integrated in a build I uploaded days after). Could you test the following builds again:

http://davy.preuveneers.be/phoneme/p...aemo/deb/test/

These do not match with the ones you tested earlier as I recompiled them again. However, this time I made sure I have the matching build configuration files and sources, which should help me to hopefully find the cause of the orientation problem.

Thanks,
Davy

I tested the 7th, the 8th, the 11th neither of them was good (both started in landscape mode) and the 6th version was good.

I hoped that will help you.

hoa2ngminh 2012-04-10 09:49

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
1 Attachment(s)
I want to play the game "Di tim trieu phu" (Milionaire), but could not. I can not help. Thank's

DavyP 2012-04-10 12:22

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by Arthuro_Adam (Post 1190232)
I tested the 7th, the 8th, the 11th neither of them was good (both started in landscape mode) and the 6th version was good.

I hoped that will help you.

Thanks,

The code changes between the 6th and the 7th were not that significant, except for the fact that I changed some command line parameters, i.e. "portrait" and "noportrait" became "rotate" and "norotate" respectively.

If you used "-portrait" in some startup scripts, then this may explain this change in behavior. I changed the naming, because if you enabled the old portrait option and if your display was already in portrait mode, then the midlet would be shown in landscape mode rather than portrait mode.

I created a new build in which I add the old command line parameters again, and mapped them on the new ones (portrait -> rotate, and noportrait -> norotate).

I uploaded a new test build at http://davy.preuveneers.be/phoneme/p...aemo/deb/test/

You can also check the default rotate/portrait behavior in the MIDlet Settings application.

Cheers,
Davy

DavyP 2012-04-10 12:23

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by octave (Post 1188757)
Whenever i chose http as proxy server on opera mini 6.5 it doesn't work.why

I don't have the sources to Opera Mini to figure out what it is trying to do, so I am afraid I cannot help you with this one.

Davy

DavyP 2012-04-10 12:24

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by demludi (Post 1188540)

Nice to hear that it works (although I am not a Nimbuzz user myself).

Davy

freemangordon 2012-04-10 12:53

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
@DavyP - did you look at cvm code I pushed on gitorious and my build scripts?

DavyP 2012-04-10 13:34

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by freemangordon (Post 1190398)
@DavyP - did you look at cvm code I pushed on gitorious and my build scripts?

Yes, but I have not come around to integrate your changes into my build.

I noticed that you removed the static buffer in which I copied all the pixels from the original framebuffer pointer when phoneME tells me to draw the buffer. My code relied on this buffer when I emited a Qt4 signal to draw the buffer.

You pass along the original pointer directly to the Qt4 front-end. Using the original pointer is a bit dangerous. By the time the refresh signal gets processed and the buffer gets painted, the contents and the size of the original framebuffer pointer may have changed, causing bad repaints or even segmentation faults. This has to do with the inner workings of phoneME, and the asynchronous handling of Qt4 signals.

Before, I actually implemented it more or less the way you did it (without the static buffer), and I got segmentation crashes when I was playing some animation (continuous repaints) while changing the display size (going full screen).

I will first do some testing to see whether your code suffers from the same problem before integrating your changes in my latest code.

Cheers,
Davy

freemangordon 2012-04-10 16:03

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by DavyP (Post 1190410)
Yes, but I have not come around to integrate your changes into my build.

I noticed that you removed the static buffer in which I copied all the pixels from the original framebuffer pointer when phoneME tells me to draw the buffer. My code relied on this buffer when I emited a Qt4 signal to draw the buffer.

You pass along the original pointer directly to the Qt4 front-end. Using the original pointer is a bit dangerous. By the time the refresh signal gets processed and the buffer gets painted, the contents and the size of the original framebuffer pointer may have changed, causing bad repaints or even segmentation faults. This has to do with the inner workings of phoneME, and the asynchronous handling of Qt4 signals.

Before, I actually implemented it more or less the way you did it (without the static buffer), and I got segmentation crashes when I was playing some animation (continuous repaints) while changing the display size (going full screen).

I will first do some testing to see whether your code suffers from the same problem before integrating your changes in my latest code.

Cheers,
Davy

Hmm, but I actually don't allow phoneME to draw to a buffer which is still in use by Qt. Have in mind that we have TWO buffers used in sequence. And there is a (lame) spinlock protecting currently used buffer, look

here: https://gitorious.org/cvm-qt/cvm/blo...in.cpp#line139

and here: https://gitorious.org/cvm-qt/cvm/blo...er.cpp#line162

That way when a new buffer needs to be painted, we don't return control to PhoneME until the old one is still painted by Qt, preventing PhoneME from using it ;). Sure, this synchronization could be implemented without the overhead of using QMap, but as POC it should be good enough.

DavyP 2012-04-10 16:25

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by freemangordon (Post 1190461)
Hmm, but I actually don't allow phoneME to draw to a buffer which is still in use by Qt. Have in mind that we have TWO buffers used in sequence. And there is a (lame) spinlock protecting currently used buffer, look

here: https://gitorious.org/cvm-qt/cvm/blo...in.cpp#line139

and here: https://gitorious.org/cvm-qt/cvm/blo...er.cpp#line162

That way when a new buffer needs to be painted, we don't return control to PhoneME until the old one is still painted by Qt, preventing PhoneME from using it ;). Sure, this synchronization could be implemented without the overhead of using QMap, but as POC it should be good enough.

You are right. I did not notice the usleep() you use to synchronize between both event loops. You indeed do not need a QMap to synchronize (a dirty flag will do). The pointer passed along to repaintPixmap() is often the same anyhow.

Also, I wonder if you could speed things up by waiting a bit longer than usleep(1), i.e. 1 microsecond. I don't know how fine-grained the N900's default timer resolution is, but if it would be that accurate, you are spending a lot of CPU with busy waiting. I think somewhere between 1 to 10 milliseconds (or 1000 to 10000 microseconds) might improves things as you sleep longer per iteration, leaving more time for the other threads to complete the repainting. I have not tested this though, as you would have to count how often you execute the cycle in a benchmark setup (where you try to paint as fast as possible).

Cheers,
Davy

freemangordon 2012-04-10 17:30

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by DavyP (Post 1190464)
You are right. I did not notice the usleep() you use to synchronize between both event loops. You indeed do not need a QMap to synchronize (a dirty flag will do).

Absolutely, it could be optimized further, but as I told you that was just a POC and I was lazy to use/implement atomic integer operations or to read through the net if operations on u32 type are atomic on ARM7 :o .

Quote:

The pointer passed along to repaintPixmap() is often the same anyhow.
Disagree, framebuffer frontend uses backbuffering, i.e. two buffers used for consecutive painting. BTW i had put some qDebug() in repaintPixmap and can assure you, that those two buffers are rotated, i.e. you never have one and the same pointer for two consecutive repaintPixmap calls.

Quote:

Also, I wonder if you could speed things up by waiting a bit longer than usleep(1), i.e. 1 microsecond. I don't know how fine-grained the N900's default timer resolution is, but if it would be that accurate, you are spending a lot of CPU with busy waiting. I think somewhere between 1 to 10 milliseconds (or 1000 to 10000 microseconds) might improves things as you sleep longer per iteration, leaving more time for the other threads to complete the repainting. I have not tested this though, as you would have to count how often you execute the cycle in a benchmark setup (where you try to paint as fast as possible).

Cheers,
Davy
Yeah, I was thinking the same, a proposed delay should be pretty enough.

santiago 2012-04-12 03:50

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
1 Attachment(s)
Happy easter, sorry for the ******!
Anyway, Davy Nimbuzz doesnt work. It's not fully supported by your JVM becouse it needs to be maybe remapped?! Anyway... I have a problem with the Facebook app. The new facebook app has to store some data, but this version doesnt, becouse of the vm maybe, it doesnt save username and password. In the error log, there's not nothing about this kind of problem,this is the Facebook official APP, can you make something to fix this error? i add the Jar file down here... Thx 1000

Cristian

Arthuro_Adam 2012-04-14 11:47

Re: [TESTING] PhoneME Advanced (Java Mobile) prototype release
 
Quote:

Originally Posted by DavyP (Post 1190382)
Thanks,

The code changes between the 6th and the 7th were not that significant, except for the fact that I changed some command line parameters, i.e. "portrait" and "noportrait" became "rotate" and "norotate" respectively.

If you used "-portrait" in some startup scripts, then this may explain this change in behavior. I changed the naming, because if you enabled the old portrait option and if your display was already in portrait mode, then the midlet would be shown in landscape mode rather than portrait mode.

I created a new build in which I add the old command line parameters again, and mapped them on the new ones (portrait -> rotate, and noportrait -> norotate).

I uploaded a new test build at http://davy.preuveneers.be/phoneme/p...aemo/deb/test/

You can also check the default rotate/portrait behavior in the MIDlet Settings application.

Cheers,
Davy

I tested, but the problem is there. OM starts in landscape mode.


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

vBulletin® Version 3.8.8