Running continuous video recording lua script via chdkptp causes crash - page 2 - Script Writing - CHDK Forum  

Running continuous video recording lua script via chdkptp causes crash

  • 25 Replies
  • 6149 Views
*

Offline reyalp

  • ******
  • 14121
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #10 on: 02 / December / 2021, 16:15:50 »
Advertisements
Quote
Do you get the same crash if you run the script manually on the camera while chdkptp is connected?
Yes, just tried that. It crashes.
Quote
How about if you just try to record video while chkdptp is connected?
Crashes as well.
So it seems like the real problem is recording video while a PTP connection is active.

The ExMemMan assert suggests either there isn't enough free exmem, or the Canon firmware is configured in such a way it assumes video recording and PTP will not happen at the same time.

SX230 has CHDK in exmem, which might be a factor, but SX260 does not. Can you post the sx260 romlog?

Quote
I have also updated the chdkptp version but did not help. Using r964.
Yes, very unlikely to have much to do with chdkptp itself.
Don't forget what the H stands for.

*

Offline obi

  • *
  • 27
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #11 on: 02 / December / 2021, 17:28:08 »
Quote
The ExMemMan assert suggests either there isn't enough free exmem, or the Canon firmware is configured in such a way it assumes video recording and PTP will not happen at the same time.
Right and we see that when we are recording a movie and suddenly connect the USB port, the recording stops and the camera switches to playback mode with screen off but does not crash. It crashes the other way around.

Thanks for looking into it. ROMLOG for the SX260 attached.

con 3>  =return get_buildinfo()
4:return:table:{platform="sx260hs",build_date="Oct  7 2021",build_number="1.5.1",build_time="23:37:03",version="CHDK",platsub="100c",build_revision="6020",digic=50,platformid=12868,os="dryos"}
con 4>

*

Offline reyalp

  • ******
  • 14121
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #12 on: 02 / December / 2021, 22:56:52 »
Right and we see that when we are recording a movie and suddenly connect the USB port, the recording stops and the camera switches to playback mode with screen off but does not crash. It crashes the other way around.
Right, using the normal Canon firmware, you'd never be able to record video with USB connected, so maybe we should be more surprised it does work on some models. FWIW, I think I've recorded video with PTP active on most of my cams, so not all models are affected.

elph130 has a similar issue shooting when wifi is active, where the exmem allocation for wifi makes a shooting related on fail on half press. I initially thought it might be the same function, but it doesn't appear to be.
Quote
ROMLOG for the SX260 attached.
Thanks, that's definitely the same assert as the sx230. It might theoretically be possible to work around, but I don't think it would be a simple constant change like the video time limit.

It might be interesting to see what the exmem inspector module shows when PTP is connected, and when video is recording. Go to Miscellaneous Stuff->Tools->EMEM Inspector
Press SET to start logging
Leave the module by exiting alt with the alt key (not the menu button)
Record a video, connect and disconnect PTP
Return to the inspector module, press LEFT to save the log.

Log is written to CHDK/LOGS/EXM_nnnn.LOG
Don't forget what the H stands for.

*

Offline obi

  • *
  • 27
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #13 on: 03 / December / 2021, 10:21:13 »
Thanks. Below are the contents of CHDK/LOGS/EXM_nnnn.LOG. Please note that this did not cause any crash. Anyhow, when it crashes, I can't collect those logs I guess.

sx230hs, 101a

TIME,TYPE,ADDRESS,SIZE
59330,MOVIE_REC     ,443fc000,0358a800
73340,MOVIE_REC     ,00000000,00000000
74260,FILESTORE     ,4338d500,045f9300
74430,COM           ,47886800,00100000
74430,FILESTORE     ,4338d500,044f9300
80740,COM           ,00000000,00000000
80740,FILESTORE     ,4338d500,045f9300


*

