maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   mbarcode (https://talk.maemo.org/showthread.php?t=34996)

lardman 2010-09-27 18:05

Re: mbarcode
 
Quote:

Originally Posted by fms (Post 826647)
Two issues I have found in the current mbarcode:
1) It is not quite clear when mbarcode actually makes a shot. More than once I continued feverishly clicking the shutter button.

Atm it's scanning all the time and pushing the shutter button down half way makes it focus if the auto-focus is off. I agree though that we should have some kind of graphical and audio indication that something has been scanned successfully.

I'm also going to add the option to use the shutter button to focus then perform processing (for e.g. 3s after the button is pressed), which should save cpu cycles and make the normal display smoother (no need to have the decoder threads running in the bg all the time.)

Quote:

Originally Posted by fms (Post 826647)
2) Once you click on one of the plugins, the application seemingly hangs, and may continue in this state for a minute or so (while it is searching for your barcode). It should show the "busy" status instead (rotating thingie in the menu bar may do).

I noticed this today, but what I saw was that the list of plugins came up pretty quickly, but then when I was tapping buttons there was no graphical response (though eventually the plugin did open.)

This is especially odd as the plugin I wanted to use was the plain "display text" one, which should be pretty lightweight. I need to look into this as it's not acceptable to have delays like this.

dragly 2010-09-27 18:10

Re: mbarcode
 
The graphical response missing is probably due to something set up wrongly in the GUI. Either in the custom delegate used for painting, or just in the selection settings for the table view.

If there is a delay in other plugins than Informed Individual, then there is something seriously wrong. Maybe there is some lag after closing the pipeline? I'll try to look into it when I have the time, as well.

lardman 2010-09-27 18:23

Re: mbarcode
 
Quote:

Originally Posted by dragly (Post 827579)
An indicator is a very good idea. At the moment, there is also some problems with the list not giving the user any feedback when an item is actually clicked. I'll see if I can figure this out.

Most plugins react almost instantaneously on my device, but the Informed Individual server is down (the project is in an early alpha stage) and because of this, the plugin uses a huge amount of time to wait for the request to the server to time out. So if this is the plugin in question, I experience the same delay without any user feedback, as well.

Depending on the complexity of the plugin, we might need to thread the plugin callbacks, especially for plugins that perform web-lookups.

dragly 2010-09-27 21:38

Re: mbarcode
 
If I remember correctly, the network requests made in Qt are done in a separate thread. That's why you need to connect a slot for the network reply, whenever that returns. The problem with the Informed Individual plugin is that it currently does not give any user feedback before it receives a network reply, but it does not block the GUI, though.

In other words, there is no GUI-blockage when you hit the Informed Individual plugin. Just try to go back to scanning after pressing the plugin button.

On the other hand, making the clickAction() of a plugin into a threaded signal/slot system might be useful to avoid plugins locking up the whole application.

lardman 2010-09-28 13:22

Re: mbarcode
 
As an aside, I've just pushed the skeleton of a plugin to handle Python plugins. I need to push PythonQT to extras-devel asap and then work out the structure of Python plugins and fill in the useful code, but I have at least started (finally! ;))

The reason for using a plugin to host multiple plugins is to stop it being necessary for people to include the additional PythonQT startup overhead and dependencies unless they are using a Python plugin.

Anyway, I'm working on it :)

lardman 2010-09-28 21:37

Re: mbarcode
 
Just looking at the code to add in the alternative shutter button action and wondering how much of the startup time is due to using OpenGL?

Dragly have you done any benchmarking? Any other thoughts about getting a functional UI up faster?

As another aside, I wonder if we should load the plugins in a thread/in the bg somehow to prevent the slowdown that will probably occur when they are loaded the first time a barcode is scanned?

protrek 2010-09-28 22:31

Re: mbarcode
 
After installing Mbarcode to my N900 the camera would not work. I only get a errormessage internal error, camera will be closed.
Had to uninstall mbarcode and addons.

Wikiwide 2010-09-28 22:50

Re: mbarcode
 
Quote:

Originally Posted by protrek (Post 828779)
After installing Mbarcode to my N900 the camera would not work. I only get a error message internal error, camera will be closed.
Had to uninstall mbarcode and addons.

