Extra modules - page 2 - General Discussion and Assistance - CHDK Forum

Extra modules

  • 20 Replies
  • 10167 Views
Re: Extra modules
« Reply #10 on: 25 / June / 2016, 16:04:02 »
Advertisements
Actually I got one smp_xxx.jpg file ....contains a csv of zeroes, for 128 ticks. I guess that's me saving nothing to the file before I sample....no chance after crash.
« Last Edit: 25 / June / 2016, 16:08:43 by 62ndidiot »

*

Offline srsa_4c

  • ******
  • 4451
Re: Extra modules
« Reply #11 on: 25 / June / 2016, 16:08:11 »
Actually I got one smp_xxx.jpg file ....contains a csv of zeroes, for 128 ticks.
"Save sampled content to file" just saves the buffer, regardless of its content. If there are no samples, you just get zeroes.

Re: Extra modules
« Reply #12 on: 25 / June / 2016, 16:12:33 »
Quote
I used to get weird exceptions like that when I was attempting 1000 samples/sec. Try lowering the sample rate (on the OPT page).

An HP timer based memory sampling method could be developed for use over PTP, but I never attempted that (it would require bigger amount of work on both CHDK and chdkptp side).
I have it set at once per second...
I wouldn't need a repeating timer for PTP, I'd just take random snapshots and compare them. I don't know however, how fast the index variable is changing...that could be a problem.  I'm assuming it is quite slow, like human scale slow, if nothing is going on in the camera

*

Offline srsa_4c

  • ******
  • 4451
Re: Extra modules
« Reply #13 on: 25 / June / 2016, 16:19:52 »
Quote
I used to get weird exceptions like that when I was attempting 1000 samples/sec. Try lowering the sample rate (on the OPT page).
I have it set at once per second...
It can be that my code is not entirely correct, or that it has problems on newer D6 cameras.
What is the version of the arm-none-eabi compiler you're using?
Quote
I wouldn't need a repeating timer for PTP, I'd just take random snapshots and compare them. I don't know however, how fast the index variable is changing...that could be a problem.
The camera live view is usually 30fps. It might be higher in newer higher end cameras, I don't know.

An alternative for you could be sampling your desired mem locations to a buffer, in spytask - problem is, spytask cycles only once per 20 milliseconds.

Re: Extra modules
« Reply #14 on: 25 / June / 2016, 16:45:48 »
Quote
What is the version of the arm-none-eabi compiler you're using?

$arm-none-eabi-gcc --version
arm-none-eabi-gcc (4.8.3-18ubuntu2+12) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

maybe wait for @reyalp to see if g7x likes SMP mode

*

Offline srsa_4c

  • ******
  • 4451
Re: Extra modules
« Reply #15 on: 28 / June / 2016, 18:33:36 »
Turns out, the 1 sample/second setting was indeed locking up the camera. The option was there but I never tried using it, apparently.
I have changed the slowest option to 2 samples/second - it appears to be working.
For a sample rate of one-per-second, are you programming the HP timer directly with that interval or do you use a series of smaller intervals ?
If just a single interval surely that is at or beyond the timer limit and will cause a crash ?
The intervals are used directly, there's no countdown or similar. The issue may have been caused by an over-the-spec delay.

BTW, if DMP mode is working, I'd expect SMP mode working too. Both are using an HP timer to do the sampling.

Re: Extra modules
« Reply #16 on: 29 / June / 2016, 00:04:16 »
10 per sec works in smp mode. It's a mystery why dmp mode works at 1 per second.  I'll post the dump on the sx60hs thread tomorrow:)

*

Offline srsa_4c

  • ******
  • 4451
Re: Extra modules
« Reply #17 on: 21 / November / 2016, 20:50:05 »
QR code decoder module. Only supports DIGIC II...5 cameras with 4:3 displays at the moment. Read commit message for credits.
Needs the following 2 new exports to compile:
Code: [Select]
Index: modules/module_exportlist_eabi.inc
===================================================================
--- modules/module_exportlist_eabi.inc (revision 4723)
+++ modules/module_exportlist_eabi.inc (working copy)
@@ -26,3 +26,5 @@
     __bswapsi2
     __aeabi_ui2d
     __aeabi_d2uiz
+    __aeabi_fadd
+    __aeabi_fsub

edit:

Usage notes for the first release.

The module (shows up under Miscellaneous stuff -> Tools) can be started in either record or playback mode. It will use the current Canon LCD buffer contents which is usually pretty low resolution (720x240 for old cameras and newer low end cameras, 720x480 for newer higher spec models, 960x240 or more on wide screen models).
Changing the output device (TV-out, HDMI) makes the camera reconfigure the buffer resolution which will likely prevent the module from working.

When the module is running:
Press SET to scan what's on the LCD (processing needs several seconds), press MENU to exit the module. A selection of keys (up-down-left-right-zoom-halfshoot) is passed over to the Canon UI, so you should be able to scan a bunch of pictures in playback mode without exiting the module.
Especially on more detailed QR codes, you may need to re-try several times until it manages to decode the content. Zooming in/out and moving the (magnified) image around the LCD may help. The code needs to have a good contrast and has to be non-smeared. I've never been able to decode the version 25 and 40 examples on the QR code wiki page, so only lower res QR's will work.
« Last Edit: 22 / November / 2016, 19:42:50 by srsa_4c »

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Extra modules
« Reply #18 on: 22 / November / 2016, 16:56:41 »
QR code decoder module.
Very nice!
A little bit slow with the A720. But it works reliably. A possibility to store the content would be practical.

This might be also an alternative to provide small scripts or other text files.

msl
CHDK-DE:  CHDK-DE links

*

Offline srsa_4c

  • ******
  • 4451
Re: Extra modules
« Reply #19 on: 22 / November / 2016, 20:14:08 »
Very nice!
Thanks.
Quote
A little bit slow with the A720.
Yes, the ARM core on DIGIC II and III only runs at 36 MHz. The library used by the module (quirc) uses a lot of floating point calculations which is slow when using software floating point.
Quote
A possibility to store the content would be practical.
I have considered that, as QR codes can be generated on PCs and phones - it could be a wireless (one-directional) communication for cameras without Wi-fi.

Quote
This might be also an alternative to provide small scripts or other text files.
Yes, if this work gets included in CHDK, we could gather ideas on how to use it.

I'm currently trying to boost the decoding performance (and I could use some help). The quirc library is unfortunately not the best performer (zbar had better recognition performance when I was evaluating them on PC). But, zbar is way more complex and I did not even attempt porting it.

However, my main problem is transforming the 720 pixel wide input into 320 pixel width. The first version of the code simply takes pixels from the pixel row like: 0, 2, 4, 6, 9, 11, 13, 15, 18, ...
That means, there's a jump after every 4th source pixel - surely not a good thing for the decoder. The sampler code is in qr_acquire() in qrdec.c.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal