Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Player One Astronomy's Camera driver #442

Merged
merged 7 commits into from
Aug 31, 2021
Merged

Add Player One Astronomy's Camera driver #442

merged 7 commits into from
Aug 31, 2021

Conversation

hiro3110i
Copy link
Contributor

I made a new ccd driver which will be enable Player One Astronomy's Camera in indilib.
It was based on ASI Camera driver and tested by Neptune-C II on MacOS and Raspberry Pi4 within the existing KStars 3.5.4.
However, I don't know sure all functionalities of those cameras.
And I only have Neptune-C II.
Could you please support me to optimize the code?

Copy link
Collaborator

@knro knro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this looks great overall. Pending issues:

  • Debian files (just base them on libasi and indi-asi under debian directory, should be straight forward).
  • Documentation: We need to add this camera documentation (including screenshots) to INDI Devices portal.

libplayerone/99-player_one_astronomy.rules Outdated Show resolved Hide resolved
libplayerone/99-player_one_astronomy.rules Outdated Show resolved Hide resolved
indi-playerone/playerone_ccd.cpp Show resolved Hide resolved
@knro knro self-assigned this Aug 29, 2021
@hiro3110i
Copy link
Contributor Author

I'm very sorry, I cannot build it on Linux now.
However, binary files for Linux library were mistaken by Windows one.
I have corrected these Linux issues.
In addition, x86 library for Linux is not provided from manufacturer. (only x64 is supported)

@hiro3110i hiro3110i requested a review from knro August 30, 2021 15:34
@hiro3110i
Copy link
Contributor Author

I'm very sorry, I cannot build it on Linux now.
However, binary files for Linux library were mistaken by Windows one.
I have corrected these Linux issues.
In addition, x86 library for Linux is not provided from manufacturer. (only x64 is supported)

I have prepared Ubuntu 20.04 LTS environment as a virtual machine.
And I have tested Linux version on Ubuntu.
Now build and test could be passed on Ubuntu.

@knro
Copy link
Collaborator

knro commented Aug 30, 2021

Thank you, still need the debian files as well. You can start of from debian/indi-asi and debian/libasi

so we need debian/indi-playerone and debian/libplayerone

@hiro3110i
Copy link
Contributor Author

Thank you, I understood what is debian folder.
I have copied debian/libasi and debian/indi-asi to debian/libplayerone and debian/indi-playerone.
I think, these files were properly rewritten for PlayerOne Cameras.

Copy link
Collaborator

@knro knro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bravo! Looks good to go. Can you please submit the documentation for the driver next so we can add it to INDI website?

@knro knro merged commit 33dbd7b into indilib:master Aug 31, 2021
@hiro3110i
Copy link
Contributor Author

I uploaded driver information and device photo from 'Add your listing here'.
But I couldn't write something in 'Description' field.
How can I make a document about it?

@knro
Copy link
Collaborator

knro commented Aug 31, 2021

You can attach a zip file here with all the images and a text document with the description and I'll add it to the website, thanks!

@hiro3110i
Copy link
Contributor Author

Could you please review attached document which has just pasted screen capture images?
indi_playerone.doc.zip

@knro
Copy link
Collaborator

knro commented Aug 31, 2021

Thanks, it's uploaded now!

https://indilib.org/ccds/player-one-astronomy-cameras.html

Btw, what are the Guide North/South..etc in Controls for? do they conflict with the guide controls under the Guider tab?

@hiro3110i
Copy link
Contributor Author

Wow, I was surprised to see it. Thank you so much for your effort.
To be honest, I'm not familiar to ST4 auto guiding functionalities. (only experienced by PHD2 through Synscan)
As far as I can see the SDK, the API was similar to the ASI camera, so I decided to inherit it.
Any advice is welcome.

@knro
Copy link
Collaborator

knro commented Aug 31, 2021

Does setting the "Guide North" for example in Controls causes ST4 pulse? if yes, they should be removed from there since they already exist in the Guider tab. Maybe you can check if the name starts with Guide and then skip the control?

@hiro3110i
Copy link
Contributor Author

I'll confirm ST4 guiding control as soon as possible.
But it is same implementation of ASI cameras.
According to my understanding, on/off of guiding should be set in Controls tab,
and amount of guiding control should be set in Guider Control tab. Is that right?

I apologize for your inconvenience, but I have a request for you.
I want to replace the photo and screenshot in the document.
I'm concerned that the camera is not centered and the GUI is in Japanese.
Corrected files are attached here. Very sorry for your time.
indi_playerone.photos.zip

@knro
Copy link
Collaborator

knro commented Sep 1, 2021

If there is ST4 guiding, it should be separated to its own property. The problem now is that if you set one number, ALL numbers are updated along with it so it's better to put them in their own property, or two properties (ST4 West/East and ST4 North/South)

@hiro3110i
Copy link
Contributor Author

Now I understand ST-4 guiding a little bit.
I'll consider how can I make it better, thank you!

@knro
Copy link
Collaborator

knro commented Sep 14, 2021