Strange... I have mbarcode 0.2.2-4, the latest version, and experience no such problems whatsoever.

lardman 2010-09-29 08:41

Re: mbarcode
 
Quote:

Originally Posted by protrek (Post 828779)
After installing Mbarcode to my N900 the camera would not work. I only get a errormessage internal error, camera will be closed.
Had to uninstall mbarcode and addons.

Probably not an mBarcode problem tbh as it works for everyone else. Rebooting tends to fix a non-behaving camera.

If it really does seem to be linked to mBarcode, I'd be interested to see the output of the camera app from the command line when you try to run it, and also the dmesg and DSP logs.

lardman 2010-09-29 08:42

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 828755)
Just looking at the code to add in the alternative shutter button action and wondering how much of the startup time is due to using OpenGL?

Dragly have you done any benchmarking? Any other thoughts about getting a functional UI up faster?

I've been looking at FCamera, which uses nice overlays for the camera controls and histogram but doesn't use OpenGL. I'll try converting the UI to use plain Qt overlays and see what the performance is like.

Edit: OTOH it may use OpenGL itself, in which case I won't bother :) - I'll look and see!

No, it doesn't use OpenGL (so there's still the chance it will be quicker). Instead it uses the overlay layer provided by the framebuffer hardware. I suppose it should be possible to encapsulate the overlay stuff in a class and then be able to easily swap between OpenGL and framebuffer overlay. The FCamera people have wrapped the overlay stuff in a class - see OverlayWidget.cpp in the FCamera Garage project.

lardman 2010-09-29 15:44

Re: mbarcode
 
Ok, I've just pushed two updates, both of which could probably do with some more C++ polishing.

The first is to move the plugin searching and loading to a thread, so that there is no time spent loading them when the first results page is displayed. The thread runs in the bg once the UI has been brought up and the UI will block for the thread if somehow a barcode is scanned straight away.

The second is to give an option to use the shutter button either as focus/save image with continuous scanning, or as focus/scan with scanning occurring for 3s after the button is pressed.

This means the normal display is smoother most of the time (as no scanning is taking place) and should reduce CPU usage while things aren't being scanned. I've not added a way to change the scan time, but we should really do that, and I've added a rather nasty looking Hildon message bar to tell us that it's scanning, which should probably be changed to something that looks cool, like a Cylon-styke blip moving along the "line up here" bar in the middle of the screen.

lardman 2010-09-29 17:28

Re: mbarcode
 
I'll take a look at making the overlay/normal display interface generic tomorrow so we can test using openGL vs. fb overlays.

lardman 2010-09-30 17:45

Re: mbarcode
 
I've got the non-openGL interface more or less up and running, but without overlays.

Apparently overlays are not actually required and it should be possible to draw directly ontop of the xvimagesink, but this only works sometimes, and the rest of the time the xvimagesink video stream takes over the whole window. Not sure what the problem is here, but I'll get to the bottom of it eventually.

While doing this, I've been thinking that really rather than a splash screen it would probably be better to open the application with the history list showing and then load the GStreamer pipeline in the background.

I'll have a look at how to do this later on this evening. I also need to push PythonQT to extras-devel. /me writes some notes to self :)

protrek 2010-09-30 22:47

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 829038)
Probably not an mBarcode problem tbh as it works for everyone else. Rebooting tends to fix a non-behaving camera.

If it really does seem to be linked to mBarcode, I'd be interested to see the output of the camera app from the command line when you try to run it, and also the dmesg and DSP logs.

I did try a restart of the phone but the camera did not work. After removing all programs that had Mbarcode it start working again.
I think it was 5 or 6 apps/addons with Mbarcode in the name or somthing i had to remove. The last one was Mbarcode main program, and after that my camera worked again.
I can try install it again after he weekend and see if i just was unlucky with the install.

Other Camera apps i have is BlessN900

lardman 2010-09-30 23:49

Re: mbarcode
 
Quote:

Originally Posted by protrek (Post 830473)
I did try a restart of the phone but the camera did not work. After removing all programs that had Mbarcode it start working again.
I think it was 5 or 6 apps/addons with Mbarcode in the name or somthing i had to remove. The last one was Mbarcode main program, and after that my camera worked again.
I can try install it again after he weekend and see if i just was unlucky with the install.

Other Camera apps i have is BlessN900

