<div dir="ltr">> Fine with me if it makes things easier for you<div>It makes the logs easier to understand for me. My hope is that the next person who wants to know why their camera is "LIMITED" instead of "FULL" will find this useful, just like I would have. This will also help diagnose when people, e.g. on the Waydroid bug tracker, complain about not having a "FULL" camera as a bug and maybe even prevent bugs like that (though probably not).</div><div><br></div><div>t> hat capital "NOT" is a bit bold :)<br>> If you want to add information I would maybe<br>>                         << " Camera " << cam->id() << " failed to load";<br><br>> I don't think you need "" around the camera id (we don't have it in<br>> the other error messages)<br></div><div>> Made lower-case.</div><div>All good points. Changes made.</div><div><br></div><div>> This doesn't seems something to report everytime the library is loaded</div><div>Removed.</div><div><br></div><div>> Do we end all other error messages with a full stop ? Why this one</div>should ?<div>Good point. Removed the full stop.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 27, 2022 at 11:55 AM Jacopo Mondi <<a href="mailto:jacopo@jmondi.org">jacopo@jmondi.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Nicholas<br>
<br>
On Thu, Oct 27, 2022 at 12:55:15AM -0500, Nicholas Roth via libcamera-devel wrote:<br>
> From: Nicholas Roth <<a href="mailto:nicholas@rothemail.net" target="_blank">nicholas@rothemail.net</a>><br>
><br>
> I identified opportunities to make libcamera's log output easier to<br>
> understand while working to get it working on my Android device as a<br>
> HAL. These additional logging statements came out of that and will<br>
> hopefully prove useful to Android distribution maintainers with the same<br>
> goal as mine and to users who attempt to debug tools like Waydroid.<br>
><br>
> Signed-off-by: Nicholas Roth <<a href="mailto:nicholas@rothemail.net" target="_blank">nicholas@rothemail.net</a>><br>
> ---<br>
>  src/android/camera_capabilities.cpp | 12 +++++++++---<br>
>  src/android/camera_hal_manager.cpp  |  3 ++-<br>
>  src/libcamera/base/log.cpp          |  4 +++-<br>
>  src/libcamera/v4l2_subdevice.cpp    |  2 +-<br>
>  4 files changed, 15 insertions(+), 6 deletions(-)<br>
><br>
> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp<br>
> index 64bd8dde..ef0d10d0 100644<br>
> --- a/src/android/camera_capabilities.cpp<br>
> +++ b/src/android/camera_capabilities.cpp<br>
> @@ -374,14 +374,20 @@ void CameraCapabilities::computeHwLevel(<br>
>       camera_metadata_enum_android_info_supported_hardware_level<br>
>               hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL;<br>
><br>
> -     if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR))<br>
> +     if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR)) {<br>
> +             LOG(HAL, Info) << noFull << "missing manual sensor";<br>
>               hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED;<br>
> +     }<br>
><br>
> -     if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING))<br>
> +     if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING)) {<br>
> +             LOG(HAL, Info) << noFull << "missing manual post processing";<br>
>               hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED;<br>
> +     }<br>
><br>
> -     if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE))<br>
> +     if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE)) {<br>
> +             LOG(HAL, Info) << noFull << "missing burst capture";<br>
>               hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED;<br>
> +     }<br>
<br>
Fine with me if it makes things easier for you<br>
<br>
><br>
>       found = staticMetadata_->getEntry(ANDROID_SYNC_MAX_LATENCY, &entry);<br>
>       if (!found || *entry.data.i32 != 0) {<br>
> diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp<br>
> index 7512cc4e..7fac4e3f 100644<br>
> --- a/src/android/camera_hal_manager.cpp<br>
> +++ b/src/android/camera_hal_manager.cpp<br>
> @@ -140,7 +140,8 @@ void CameraHalManager::cameraAdded(std::shared_ptr<Camera> cam)<br>
>        */<br>
>       if (!isCameraExternal && !halConfig_.exists()) {<br>
>               LOG(HAL, Error)<br>
> -                     << "HAL configuration file is mandatory for internal cameras";<br>
> +                     << "HAL configuration file is mandatory for internal cameras."<br>
> +                     << " Camera NOT loaded: \"" << cam->id() << "\"";<br>
<br>
that capital "NOT" is a bit bold :)<br>
<br>
If you want to add information I would maybe<br>
                        << " Camera " << cam->id() << " failed to load";<br>
<br>
I don't think you need "" around the camera id (we don't have it in<br>
the other error messages)<br>
<br>
<br>
>               return;<br>
>       }<br>
><br>
> diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp<br>
> index 55fbd7b0..88800158 100644<br>
> --- a/src/libcamera/base/log.cpp<br>
> +++ b/src/libcamera/base/log.cpp<br>
> @@ -625,8 +625,10 @@ void Logger::parseLogFile()<br>
>  void Logger::parseLogLevels()<br>
>  {<br>
>       const char *debug = utils::secure_getenv("LIBCAMERA_LOG_LEVELS");<br>
> -     if (!debug)<br>
> +     if (!debug) {<br>
> +             syslog(LOG_INFO, "Could not find LIBCAMERA_LOG_LEVELS in env");<br>
>               return;<br>
> +     }<br>
<br>
This doesn't seems something to report everytime the library is loaded<br>
<br>
><br>
>       for (const char *pair = debug; *debug != '\0'; pair = debug) {<br>
>               const char *comma = strchrnul(debug, ',');<br>
> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp<br>
> index 15e8206a..f3e25b86 100644<br>
> --- a/src/libcamera/v4l2_subdevice.cpp<br>
> +++ b/src/libcamera/v4l2_subdevice.cpp<br>
> @@ -392,7 +392,7 @@ int V4L2Subdevice::getSelection(unsigned int pad, unsigned int target,<br>
>       if (ret < 0) {<br>
>               LOG(V4L2, Error)<br>
>                       << "Unable to get rectangle " << target << " on pad "<br>
> -                     << pad << ": " << strerror(-ret);<br>
> +                     << pad << ": " << strerror(-ret) << ".";<br>
<br>
Do we end all other error messages with a full stop ? Why this one<br>
should ?<br>
<br>
>               return ret;<br>
>       }<br>
><br>
> --<br>
> 2.34.1<br>
><br>
</blockquote></div>