Offline reyalp

  • ******
  • 14121
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #14 on: 03 / December / 2021, 13:09:58 »
Thanks. Below are the contents of CHDK/LOGS/EXM_nnnn.LOG. Please note that this did not cause any crash. Anyhow, when it crashes, I can't collect those logs I guess.
Yes, this just shows us where and how big the exmem blocks are allocated normally.
59330,MOVIE_REC     ,443fc000,0358a800
=>  ends at 47986800
PTP area
74430,COM           ,47886800,00100000

which is in the last 1MB of the MOVIE_REC. This seems very similar to the problem I see with wifi on elph130.

FILESTORE is only allocated in playback, and appears to use a smaller size when when PTP is active.
Don't forget what the H stands for.

*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #15 on: 03 / December / 2021, 16:00:32 »
For some fun between debugging:  :)
Same CHDK as compiled for my 101b without ExMem trouble, 4h lowres video and ptp 240p life-view.
(needs? dial at <P>, not StdVideo)
Free mem after ptp connection -> rec -> play :
« Last Edit: 03 / December / 2021, 16:09:55 by Caefix »
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 14121
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #16 on: 03 / December / 2021, 17:09:00 »
For some fun between debugging:  :)
Same CHDK as compiled for my 101b without ExMem trouble, 4h lowres video and ptp 240p life-view.
(needs? dial at <P>, not StdVideo)
Free mem after ptp connection -> rec -> play :
So, if I can translate, you are able to record low res video with PTP connected, when CHDK is built without exmem?
160 KB free is not really enough for CHDK to work properly (lua.flt 130k on disk), but might be usable in some specific cases.
edit: Oops, 160K is CHDK size, free space (actually largest free block) is 275, which might be marginally OK.

SX260 port doesn't have exmem enabled by default though  :blink:
« Last Edit: 04 / December / 2021, 16:03:23 by reyalp »
Don't forget what the H stands for.

*

Offline obi

  • *
  • 27
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #17 on: 03 / December / 2021, 17:41:21 »
For some fun between debugging:  :)
Same CHDK as compiled for my 101b without ExMem trouble, 4h lowres video and ptp 240p life-view.
(needs? dial at <P>, not StdVideo)
Free mem after ptp connection -> rec -> play :
For me it works after I copied your build files onto my SD card which already had CHDK 1.5. It seems to also work on AUTO position and higher resolutions. I need to test it a bit more.

One thing I noticed, is that while recording without ALT mode, I don't seem to have access to the SD card. ls -l returns nothing. In alt mode, I can't download an already existing file whose path I already had.

con 42> d -nolua A/DCIM/137___12/MVI_8045.MOV MVI_8045.MOV
ERROR: General Error

Is this normal?

Also when the video is recording, you can't (re)connect PTP and if you try a couple of times, a crash happens.
« Last Edit: 03 / December / 2021, 17:46:23 by obi »


*

Offline reyalp

  • ******
  • 14121
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #18 on: 03 / December / 2021, 23:42:51 »
One thing I noticed, is that while recording without ALT mode, I don't seem to have access to the SD card. ls -l returns nothing. In alt mode, I can't download an already existing file whose path I already had.

con 42> d -nolua A/DCIM/137___12/MVI_8045.MOV MVI_8045.MOV
ERROR: General Error

Is this normal?
Yes. You can try Miscellaneous-> Enable Unsafe IO

As the name suggests, it comes with no warranty ;)
Background https://chdk.setepontos.com/index.php?topic=9986.30

Quote
Also when the video is recording, you can't (re)connect PTP and if you try a couple of times, a crash happens.
Can you post a romlog from this one?
Don't forget what the H stands for.

*

Offline obi

  • *
  • 27
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #19 on: 04 / December / 2021, 03:00:13 »
Quote
Yes. You can try Miscellaneous-> Enable Unsafe IO
It does not help actually.

Quote
Can you post a romlog from this one?
Attached. I think it happened when I was downloading a file and a video recording was started and then I did Ctl+C on the chdkptp prompt and tried to connect a couple of times.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal