×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Cannot play back SER videos?

Yes absolutely. You can checkout the documentation + video here: indilib.org/develop/developer-manual/163...ent-environment.html

Basically, in Ekos, you select "remote" but keep the host as localhost. You can then start INDI driver on command line, or preferably in QtCreator so you can debug easily as shown above.
4 years 2 weeks ago #51500

Please Log in or Create an account to join the conversation.

Hello Any update on this issue? Have you made any progress?
4 years 1 week ago #51604

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 31
Here in Denmark we have had clear skies for several days in a row now so I have not spent much time on debugging the issue yet.
But my development setup is ready (following the link you sent) and Ihave verified that I am able to debug the local indi code by connecting in Ekos as you described above.
Everything is working, now I just need some time to debug and see what I can discover :-)

Yesterday, I read through the INDI developer manual to get a better understanding before I start debugging.
4 years 1 week ago #51605

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 31
I just gave it a try.
My breakpoints in this file are activated and stops the debugger:
/indi/indiserver.c

But unfortunately my breakpoints in this file are not activated and does not stop the debugger:
/indi/libs/stream/streammanager.cpp

Do I need to attach the debugger to another process in order to catch the breakpoints in this file?

---
Here is what I did:
Build Configuration set to Debug in Qt Creator.
Run settings set to indiserver with these parameters:
-v indi_simulator_ccd indi_simulator_telescope

Selected Debug -> indiserver in the lower left of Qt creator.
Clicked Start Debugging button.

indiserver starts up and I am able to connect to it using KStars.
Breakpoints in the indiserver code is activated but not breakpoints in any other "module".

I also tried selecting Debug -> indi_simulator_ccd
Before I started debugging and this activated breakpoints in the indi_simulator_ccd code but now the indiserver is not running.

I then tried to debus indi_simulator_ccd and start the indiserver on the side.
But here it does not look like any breakpoints are activated at all :-)

Any tips on how to debug different parts of indi in Qt Creator would be nice.
Last edit: 4 years 1 week ago by Stefan R..
4 years 1 week ago #51646

Please Log in or Create an account to join the conversation.

Yes, put set follow-fork-mode child in the GDB options. Check below:



You can also start it as:
-v ./indi_simulator_ccd indi_simulator_telescope

Then whenever you make changes to the CCD simulator, you can simply compile and run again without running sudo make install. Please note that when you stop the debugger, it does not kill indiserver. So if you want to truly restart the indiserver, you must type in a terminal pkill indiserver before clicking debug again.
4 years 1 week ago #51659
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 31
Thank you, that helped a lot.
Now my breakpoints are activated in all different parts of the code.

However, as soon as I start "Live Video" in the CCD module of Ekos in Kstars with CCD Simulator, the debugger exits without stopping anywhere.
In Tools -> Options -> GDB Extended I have checked "Stop when qFatal() is called" and "Stop when abort() is called" but apparently none of those are called when it stops.

Below in the spoiler you can find the content of the Debugger log at that time.
Kstars/Ekos continues behaving normally after the debugger stops.
The CCD Simulator continues showing live view as if nothing happened.

Have you experienced this issue with sudden debugger exit before?

Warning: Spoiler!


I decided to try with my real ToupCam device connected (and the indi_toupcam_ccd driver started) and here the debugger does not exit, so now I am able to debug what happens while streaming.
I will take a closer look at that one of the next days.
Last edit: 4 years 1 week ago by Stefan R..
4 years 1 week ago #51689

Please Log in or Create an account to join the conversation.

Sorry should have been more clear. For INDI, use set follow-fork-mode child. For KStars, this option must be disabled. Just edit the settings and add # next to it to disable it. Unfortunately, QtCreator does not support per-project GDB settings, so you'd just have to remember to check the setting when you open INDI or KStars in there. Open two qtcreators, one for KStars (with the option disable) and for one INDI (option enabled) and then it should work as expected.
The following user(s) said Thank You: Stefan R.
4 years 1 week ago #51697

Please Log in or Create an account to join the conversation.

  • Posts: 77
  • Thank you received: 1
I can report that I experience the exact same error with videos recorded with my ZWO ASI 294MC Pro camera (and actually also using the CCD Simulator!).
How can I change the SER-file header to see if that helped?
SkyWatcher ED80 Pro
Skywatcher HEQ5 Pro with Rowan Belt Mod with EQDIR cable
ZWO ASI294MC Pro imaging camera
QHY5L-II-C guide camera on 50mm guidescope
DeepSkyDad AF3 autofocuser
Raspberry Pi 4 4GB running Kstars/Ekos
4 years 5 days ago #51818

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 31
In my case I was not able to recover the video files by modifying the SER-file header.
My camera has a 12 bit ADC but the INDI camera driver only allows to configure streaming as 8-bit or 16-bit.
Unfortunately, when configured to 16-bit, the output SER-files are corrupted beyond repair with my camera.
But when configured to 8-bit it works fine. (as long as I don't zoom the streaming)

I think we are experiencing an issue similar to what is described here (but that issue is regarding FITS files and another piece of software so it is not exactly the same):
www.astropixelprocessor.com/community/ma...n-16-bit-fits-files/

I am still planning to debug and see if I can figure out exactly where in the code it happens.
But I have not had the time to focus on it yet.
Last edit: 3 years 11 months ago by Stefan R..
3 years 11 months ago #52049

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 31
But if you want to try and see if you can save your files by modifying the SER-file header you can download a hex editor like HxD and edit the SER-file.
I found that information about the resolution of the video is found at Offset = 00000010
column 0A-0B = pixel resolution X = 0050 = 1280
column 0E-0F = pixel resolution Y = C003 = 960

And information about bit depth is found at Offset = 00000020
column 02 = bit depth = 08

And you can use an online tool like www.save-editor.com/tools/wse_hex.html to convert your decimals to HEX.
For example type 960 in the Decimal number field and check "Little Endian" checkbox and click "DEC to HEX" button to see that 960 for example should be written as C003 in the SER-file Header as Hex.

However, as I mentioned I was not able to save my files by adjusting the bit-depth in the header.
Last edit: 3 years 11 months ago by Stefan R..
3 years 11 months ago #52051

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 31
To sum up I have identified these streaming issues:
1. SER video data is always being dumped as full resolution data by INDI even though subframe/crop is configured in Ekos CCD module. Sub framing does not currently work.
2. SER video data is always being dumped as 8-bit data by INDI which may be "works as designed"(?), but unfortunately the bit depth written to the SER File Header is the bit depth that is configured in the INDI Control panel and not the actual bit depth of the data dumped in the file. This corrupts the files.
3. SER video data is always being dumped as full resolution data by INDI, but the video width and height that is written to the SER File Header is the width and height configured in the INDI Control panel and not the actual width and height configured in the Ekos CCD Module in the "Frame" and "Size" fields. This corrupts the files.

Debugging #1
I did a little bit of debugging today and here is what I found so far regarding issue #1.

When connecting KStars to Indi Server we enter
StreamManager::setSize - Here frame size is set based on the "Resolution" setting in INDI control panel on the "Controls" tab for the camera (for my camera default is 1280 x 960 pixels).

and we also enter
StreamManager::setPixelFormat - Here pixelformat is set based on the "Format" setting in INDI control panel on the "Controls" tab for the camera (for my camera default is Mono 16-bit).

In Kstars -> Ekos CCD Module I updated these values from the default values (default values in these fields before my update were Frame X: 0 Y: 0 and Size W: 1280 H: 960)
I updated the values to:
Frame X: 100 Y: 100
Size W: 640 H: 480

And then I clicked the "Live Video" button and start recording and then we enter
StreamManager::newFrame

From here we enter
StreamManager::asyncStream

And in here
npixels is calculated to be 1228800 and nbytes is 2457600 (as received via NewFrame parameter).
I don't know enough about the math behind this to tell if these numbers are right or wrong.

Then we enter
StreamManager::uploadStream

In here SubX, SubY, SubW and SubH are set to:
SubX=0
SubY=0
SubW=1280
SubH=960


A bit later there is an if expression with this comment:
// Check if we need to subframe

The conditions of the if expression are not met due to the values that was set above (they were set incorrect in my opinion).

However, the image is uploaded to the client (full frame) and control is returned to
StreamManager::asyncStream

Since isRecording() is true, we enter
StreamManager::recordStream

The parameters are:
buffer 2
nbytes 1228800

And we quickly enter
SER_Recorder::writeFrame

where the frame is written and we are done processing this frame.

My Thoughts
It looks like the values filled out in Ekos -> CCD module in the Frame and Size fields never gets passed on to INDI and this is why INDI always dumps full resolution data.
But I have not found out why the SER File Header gets the correct values. Maybe Jasem knows where that part is done?

Anyway, the combination of the right resolution values in the SER File Header (compared to what the user expects) and the "wrong" resolution of the actual SER video data dumped in the file causes the files to be corrupted.

I know too little about INDI and Kstars/Ekos to be able to figure out a good solution. I don't know if it is possible to update the properties used to set the SubX, SubY, SubW and SubH values with the values from the Ekos CCD module when the recording is started or when the live view button is clicked.
But if it is possible I guess it might solve both issue #1 and issue #3.

To solve issue #2 it would be nice to know where in the code the SER File Header is written. If it is "works as designed" that INDI always dumps 8-bit SER Video data in the files, then 8-bit should always be written as bit depth in the SER File Header. That would solve issue #2.

However, I would prefer if it was possible to dump 16-bit and 12-bit SER Video data in the files and have the correct bit-depth in the SER File Header. But the above solution is much better than the way it currently works, so this last part could be a feature request for future version.
3 years 11 months ago #52700

Please Log in or Create an account to join the conversation.

Thank you for the investigation! So in INDI v1.8.5 I updated the stream manager code a bit so that now it does not downscale from 16 to 8 when recording (only done for the streaming frame). I haven't yet check the cropping/ROI part, I know this works for streaming but have to check for recording as well.
The following user(s) said Thank You: Jim, Stefan R.
3 years 11 months ago #52888

Please Log in or Create an account to join the conversation.

Time to create page: 0.999 seconds