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

Empty device name #14

Open
Peter2121 opened this issue Oct 11, 2023 · 3 comments
Open

Empty device name #14

Peter2121 opened this issue Oct 11, 2023 · 3 comments

Comments

@Peter2121
Copy link

This library is used by telegram-desktop software.
There is a problem with some USB cameras that have no Manufacturer and Product set.
For example, I use a Logitech camera with the following data:

% usbconfig -u 1 -a 4 dump_device_desc
ugen1.4: <vendor 0x046d product 0x081b> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x00ef  <Miscellaneous device>
  bDeviceSubClass = 0x0002
  bDeviceProtocol = 0x0001
  bMaxPacketSize0 = 0x0040
  idVendor = 0x046d
  idProduct = 0x081b
  bcdDevice = 0x0010
  iManufacturer = 0x0000  <no string>
  iProduct = 0x0000  <no string>
  iSerialNumber = 0x0002  <7EB793D0>
  bNumConfigurations = 0x0001

In webrtc_media_devices.cpp the GetVideoInputList() function returns an empty string for this device. The telegram-desktop is confused by this situation, so the camera cannot be used with this software.

Maybe, it would be better to check if both utfName and utfId are empty and in such case query for another parameter (SerialNumber or idVendor and idProduct) to avoid returning the empty string.

@john-preston
Copy link
Contributor

@Peter2121 What OS is this? The code indeed can't work if DeviceName() returns empty string in both. For Linux this code is used:

https://github.com/desktop-app/tg_owt/blob/afd9d5d31798d3eacf9ed6c30601e91d0f1e4d60/src/modules/video_capture/linux/device_info_v4l2.cc#L69-L124

Maybe it should be updated somehow to include more ways to query device name, because we need at least some string to show in UI and identify the device. If on your system some different code is used for querying the device name, then it should be updated.

@Peter2121
Copy link
Author

@john-preston
I am on FreeBSD 13.2.
I can build/test anything you need to explore the situation.
The exact model of Web Camera is Logitech C310 HD.

@john-preston
Copy link
Contributor

@Peter2121 I just don't know which implementation is used in your case in the GetDeviceName call that I make from the lib_webrtc. So you need to find which one is used on FreeBSD and we can decide how to improve it, maybe. This is part of WebRTC camera detection code, so I wonder if it works in Chromium or anywhere else WebRTC is used for video recording.

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