Please do try again, there's no reason why mBarcode or any of its plugins should interfere with normal camera operation (other than to kill the camera app when mBarcode is running to stop it taking the focus)

coderedcomputing 2010-10-01 01:05

Re: mbarcode
 
firstly i am totally stoked to see this app come to fruition... secondly, installed mBarcode from the repository, grabbed a book and with minimal user errors got the barcode translated into the app. nicely done. as well, camera is functioning as normal for pics & video.

so the plan is for this to check amazon et al for pricing? hot damn.

fms 2010-10-01 05:17

Re: mbarcode
 
"Search Internet" does not appear to work at all in the latest version. Weird.

lardman 2010-10-01 09:44

Re: mbarcode
 
Quote:

Originally Posted by coderedcomputing (Post 830536)
firstly i am totally stoked to see this app come to fruition... secondly, installed mBarcode from the repository, grabbed a book and with minimal user errors got the barcode translated into the app. nicely done. as well, camera is functioning as normal for pics & video.

so the plan is for this to check amazon et al for pricing? hot damn.

Yeah I'm writing some Python code in the background (read slowly) to do that. My Python code is going to be a database though, and will run outside mBarcode (as you might want to look at the database without needing to run mBarcode) using the ExternalDBusPlugin to receive data.

If anyone has any suggestions or code snippets they would be gladly received (in C++ or Python) and we'll see if we can get something up and running asap as we should also provide a quick summary of Amazon items on the 1D results page.

Once I get the Python plugin stuff working it should make it easier for people to write quick plugins.

lardman 2010-10-01 09:44

Re: mbarcode
 
Quote:

Originally Posted by fms (Post 830633)
"Search Internet" does not appear to work at all in the latest version. Weird.

I'll have a look at it, thanks.

Wikiwide 2010-10-08 07:00

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 829377)
Ok, I've just pushed two updates, both of which could probably do with some more C++ polishing.

The first is to move the plugin searching and loading to a thread, so that there is no time spent loading them when the first results page is displayed. The thread runs in the bg once the UI has been brought up and the UI will block for the thread if somehow a barcode is scanned straight away.

The second is to give an option to use the shutter button either as focus/save image with continuous scanning, or as focus/scan with scanning occurring for 3s after the button is pressed.

This means the normal display is smoother most of the time (as no scanning is taking place) and should reduce CPU usage while things aren't being scanned. I've not added a way to change the scan time, but we should really do that, and I've added a rather nasty looking Hildon message bar to tell us that it's scanning, which should probably be changed to something that looks cool, like a Cylon-styke blip moving along the "line up here" bar in the middle of the screen.

Impatient to see the next version of mbarcode.

dragly 2010-10-08 09:25

Re: mbarcode
 
Hi guys,

Sorry about the lack of updates from my side. Been a bit busy, and it seems like maemo.org didn't want to notify me about new replies to this thread before today.

Just wanted to point out that I messed around with the overlay stuff for quite some time before going down the OpenGL path. The problem is that the xvimagesink overlay, as lardman points out, doesn't behave like expected. I experienced two outcomes which neither were positive. Either xvimagesink took over the whole window, like lardman wrote about just now, or the overlayed buttons or icons got a black box background.

If we figure this out without using OpenGL, it would be the very best solution. But if I'm not wrong, the FCamera app has these problems as well. The overlay there is cluttered with a black box background on all controls.

I guess we have to decide if we want smooth camera movement or want to avoid black boxes around the controls. Personally, I find the boxes very ugly, but if the OpenGL method still is giving bad performance even after lardman's latest improvements, I guess it might be better to go with performance.

What do you guys think?

Wikiwide 2010-10-08 09:42

Re: mbarcode
 
Quick reply...
I suppose black boxes are not that bad. Performance is more important, in my humble opinion. Maemo Camera has black stripe behind its white controls, at least on my device.

lardman 2010-10-10 17:59

Re: mbarcode
 
No, I've concluded that OpenGL does the job and really it doesn't look like it adds much to the startup time.

It would certainly be useful for startup time to move the GStreamer pipeline setup, etc., to a thread so that the UI is brought up sooner. I'll take a look at this.

dragly 2010-10-10 19:49

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 837830)
No, I've concluded that OpenGL does the job and really it doesn't look like it adds much to the startup time.

