• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

How to: test GStreamer-droid based camera support in Ubuntu Touch (for Halium 7.1 based port)

Scheduled Pinned Locked Moved OS
119 Posts 31 Posters 41.7k Views 13 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W Offline
      walidham @peat_psuwit
      last edited by 6 Jan 2020, 15:44

      @peat_psuwit said in How to: test GStreamer-droid based camera support in Ubuntu Touch (for Halium 7.1 based port):

      ps ax -H

      The device is LG V20 tmo h918 based on halium-7.1 and i used stock kernel for nogat 7.0
      ps ax -H : https://paste.ubuntu.com/p/bF2t6MgwQZ/
      Also i added camera_service in init.qcom.rc to force start media record
      service camera_service /system/bin/camera_service
      class main
      user media
      group audio camera

      This is error in logcat
      https://paste.ubuntu.com/p/7rdQg83CbP/

      P 1 Reply Last reply 7 Jan 2020, 09:42 Reply Quote 0
      • P Offline
        peat_psuwit @walidham
        last edited by 7 Jan 2020, 09:42

        @walidham Could you please try without camera_service? camera_service comes from libhybris and contains some camera services. However, they're designed for 4.4 devices. The way gstreamer-droid works should not require this service anymore.

        Not to be confused with cameraserver. cameraserver is an Android service which splits from mediaserver starting from 7.0 and is required for camera to work.

        W 1 Reply Last reply 7 Jan 2020, 22:47 Reply Quote 0
        • W Offline
          walidham @peat_psuwit
          last edited by 7 Jan 2020, 22:47

          @peat_psuwit Thankyou very much for your reply
          First note is camera.msm8996 driver can't load without added libjnigraphics.so, libandroid-runtime.so and 17 others blobs files. I extracted them from cm-14.1 rom and added it to my system.img to make driver HAL camera happy and load.
          I tried remove dependencies with patchelf but not work (got methods unknown errors).

          Second note :i tested camera with gst-inspect-1.0 got this error

          **
          ERROR:gstamchybris.c:1286:scan_codecs: code should not be reached
          **
          ERROR:gstamchybris.c:1286:scan_codecs: code should not be reached
          No such element or plugin 'androidmedia'
          

          With droidmedia logcat show me this

          ServiceManager: add_service('SurfaceFlinger',9) uid=1000 - ALREADY REGISTERED, OVERRIDE
          ServiceManager: service 'SurfaceFlinger' died
          ServiceManager: add_service('media.player',10) uid=1013 - ALREADY REGISTERED, OVERRIDE
          ServiceManager: service 'media.player' died
          

          Thats why i used old camera_service with no hope to make video record work.

          P 1 Reply Last reply 9 Jan 2020, 17:03 Reply Quote 0
          • C Offline
            ComLarsic
            last edited by ComLarsic 1 Sept 2020, 15:12 8 Jan 2020, 08:00

            @peat_psuwit sorry to bother, but could you maybe provide an arm64 version of the updated camera app? or provide the source code so i can compile it myself?

            P 1 Reply Last reply 9 Jan 2020, 17:11 Reply Quote 0
            • P Offline
              peat_psuwit @walidham
              last edited by 9 Jan 2020, 17:03

              @walidham said in How to: test GStreamer-droid based camera support in Ubuntu Touch (for Halium 7.1 based port):

              First note is camera.msm8996 driver can't load without added libjnigraphics.so, libandroid-runtime.so and 17 others blobs files. I extracted them from cm-14.1 rom and added it to my system.img to make driver HAL camera happy and load.
              I tried remove dependencies with patchelf but not work (got methods unknown errors).

              Notice that libandroid-runtime.so = ART i.e. the Java language runtime. It's unusual for a HAL library to link into it. What method does it say is missing when you tried patchelf it (and what library do you patchelf out)?

              Second note :i tested camera with gst-inspect-1.0 got this error

              **
              ERROR:gstamchybris.c:1286:scan_codecs: code should not be reached
              **
              ERROR:gstamchybris.c:1286:scan_codecs: code should not be reached
              No such element or plugin 'androidmedia'
              

              How did you test camera with gst-inspect-1.0? Do you mean gst-launch-1.0? Also, that error doesn't come from gst-droid.

              With droidmedia logcat show me this

              ServiceManager: add_service('SurfaceFlinger',9) uid=1000 - ALREADY REGISTERED, OVERRIDE
              ServiceManager: service 'SurfaceFlinger' died
              ServiceManager: add_service('media.player',10) uid=1013 - ALREADY REGISTERED, OVERRIDE
              ServiceManager: service 'media.player' died
              

              Did you also add minimediaservice and minisfservice? It seems like minisfservice conflicts with built in minisf in Mir and minimediaservice conflicts with normal mediaserver. Please remove both of them. If not, then what do you mean by "with droidmedia"?

              W 1 Reply Last reply 12 Jan 2020, 15:27 Reply Quote 0
              • P Offline
                peat_psuwit @ComLarsic
                last edited by 9 Jan 2020, 17:11

                @ComLarsic I've updated the instruction to include the arm64 binary and the link to my modification. Thank you for raising that up!

                1 Reply Last reply Reply Quote 1
                • C Offline
                  ComLarsic
                  last edited by 11 Jan 2020, 11:50

                  I tried following the steps but the camera doesnt work anymore, i tried undo-ing all the commands but still no luck. is thereany way to bring it back go normal or would i have to reinstall UBTouch?

                  P 1 Reply Last reply 12 Jan 2020, 19:19 Reply Quote 0
                  • W Offline
                    walidham @peat_psuwit
                    last edited by walidham 1 Dec 2020, 16:45 12 Jan 2020, 15:27

                    @peat_psuwit
                    i'm tried to remove the dependcies i ran this command

                     patchelf --remove-needed "libjnigraphics.so" vendor/lge/v20-common/proprietary/lib/libfilm_emulation.so
                    

                    got this error

                    E HAL     : dlopen failed: cannot locate symbol "android_getCpuFeatures" referenced by "/system/lib/libbwfocuspeaking.so"...
                    

                    This method android_getCpuFeatures i think its part from android NDK
                    Edit : i found it in libskia.so extracted from stock rom

                    nm -D libskia.so |grep android_getCpuFeatures
                    002ffca8 T android_getCpuFeatures
                    
                    P 1 Reply Last reply 12 Jan 2020, 19:22 Reply Quote 0
                    • P Offline
                      peat_psuwit @ComLarsic
                      last edited by 12 Jan 2020, 19:19

                      @ComLarsic It's hard to revert changes made by lxc-android-config, one of the packages updated. It's cleaner to just re-install Ubuntu Touch. You can do that by using the UBports Installer or by running sudo system-image-cli -b 0 --progress dots from an ADB or SSH session (not in the terminal app though).

                      What device are you testing with?

                      C 1 Reply Last reply 12 Jan 2020, 19:35 Reply Quote 0
                      • P Offline
                        peat_psuwit @walidham
                        last edited by 12 Jan 2020, 19:22

                        @walidham Hmm, according to my research, android_getCpuFeatures is supposed to be compiled into the binary using it. If you can make it link to libskia.so (which seems to be available on normal Halium installation), then it might work. Also, seem like you'll have to remove libandroid.so too.

                        W 1 Reply Last reply 12 Jan 2020, 19:28 Reply Quote 0
                        • W Offline
                          walidham @peat_psuwit
                          last edited by 12 Jan 2020, 19:28

                          @peat_psuwit
                          Yes, android_getCpuFeatures i fount it builded in halium (libskia.so)
                          and i added libskia.so to libbwfocuspeaking.so

                          patchelf --add-needed "libskia.so" lib/libbwfocuspeaking.so
                          

                          Also i updated camera libs , got camera work.
                          BUTTT
                          Make photo work , not very good, but i can take photo.
                          Video record no. I will investigate it more and return to you for HELLP
                          Best Regards and thankouy

                          1 Reply Last reply Reply Quote 0
                          • C Offline
                            ComLarsic @peat_psuwit
                            last edited by 12 Jan 2020, 19:35

                            @peat_psuwit i am testing with the oneplus3t, i guess i'll have to reinstall then.
                            thanks for the help!

                            1 Reply Last reply Reply Quote 0
                            • W Offline
                              walidham
                              last edited by 13 Jan 2020, 07:13

                              I removed both minimediaservice & miniafservice, camera don't work, got "Camera service not found", but the driver is loaded correctly and system detect 3 cameras.

                              I think there is problem in sensor or sound, because got many errors in logcat.
                              Also why /data/misc/media is empty, there is no media_codecs_profiling_results.xml.

                              1 Reply Last reply Reply Quote 0
                              • P Offline
                                pbt100
                                last edited by pbt100 21 Jan 2020, 07:42

                                Fixes video recording on garlic ,halium-7.1 with/without minimedia, miniaf and minisf services. For initial few shots from front camera were purple .

                                T 1 Reply Last reply 21 Jan 2020, 17:07 Reply Quote 0
                                • T Offline
                                  tigerpro @pbt100
                                  last edited by 21 Jan 2020, 17:07

                                  @pbt100 interesting, does your device have a delayed wake from sleep as a result of no mediaservice? Somewhere along the line an update broke video recording on my device

                                  Whether you think you can, or you can't, if you do not try, you will never truly know. So give it a Go.

                                  P 1 Reply Last reply 23 Jan 2020, 21:13 Reply Quote -1
                                  • P Offline
                                    pbt100 @tigerpro
                                    last edited by pbt100 23 Jan 2020, 21:13

                                    @tigerpro minimediaservice was the last thing i added to the port to only fix wake lag and it broke bluetooth ,on mine, video recorder working with/without it though

                                    1 Reply Last reply Reply Quote 0
                                    • LuksusL Offline
                                      Luksus
                                      last edited by Luksus 2 Feb 2020, 19:27 2 Feb 2020, 19:12

                                      Tested on FP2 -> works like a charm.
                                      The execution of taking a photo is superfast now, compared to legacy-image. 👍
                                      Rear-camera and capturing videos does work too.

                                      Devices: BQ e4.5, Fairphone 2, Fairphone 3, Lenovo X605F, Pinephone, Moto Z2 Force, OnePlus5T

                                      1 Reply Last reply Reply Quote 1
                                      • P Offline
                                        peat_psuwit
                                        last edited by 3 Feb 2020, 18:30

                                        @pbt100 @tigerpro The wake lag without minimediaservice should be fixed by including this commit into your Halium tree: https://github.com/Halium/android_frameworks_native/pull/6 (And if it works please add some voice to the PR. Thanks!)

                                        @Luksus You've compiled Halium-7.1 image yourself? Also, is it with the old or new camera modules? I don't have new camera modules myself, so I would like to know how that works.

                                        LuksusL E 2 Replies Last reply 3 Feb 2020, 19:37 Reply Quote 0
                                        • LuksusL Offline
                                          Luksus @peat_psuwit
                                          last edited by 3 Feb 2020, 19:37

                                          @peat_psuwit : yes I compiled it myself.
                                          It is with the new camera module, I don't have the older one.
                                          There is no HDR function as it used to be with the legacy-port, but I assume its just not implemented?!

                                          So far, the camera-experience is way better, than with the legacy-port.

                                          Devices: BQ e4.5, Fairphone 2, Fairphone 3, Lenovo X605F, Pinephone, Moto Z2 Force, OnePlus5T

                                          T 1 Reply Last reply 4 Feb 2020, 01:28 Reply Quote 0
                                          • T Offline
                                            tigerpro @Luksus
                                            last edited by 4 Feb 2020, 01:28

                                            @Luksus I dont know of thats necessarily the case as the camera app on my note 4 has HDR available, I typically dont use it though

                                            Whether you think you can, or you can't, if you do not try, you will never truly know. So give it a Go.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post