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

Fixes for Quanta Acer HD User Facing Web camera(original code from @Giuliano69) #843

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Emtyffx
Copy link

@Emtyffx Emtyffx commented Apr 20, 2024

There is a problem that I and some other users encounted while not being able to turn on camera on linux.
After searching for some time I have found fix created by @Giuliano69, thanking him a lot for this fix.

It will be good to merge this code into official uvc driver for not so experienced users, because they can't find the fix themselves(i also have spent some time finding the fix and applying it). And also the fix that require changing some kernel code can scare newbies.

@admsev
Copy link

admsev commented May 25, 2024

@gooroodev review

@gooroodev
Copy link

1. Summary of Changes

The pull request introduces support for two models of Quanta Acer HD User Facing webcams in the uvc_driver.c file. Specifically:

  • Added support for the Quanta ACER HD User Facing camera with idProduct 0x4035.
  • Added support for the Quanta ACER HD User Facing camera with idProduct 0x4033.
  • Both entries include specific USB device information related to the camera's interface class, subclass, and protocol.

2. Issues, Bugs, or Typos

Issue 1: Comment Formatting

The comments added for the fixes are slightly inconsistent and could be more concise. Additionally, the comment block uses an unusual format with leading asterisks.

Proposed Improvement:

-	/**
-	   * Fix for the problem with cameras on Acer Nitro 5 Series.
-	   * 
-	   * Fix required for the camera here
-	   * Thanks for @Giuliano69 for providing the fix
-	  */
+	/*
+	 * Fix for the problem with cameras on Acer Nitro 5 Series.
+	 * Thanks to @Giuliano69 for providing the fix.
+	 */

Issue 2: Redundant Comment

The comment /* Fix end here */ is redundant and unnecessary.

Proposed Improvement:

-	/* Fix end here */

3. General Review of the Code Quality and Style

  • Code Quality: The code changes are straightforward and correctly add the necessary device IDs and related information for the two Quanta Acer HD User Facing cameras. The syntax and structure follow the conventions used in the surrounding code.
  • Code Style: The style is mostly consistent with the rest of the file, except for the minor comment formatting issues mentioned above.
  • Documentation: The comments provide context but could be more concise. The use of comments is appropriate to explain why these specific changes were made.
  • Maintainability: The changes are easy to understand and maintain. The added device IDs and their associated information are well-structured.

Final Code After Improvements:

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index bbd90123a4e76d..6d5e353b6135bb 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2463,6 +2463,38 @@ static const struct usb_device_id uvc_ids[] = {
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
+
+	/*
+	 * Fix for the problem with cameras on Acer Nitro 5 Series.
+	 * Thanks to @Giuliano69 for providing the fix.
+	 */
+	/* Quanta ACER HD User Facing  0x4035 - Experimental */
+	{ .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
+			 USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor = 0x0408,
+	  .idProduct = 0x4035,
+	  .bInterfaceClass = USB_CLASS_VIDEO,
+	  .bInterfaceSubClass = 1,
+	  .bInterfaceProtocol = UVC_PC_PROTOCOL_15,
+	  .driver_info = (kernel_ulong_t) &
+			 (const struct uvc_device_info){
+				 .uvc_version = 0x010a,
+			 } },
+
+	/* Quanta ACER HD User Facing 4033 - Experimental !! */
+	{ .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
+			 USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor = 0x0408,
+	  .idProduct = 0x4033,
+	  .bInterfaceClass = USB_CLASS_VIDEO,
+	  .bInterfaceSubClass = 1,
+	  .bInterfaceProtocol = UVC_PC_PROTOCOL_15,
+	  .driver_info = (kernel_ulong_t) &
+			 (const struct uvc_device_info){
+				 .uvc_version = 0x010a,
+			 } },
+
 	/* Genius eFace 2025 */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,

This review ensures the code is clean, maintainable, and follows the project's coding standards.

Yours, Gooroo.dev. To receive reviews automatically, install Github App

@leomonta
Copy link

leomonta commented Jun 6, 2024

Shouldn't this go through the kernel mailing list?

@takshakmudgal
Copy link

when will this be added to the kernel? I have a Bus 003 Device 002: ID 0408:4033 Quanta Computer, Inc. ACER HD User Facing and my device still does not work on the latest 6.10.10-200.fc40.x86_64 kernel.

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

Successfully merging this pull request may close these issues.

6 participants