[libcamera-devel] android: nautilus: Add camera HAL configuration
diff mbox series

Message ID 20210724092147.36896-1-umang.jain@ideasonboard.com
State Superseded
Delegated to: Umang Jain
Headers show
Series
  • [libcamera-devel] android: nautilus: Add camera HAL configuration
Related show

Commit Message

Umang Jain July 24, 2021, 9:21 a.m. UTC
Nautilus has two in-built cameras, one UVC and one attached to IPU3.
However, libcamera assumes all UVC cameras as 'external' [1] hence,
mark the location of UVC camera in HAL configuration as 'external' too.

[1] 76809320bb1a ("libcamera: pipeline: uvcvideo: Treat all UVC cameras as external")

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 src/android/data/nautilus/camera_hal.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 src/android/data/nautilus/camera_hal.yaml

Comments

Laurent Pinchart July 24, 2021, 11:20 p.m. UTC | #1
Hi Umang,

Thank you for the patch.

On Sat, Jul 24, 2021 at 02:51:47PM +0530, Umang Jain wrote:
> Nautilus has two in-built cameras, one UVC and one attached to IPU3.
> However, libcamera assumes all UVC cameras as 'external' [1] hence,
> mark the location of UVC camera in HAL configuration as 'external' too.

That's not right thought, this particular camera isn't external. What
would it take to fix it ?

> [1] 76809320bb1a ("libcamera: pipeline: uvcvideo: Treat all UVC cameras as external")
> 
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>  src/android/data/nautilus/camera_hal.yaml | 8 ++++++++
>  1 file changed, 8 insertions(+)
>  create mode 100644 src/android/data/nautilus/camera_hal.yaml
> 
> diff --git a/src/android/data/nautilus/camera_hal.yaml b/src/android/data/nautilus/camera_hal.yaml
> new file mode 100644
> index 00000000..f2d31e1c
> --- /dev/null
> +++ b/src/android/data/nautilus/camera_hal.yaml
> @@ -0,0 +1,8 @@
> +cameras:
> +  "\\_SB_.PCI0.I2C2.CAM0":
> +    location: back
> +    rotation: 0
> +
> +  "\\_SB_.PCI0.XHCI.RHUB.HS09-9:1.0-04f2:b647":
> +    location: external
> +    rotation: 0
Kieran Bingham July 26, 2021, 10:20 a.m. UTC | #2
Hi Umang,

On 24/07/2021 10:21, Umang Jain wrote:
> Nautilus has two in-built cameras, one UVC and one attached to IPU3.
> However, libcamera assumes all UVC cameras as 'external' [1] hence,
> mark the location of UVC camera in HAL configuration as 'external' too.
> 
> [1] 76809320bb1a ("libcamera: pipeline: uvcvideo: Treat all UVC cameras as external")
> 
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>  src/android/data/nautilus/camera_hal.yaml | 8 ++++++++
>  1 file changed, 8 insertions(+)
>  create mode 100644 src/android/data/nautilus/camera_hal.yaml
> 
> diff --git a/src/android/data/nautilus/camera_hal.yaml b/src/android/data/nautilus/camera_hal.yaml
> new file mode 100644
> index 00000000..f2d31e1c
> --- /dev/null
> +++ b/src/android/data/nautilus/camera_hal.yaml
> @@ -0,0 +1,8 @@
> +cameras:
> +  "\\_SB_.PCI0.I2C2.CAM0":
> +    location: back
> +    rotation: 0
> +
> +  "\\_SB_.PCI0.XHCI.RHUB.HS09-9:1.0-04f2:b647":
> +    location: external

The purpose of this file is to allow the distribution to correctly
specify the location, so we don't need to follow the 'default' location
- instead in this file we should be telling the system the correct
location (which could otherwise not be determined from a UVC camera).

So I assume this is the 'front' camera ...

--
Kieran

> +    rotation: 0
>
Umang Jain July 26, 2021, 10:42 a.m. UTC | #3
Hi Kieran and Laurent,

On 7/26/21 3:50 PM, Kieran Bingham wrote:
> Hi Umang,
>
> On 24/07/2021 10:21, Umang Jain wrote:
>> Nautilus has two in-built cameras, one UVC and one attached to IPU3.
>> However, libcamera assumes all UVC cameras as 'external' [1] hence,
>> mark the location of UVC camera in HAL configuration as 'external' too.
>>
>> [1] 76809320bb1a ("libcamera: pipeline: uvcvideo: Treat all UVC cameras as external")
>>
>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
>> ---
>>   src/android/data/nautilus/camera_hal.yaml | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>   create mode 100644 src/android/data/nautilus/camera_hal.yaml
>>
>> diff --git a/src/android/data/nautilus/camera_hal.yaml b/src/android/data/nautilus/camera_hal.yaml
>> new file mode 100644
>> index 00000000..f2d31e1c
>> --- /dev/null
>> +++ b/src/android/data/nautilus/camera_hal.yaml
>> @@ -0,0 +1,8 @@
>> +cameras:
>> +  "\\_SB_.PCI0.I2C2.CAM0":
>> +    location: back
>> +    rotation: 0
>> +
>> +  "\\_SB_.PCI0.XHCI.RHUB.HS09-9:1.0-04f2:b647":
>> +    location: external
> The purpose of this file is to allow the distribution to correctly
> specify the location, so we don't need to follow the 'default' location
> - instead in this file we should be telling the system the correct
> location (which could otherwise not be determined from a UVC camera).

