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

USB camera and mesa v3d #9

Closed
rsglobal opened this issue Aug 8, 2020 · 5 comments
Closed

USB camera and mesa v3d #9

rsglobal opened this issue Aug 8, 2020 · 5 comments

Comments

@rsglobal
Copy link

rsglobal commented Aug 8, 2020

@KonstaT ,

Hello,
Can you please check will camera work for you with this patch?
GloDroid/glodroid_forks@73b4d00

@KonstaT
Copy link
Member

KonstaT commented Aug 10, 2020

Hi.

Thanks for letting me know. :)

Unfortunately this doesn't fix the issue I'm having with camera. It seems there's an issue with the default camera app (and maybe some other camera apps as well?). Some third party camera apps seem to work fine (e.g. OpenCamera works and I've seen people use camera with WhatsApp video calls, Zoom, etc).

I'm using the official Pi camera module but the results are the same with the cheap UVC USB webcam I have. Android-x86 camera HAL is used in my builds with some minor modifications to add resolutions for the Pi camera modules if you want to test things with GloDroid yourself.

@rsglobal
Copy link
Author

Thanks you for testing.

In case of some shared (between your project and GloDroid) issues feel free to report them to us.
It will help to boost both projects.

I will appreciate you if you can share your camera HAL.

@KonstaT
Copy link
Member

KonstaT commented Aug 10, 2020

I left you couple of comments on your mesa patches.
rsglobal/glodroid_forks@e2b7543#commitcomment-41334934
rsglobal/glodroid_forks@f2ce0b2#commitcomment-41335009

I've attached the camera HAL (camera.zip).
It's a fork of https://osdn.net/projects/android-x86/scm/git/hardware-libcamera/tree/pie-x86/ with very minor modifications.

device.mk:

PRODUCT_PACKAGES += \
    android.hardware.camera.provider@2.4-impl \
    android.hardware.camera.provider@2.4-service \
    camera.rpi

manifest.xml:

    <hal format="hidl">
        <name>android.hardware.camera.provider</name>
        <transport>hwbinder</transport>
        <version>2.4</version>
        <interface>
            <name>ICameraProvider</name>
            <instance>legacy/0</instance>
        </interface>
    </hal>

uevent:
/dev/video* 0660 system camera

system.prop:
ro.hardware.camera=rpi
or rename the HAL to match your ro.board.platform

config.txt:

gpu_mem=128
start_x=1

and you'll need the extended boot firmware files for Pi camera modules as well

On kernel side you'll need

CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y

for USB webcams and

CONFIG_VIDEO_BCM2835=y
CONFIG_BCM2835_VCHIQ_MMAL=y
CONFIG_BCM_VC_SM_CMA=y

for Pi camera modules.

@rsglobal
Copy link
Author

Thank you for the HAL,
I've found that external cameras does not require HAL.
https://source.android.com/devices/camera/external-usb-cameras

@KonstaT
Copy link
Member

KonstaT commented Aug 11, 2020

At least I couldn't get my UVC webcam working with the AOSP external USB camera HAL when I tested it with Android 9 (haven't tested with 10). There's also this (https://android.googlesource.com/platform/hardware/libhardware/+/refs/tags/android-10.0.0_r41/modules/camera/3_4/README.md) but didn't have much luck with that either.

Android-x86 camera HAL works with both the Pi camera modules and USB webcams which is great.

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

No branches or pull requests

2 participants