It would certainly be useful for startup time to move the GStreamer pipeline setup, etc., to a thread so that the UI is brought up sooner. I'll take a look at this.

Glad to hear that. I hope we can stick with the OpenGL UI and still have good performance. It looks much better than what at least I am able to achieve without it.

I'll try to debug some more myself and see if I can figure out why there is some delay between the scan finishes and the results window is shown. Unless you've found anything on this, lardman?

lardman 2010-10-11 14:59

Re: mbarcode
 
Quote:

Originally Posted by dragly (Post 837893)
I'll try to debug some more myself and see if I can figure out why there is some delay between the scan finishes and the results window is shown. Unless you've found anything on this, lardman?

The one thing I spotted was that there's a 0.5s delay between the scan finishing and the plugin list being populated. The plugins are asked every 0.5s whether they can handle the barcode in question (ResultsWindow::checkPlugins()), and originally the timer callback was used to do the first call. I've commited a fix for this by simply calling the checkPlugins() immediately as the timer is setup.

I will do some more digging to see what else might be causing problems. Is the results window created at startup? It might be worth having it loaded and hidden to make the transition quicker (though this would cause slowdowns at startup - argh! ;))

dragly 2010-10-11 15:08

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 838441)
The one thing I spotted was that there's a 0.5s delay between the scan finishing and the plugin list being populated. The plugins are asked every 0.5s whether they can handle the barcode in question (ResultsWindow::checkPlugins()), and originally the timer callback was used to do the first call. I've commited a fix for this by simply calling the checkPlugins() immediately as the timer is setup.

I will do some more digging to see what else might be causing problems. Is the results window created at startup? It might be worth having it loaded and hidden to make the transition quicker (though this would cause slowdowns at startup - argh! ;))

Ah, of course. I guess you're right. The timer is probably causing some of the delay. Calling the slot directly is probably a good idea :)

The ResultsWindow is loaded at startup, yes.

lardman 2010-10-11 15:26

Re: mbarcode
 
Quote:

Originally Posted by dragly (Post 838449)
Ah, of course. I guess you're right. The timer is probably causing some of the delay. Calling the slot directly is probably a good idea :)

The ResultsWindow is loaded at startup, yes.

Might be worth adding a one-shot timer slot for that then, so that it's not added to the startup lag. Alternatively it should be possible to do in a thread, as there shouldn't be any access issues (even though threads are not supposed to access GUI elements.)

coderedcomputing 2010-10-11 18:57

Re: mbarcode
 
Just loaded the most recent version from dev, loving it. The auto scan without hitting the shutter worked great in the local thrift store, and after I added the US amazon link...wham results (resale is bleh put that book back) lol

Looking great!

lardman 2010-10-16 16:21

Re: mbarcode
 