Yes, I am aware of that. I still need to investigate what changes are 
required to actually mark it one of 'front/back' internal cameras. You 
might be aware that we assign ids to cameras, internal ones starting 
from '0' and external ones from '1000'.

We do have checks based on these ids, look at CameraHalManager. Hence, 
if we let HAL config file dictate that this is a internal(front or back) 
camera, still we need to take care how we will address it's id (we can't 
have a situation where HAL config file says the camera is internal, but 
it's id > 1000). One option is to probably remove these id-based checks 
and re-generate these checks whatever is in HAL config location. Hence, 
need to investigate that, as what would be the paths forwards. I'll come 
up with a few solutions to discuss as soon as I get some time.

>
> So I assume this is the 'front' camera ...
>
> --
> Kieran
>
>> +    rotation: 0
>>
Kieran Bingham July 26, 2021, 10:52 a.m. UTC | #4
Hi Umang,

On 26/07/2021 11:42, Umang Jain wrote:
> Hi Kieran and Laurent,
> 
> On 7/26/21 3:50 PM, Kieran Bingham wrote:
>> Hi Umang,
>>
>> On 24/07/2021 10:21, Umang Jain wrote:
>>> Nautilus has two in-built cameras, one UVC and one attached to IPU3.
>>> However, libcamera assumes all UVC cameras as 'external' [1] hence,
>>> mark the location of UVC camera in HAL configuration as 'external' too.
>>>
>>> [1] 76809320bb1a ("libcamera: pipeline: uvcvideo: Treat all UVC
>>> cameras as external")
>>>
>>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
>>> ---
>>>   src/android/data/nautilus/camera_hal.yaml | 8 ++++++++
>>>   1 file changed, 8 insertions(+)
>>>   create mode 100644 src/android/data/nautilus/camera_hal.yaml
>>>
>>> diff --git a/src/android/data/nautilus/camera_hal.yaml
>>> b/src/android/data/nautilus/camera_hal.yaml
>>> new file mode 100644
>>> index 00000000..f2d31e1c
>>> --- /dev/null
>>> +++ b/src/android/data/nautilus/camera_hal.yaml
>>> @@ -0,0 +1,8 @@
>>> +cameras:
>>> +  "\\_SB_.PCI0.I2C2.CAM0":
>>> +    location: back
>>> +    rotation: 0
>>> +
>>> +  "\\_SB_.PCI0.XHCI.RHUB.HS09-9:1.0-04f2:b647":
>>> +    location: external
>> The purpose of this file is to allow the distribution to correctly
>> specify the location, so we don't need to follow the 'default' location
>> - instead in this file we should be telling the system the correct
>> location (which could otherwise not be determined from a UVC camera).
> 
> Yes, I am aware of that. I still need to investigate what changes are
> required to actually mark it one of 'front/back' internal cameras. You
> might be aware that we assign ids to cameras, internal ones starting
> from '0' and external ones from '1000'.
> 
> We do have checks based on these ids, look at CameraHalManager. Hence,
> if we let HAL config file dictate that this is a internal(front or back)
> camera, still we need to take care how we will address it's id (we can't
> have a situation where HAL config file says the camera is internal, but
> it's id > 1000). One option is to probably remove these id-based checks
> and re-generate these checks whatever is in HAL config location. Hence,
> need to investigate that, as what would be the paths forwards. I'll come
> up with a few solutions to discuss as soon as I get some time.

Ah, ok - so if you set this to front it causes some failures?

That's troublesome indeed ...

Does the location need to be parsed before we set those IDs?
(I guess it doesn't currently?)

--
Kieran


>>
>> So I assume this is the 'front' camera ...
>>
>> -- 
>> Kieran
>>
>>> +    rotation: 0
>>>

Patch
diff mbox series

diff --git a/src/android/data/nautilus/camera_hal.yaml b/src/android/data/nautilus/camera_hal.yaml
new file mode 100644
index 00000000..f2d31e1c
--- /dev/null
+++ b/src/android/data/nautilus/camera_hal.yaml
@@ -0,0 +1,8 @@ 
+cameras:
+  "\\_SB_.PCI0.I2C2.CAM0":
+    location: back
+    rotation: 0
+
+  "\\_SB_.PCI0.XHCI.RHUB.HS09-9:1.0-04f2:b647":
+    location: external
+    rotation: 0