2016年6月30日 星期四


/drivers/media/video/uvc/uvcvideo.c


/drivers/media/video/uvc/uvc_ctrl.c

line 789:

case VIDIOC_S_FMT:
  {
    800                 struct uvc_streaming_control probe;
    801
    802                 return uvc_v4l2_try_format(stream, arg, &probe, NULL, NULL);
    803         }


加了一些printk... 然後按下 dmesg...  得到這個訊息

 uvcvideo: Failed to set UVC probe control : -110 (exp. 26).


google  uvcvideo: Failed to set UVC probe control : -110 (exp. 26).

這是因為  uvc_v4l2_try_format() 裡面的

 ret = uvc_probe_video(stream, probe);


uvc_video.c  line  300

int uvc_probe_video(struct uvc_streaming *stream,
301         struct uvc_streaming_control *probe)
302 {
303         struct uvc_streaming_control probe_min, probe_max;
304         __u16 bandwidth;
305         unsigned int i;
306         int ret;
307 
308         /* Perform probing. The device should adjust the requested values
309          * according to its capabilities. However, some devices, namely the
310          * first generation UVC Logitech webcams, don't implement the Video
311          * Probe control properly, and just return the needed bandwidth. For
312          * that reason, if the needed bandwidth exceeds the maximum available
313          * bandwidth, try to lower the quality.
314          */
315         ret = uvc_set_video_ctrl(stream, probe, 1);
316         if (ret < 0)
317                 goto done;


然後再呼叫  ret = uvc_set_video_ctrl(stream, probe, 1);


uvc_video.c  line 254 

static int uvc_set_video_ctrl(struct uvc_streaming *stream,
255         struct uvc_streaming_control *ctrl, int probe)
256 {
257         __u8 *data;
258         __u16 size;
259         int ret;
260 
261         size = stream->dev->uvc_version >= 0x0110 ? 34 : 26;
262         data = kzalloc(size, GFP_KERNEL);
263         if (data == NULL)
264                 return -ENOMEM;
265 
266         *(__le16 *)&data[0] = cpu_to_le16(ctrl->bmHint);
267         data[2] = ctrl->bFormatIndex;
268         data[3] = ctrl->bFrameIndex;
269         *(__le32 *)&data[4] = cpu_to_le32(ctrl->dwFrameInterval);
270         *(__le16 *)&data[8] = cpu_to_le16(ctrl->wKeyFrameRate);
271         *(__le16 *)&data[10] = cpu_to_le16(ctrl->wPFrameRate);
272         *(__le16 *)&data[12] = cpu_to_le16(ctrl->wCompQuality);
273         *(__le16 *)&data[14] = cpu_to_le16(ctrl->wCompWindowSize);
274         *(__le16 *)&data[16] = cpu_to_le16(ctrl->wDelay);
275         put_unaligned_le32(ctrl->dwMaxVideoFrameSize, &data[18]);
276         put_unaligned_le32(ctrl->dwMaxPayloadTransferSize, &data[22]);
277 
278         if (size == 34) {
279                 put_unaligned_le32(ctrl->dwClockFrequency, &data[26]);
280                 data[30] = ctrl->bmFramingInfo;
281                 data[31] = ctrl->bPreferedVersion;
282                 data[32] = ctrl->bMinVersion;
283                 data[33] = ctrl->bMaxVersion;
284         }
285 
286         ret = __uvc_query_ctrl(stream->dev, UVC_SET_CUR, 0, stream->intfnum,
287                 probe ? UVC_VS_PROBE_CONTROL : UVC_VS_COMMIT_CONTROL, data,
288                 size, uvc_timeout_param);
289         if (ret != size) {
290                 uvc_printk(KERN_ERR, "Failed to set UVC %s control : "
291                         "%d (exp. %u).\n", probe ? "probe" : "commit",
292                         ret, size);
293                 ret = -EIO;
294         }
295 
296         kfree(data);
297         return ret;
298 }


就發出 error message....




Logitech webcam not working


苦主的linux 版本是
Uname: Linux 3.5.0-1-generic i686

Joseph Salisbury (jsalisbury) wrote : 回說

Can you test the latest mainline kernel, to see if the bug is already fixed upstream? The latest mainline kernel is available at:
http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.5-rc4-quantal/
You will need to install both the linux-image and linux-image-extra .deb packages.
Thanks in advance!
Changed in linux (Ubuntu):
importance:Undecided → Medium
tags:added: kernel-da-key
Changed in linux (Ubuntu):
status:New → Confirmed


目前的linux kernel 版本是  3.0.15
Linux localhost 3.0.15-Dmatek #202 SMP PREEMPT Fri Jul 1 13:28:07 CST 2016 armv7l GNU/Linux


沒有留言:

張貼留言