Right, I have just uploaded libpythonqt, which is a package of PythonQt (http://pythonqt.sourceforge.net/). Now I just ;) need to get the pythonqt wrapper plugin working (and with that test whether libpythonqt works too).

lardman 2010-10-18 12:40

Re: mbarcode
 
Right, the plugin has also compiled successfully, which is nice. I'll do some testing this evening on both the python plugin and external DBus plugin and (crossing fingers) let you know whether things are working + post some skeleton example plugin codes.

Really need to split up that QRcode plugin now I think about it again, and implement mecards....

lardman 2010-10-19 09:12

Re: mbarcode
 
So no great news yet, but the PythonQt and DBus plugins compile and install and are loaded by mBarcode, but they don't currently receive any signals from the rest of the plugin arch (i.e. no qDebug() output from their barcodeAnalysed() callbacks).

If anyone's bored and fancies doing some debugging then the more the merrier! :)

I also see that Dragly (I don't remember doing it myself anyway!) very kindly moved the vCard import code to use the QtMobility functions, which means it should now be reasonably trivial to construct a contact object by parsing the mecard contents. Again if anyone fancies doing some work on that, that would be good, otherwise I'll sort it out once I've got these wrapper plugins working properly.

lardman 2010-10-19 09:19

Re: mbarcode
 
Ah, I've realised why the plugin sinks don't receive anything, I'd based my code on the old plugin structure and ignored the (relatively) new stuff such as QSet<PluginAction*> Plugin::getPluginActions().

I'll sort that out this evening.

fms 2010-10-19 11:51

Re: mbarcode
 
Any hope you will fix the mbarcode version that is currently in the Extras*? It hangs for a very loong while, without reporting any progress, when trying to use plugins (web search plugin, actually).

lardman 2010-10-19 12:39

Re: mbarcode
 
Once I've got these extra plugins sorted I'll push an update to Extras-*, sorry for the delay.

lardman 2010-10-19 12:50

Re: mbarcode
 
I've just looked and websearch plugin seems to work in its current form (0.1.15-1, which hasn't been changed since August afaict), what version are we talking about here and what's the problem?

Edit: looks like this is the version currently in Extras-devel too: http://repository.maemo.org/extras-d...in-webrequest/

OTOH, the mBarcode UI appears un-responsive while the Hildon conic (is that the name, I forget) web connection popup is being prepared, which we should probably fix.

lardman 2010-10-19 13:08

Re: mbarcode
 
In fact the buttons appear unresponsive full stop, nothing to do with the libconic stuff. I need to tap each twice quickly to get it to respond. I'm trying to find out what's up with that now.

As I've been bust writing plugins rather than using existing ones I've not noticed this. Sorry!

lardman 2010-10-19 13:24

Re: mbarcode
 
Right, I've fixed the un-responsiveness, firstly by only looking for plugins that were slow to respond ever 1000ms, and secondly by only re-creating the plugin button list if a new plugin is found.

I have noticed though that the list uses custom delegates and these don't have any way to show they have been pressed. I need to do some reading to work out what I should do in ResultsWindow::on_tblResults_clicked(QModelIndex index) to re-paint this list item with some extra colour added. Any thoughts/ideas appreciated.

I'll push an update to extras-devel this evening come what may, though I want to reduce the start up delay by moving the gst pipeline setup to a thread before we push this to extras-testing.

fms 2010-10-19 15:03

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 845033)
Right, I've fixed the un-responsiveness, firstly by only looking for plugins that were slow to respond ever 1000ms, and secondly by only re-creating the plugin button list if a new plugin is found.

Yes, yes, yessss!

Quote:

I'll push an update to extras-devel this evening come what may, though I want to reduce the start up delay by moving the gst pipeline setup to a thread before we push this to extras-testing.
As I have had -Devel permanently enabled for months now, this is not a problem, personally. :)

lardman 2010-10-19 20:00

Re: mbarcode
 
Ok, I've just pushed a new version of mBarcode (for Fremantle) to the extras-devel builder. The plugins are all the same, but the main program should be a bit more responsive, and also allows you to select either continuous scanning (with half shutter to focus if you don't want continuous focus, and full shutter to record an image) or scan when the shutter is pressed (for iirc 3s after the shutter is pressed, half-press does focus, to save an image use the on-screen button)

I've not managed to get the results window to let you know which button you've pressed, I'll look at this (and if anyone knows about custom delegates for QListViews please pipe up) nor have I worked out why the PythonQt and ExternalDBus wrapper plugins aren't receiving events yet.

I'll look at all of these, but just no more tonight! :)

Please let me know if there are any issues with the new version of mBarcode.

mrsellout 2010-10-19 20:56

Re: mbarcode
 
This is yet another great app for the n900. I've been using it for a few months now and it keeps getting better and better and I want to say thanks... THANK YOU!

Right you asked for feedback and I'll provide. Yes it does startup quicker. It does feel smoother and the scan on request feature is great. There is one slight issue with the new build though. On startup the display gives a high fps reading (~70fps) until one opens the camera shutter. Now I don't open the shutter first because that loads the camera app, and sometimes it's a while before I actually use the app after starting it. I use this app in conjunction with PresenceVNC so I can copy the barcode into a proprietory Windows application. Sometimes the program needs to be started up and logged into. And sometimes a customer comes into the shop and I have to put the phone down and serve them, all before realising that I've not opened the shutter. So you can understand my concern.

One more thing if I may, can you enable the scan to be activated by the spacebar? I tend to use the app with the keyboard open and it's not that easy using the shutter button with the screen up.

This is still a fantastic app even with the little issues.

Thanks again,

mrsellout


All times are GMT. The time now is 08:47.

vBulletin® Version 3.8.8