Author Topic: Sailfish and the camera module  (Read 3403 times)

vader

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Sailfish and the camera module
« on: July 02, 2018, 06:12:50 pm »
The camera module accessory is detected by sailfish, however the camera app shows the image upside down. I made a quick hack of the camera qml file to get it displaying correctly, however it needs some work. I also noticed that the resolution of the photos is 1280x720 - obviously some default resolution. I am looking in to setting this properly and will create a patch/app/workaround when I get it working. Other than that it seems to work well.

Will post when I get it working.

Meganerd

  • Newbie
  • *
  • Posts: 34
    • View Profile
Sailfish and the camera module
« Reply #1 on: July 02, 2018, 06:15:40 pm »
Thanks for posting about this!

I was very curious since I am debating on getting the camera addition.

vader

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Sailfish and the camera module
« Reply #2 on: July 03, 2018, 05:52:22 pm »
Update: I have the rear camera displaying correctly, and the image is stored with the correct orientation (hard coded to landscape inverted). I have also managed to add the full sensor resolution. The only thing left is to select the rotation based on which camera (front/rear). Simple, but I ran out of time last night. The images are in line with what others have posted, however if you decrease the exposure, they seem to improve. I'll post the howto tonight and maybe Meganerd can add them to the list

Meganerd

  • Newbie
  • *
  • Posts: 34
    • View Profile
Sailfish and the camera module
« Reply #3 on: July 03, 2018, 06:04:55 pm »
Definitely! I will credit you as well on the Gitlab repo

Did you compile the code from the SDK or was it a QML file you just modified to hard code the orientation?

vader

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Sailfish and the camera module
« Reply #4 on: July 04, 2018, 04:02:14 am »
Quote from: Meganerd
Definitely! I will credit you as well on the Gitlab repo

Did you compile the code from the SDK or was it a QML file you just modified to hard code the orientation?
I just had to modify the qml file, and change some settings in dconf. I've attached the camera qml file.

rename the attached CameraPage.txt to CameraPage.qml, then copy to

/usr/share/jolla-camera/pages/CameraPage.qml

remember to make a backup first.

Then change some settings to enable the full sensor, and make sure focus works. To change settings, in the terminal use:

dconf write /apps/jolla-camera/primary/image/imageResolution "'2560x1920'"
dconf write /apps/jolla-camera/primary/image/focusDistanceValues "[8, 4, 16]"

you can see all the modes with:

droid-camres -w /tmp/a.txt

Add/set the values as per this file to change things like video res etc. Remember the " around the ' character otherwise you will get an error.

 [ Invalid Attachment ]
« Last Edit: July 04, 2018, 09:05:10 pm by vader »

Meganerd

  • Newbie
  • *
  • Posts: 34
    • View Profile
Sailfish and the camera module
« Reply #5 on: July 04, 2018, 10:53:10 pm »
Thanks Vader, I added it on my gitlab for anyone who comes across any of the other tutorial/info there.

vader

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Sailfish and the camera module
« Reply #6 on: July 09, 2018, 07:11:50 am »
Update 2: the focusDistanceValues should be [ 8 ] instead of [ 8, 4, 16]. This disables continuous focus and means that when you focus with either the button or tapping the screen, then the focus stays where you set it.

4 = infinity
8 = autofocus
16 = continuous autofocus