Can you please check armv8 library? It fails to build on arm64. I just checked and the file itself is indeed 32bit.

libPlayerOneCamera.bin: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=3f45ebf371b3563f027efabff39bbc5efffb75e8, not stripped

@hiro3110i
Copy link
Contributor Author

I'm checking with a PlayerOne engineer about armv8 issue, thank you!

@hiro3110i
Copy link
Contributor Author

Sorry for late reply. As you said, actually armv8 library was 32bit built because 64bit Pi OS is still unstable.
However, 64bit version will be released in a few days. We have to wait a moment.

@knro
Copy link
Collaborator

knro commented Sep 23, 2021

Thanks, it is very important since this is now blocking INDI PPA on arm64.

@knro
Copy link
Collaborator

knro commented Sep 24, 2021

Many users are suffering from issues in installing INDI on arm64 platforms because of this: https://indilib.org/forum/general/10408-indi-1-9-2-ubuntu-21-10-armf.html

Can you please let know if they will submit the library soon? or should I disable libplayerone from arm64 entirely for the time being?

@hiro3110i
Copy link
Contributor Author

I saw the discussion in the forum. Sorry for the confusion.
PlayerOne engineer is very supportive, but he seems to be busy right now.
He says 64bit library will be sent to me in a few days.
Let's wait until the end of September.

Almost everything will be shutdown at least two weeks during China's National Day in October.
It might be better to disable the 64bit version if it is not released by the end of September.

On the other hand, is it possible to unblock INDI PPA only for the 32-bit version?
It is quite working well in my environment (32bit Pi OS).

@knro
Copy link
Collaborator

knro commented Sep 25, 2021

Thanks, yes I've just blocked it now on arm64 architecture until we get a proper library for that.

@hiro3110i
Copy link
Contributor Author

I received an e-mail from PlayerOne engineer just now.
He has already embarked on a 64-bit build.

@hiro3110i
Copy link
Contributor Author

Thank you for your patience.
Today, I received 64bit armv8 library from PlayerOne engineer.
Could you please unzip attached zip and replace libPlayerOneCamera.bin under libplayerone/armv8?
libPlayerOneCamera.bin.zip

Please let me know if I should commit and pull request to your repository.

@knro
Copy link
Collaborator

knro commented Sep 26, 2021

THanks it's done, let's wait and see how the build process goes.

@hiro3110i
Copy link
Contributor Author

How was the build of Arm 64bit version of PlayerOne cameras?
I think debian/indi-full/control should be corrected if there are no issues.

@knro
Copy link
Collaborator

knro commented Sep 29, 2021

It went successfully! https://code.launchpad.net/~mutlaqja/+recipe/libplayerone-nightly

I will update the code, thank you for your help and followup!

@hiro3110i
Copy link
Contributor Author

I noticed a bug in my driver. It depends pixel format.
I'd like to fix it as soon as possible.

RAW8 has no issues, I think. Actually, I'm using RAW8 in KStars 3.5.5 on the Raspberry Pi4.
But other formats cannot be recorded correctly in the FITS file.
File size of FITS looks correct for all formats.
But the content of the pixel value is something wrong.
I'm suspecting that the format on the camera side is not switched correctly.

At this point, an essential question arose. It's about base class of indi ccd.
I believe RAW8 and RAW16 can be handled in this base class because this class is based on the image sensor.
And MONO8 (debayered 8bit full resolution mono image) should be able to handle in this class.
But how can I handle RGB24?
Of course, I can prepare appropriate size of buffer for RGB24.
Is it enough to fill the buffer with RGB pixel data?
How is the FITS header generated correctly for RGB24?

I wrote this driver based on the ASI camera driver.
RGB24 are supported but buffer size of RGB24 is not correct even in the ASI driver.
Should I exclude RGB24 from the driver? (RGB24 may not be fit to indi ccd...)

I'd appreciate if you could advice me.

And one more thing, PlayerOne camera driver which is included in KStars 3.5.5 is crashed for MacOS.
I don't know why but I can use the driver which is built by myself.
Somehow the dependency may not be resolved.

@knro
Copy link
Collaborator

knro commented Oct 18, 2021

RGB24 works in ASI driver, I have two ZWO camera and they both work fine. The format for FITS RGB is that each color plane is stored separately. What's exactly not correct?

@hiro3110i
Copy link
Contributor Author

Thank you for confirmation about RGB24.
I read asi_camera_test.cpp to learn more about buffer size of RGB24.
It is not correct for RGB24 so I'll fix the code in playerone_camera_test.cpp (but it is not main driver code, sorry).

I think the buffer size is correctly estimated even in my driver code because file size of FITS is correct for each format.
However, my driver cannot record FITS file correctly except for RAW8 now.
The content of buffer (pixel value) is incorrect despite copying the return value of the SDK.

I'm checking the difference from ASI driver. I guess that the camera format wasn't changed correctly.
It is always fixed to RAW8 or something like that.
So I have to check return value of pixels using playerone_camera_test.cpp.
Therefore I confused buffer size of RGB24. Now I understand current situation, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants