Русскоязычное сообщество Ubuntu Linux
*

Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?
Войти

 Календарь событий Русскоязычного сообщества Ubuntu
Собрания рабочих групп, мероприятия, конференции, семинары
Русскоязычное сообщество Ubuntu Linux  |  Поддержка  |  Железо  |  Тема: Лаптоп ASUS G1S: изображение с вебкамеры вверх ногами. [РЕШЕНО]
Страниц: [1] 2  Все   Вниз
Печать
Автор Тема: Лаптоп ASUS G1S: изображение с вебкамеры вверх ногами. [РЕШЕНО]  (Прочитано 5833 раз)
0 Пользователей и 1 Гость смотрят эту тему.
Вazilio
Автор темы
Новичок
*
Сообщений: 11


Kubuntu user

bazilio@co.ru
Просмотр профиля WWW
« : 21 Марта 2008, 14:08:03 »

Здравствуйте все!
Я использую Kubuntu 7.10 и у меня проблема с вебкамерой.
Заработала она "из коробки", но изображение с неё идёт вверх ногами. В виндоус системе она работает нормально, а в линуксе вот вверх ногами показывает.

В винде эта камера определилась как D-Max_GD-5A35, device PID code: USB\VID_174F&PID_5A35
В линуксе: Sonix Technoogy Co., Ltd USB 2.0 Camera

Я перерыл весь инет в поисках решения, нашёл только пару постов от людей, у которых тот-же ноут, но камера Chicony. И тоже изображене вверхногами.
Пробовал устанавливать sn9xxx драйвера, но они ни как не подействовали на эту камеру. работает она от модуля uvcvideo.

Код:
bazilio@ASUSG1S:~$ lsmod | grep video
video 18060 0
uvcvideo 57480 0
compat_ioctl32 2304 1 uvcvideo
videodev 29312 1 uvcvideo
v4l1_compat 15364 2 uvcvideo,videodev
v4l2_common 18432 2 uvcvideo,videodev
usbcore 138632 7 xpad,uvcvideo,hci_usb,usbhid,ehci_hcd,uhci_hcd
Строка со словом Syntek, относится к камере:
Код:
bazilio@ASUSG1S:~$ lsusb
Bus 007 Device 001: ID 0000:0000
Bus 006 Device 003: ID 0b05:1726 ASUSTek Computer, Inc. Laptop OLED Display
Bus 006 Device 002: ID 174f:5a35 Syntek
Bus 006 Device 001: ID 0000:0000
Bus 003 Device 002: ID 046d:c01e Logitech, Inc. MX518 Optical Mouse
Bus 003 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 005 Device 002: ID 0b05:1712 ASUSTek Computer, Inc. BT-183 Bluetooth 2.0+EDR adapter
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000

Надеюсь на помощь, заранее спасибо!
« Последнее редактирование: 26 Июня 2008, 16:11:00 от Bazilio_recast » Записан
Вazilio
Автор темы
Новичок
*
Сообщений: 11


Kubuntu user

bazilio@co.ru
Просмотр профиля WWW
« Ответ #1 : 26 Июня 2008, 16:10:32 »

Проблема решена!
http://ubuntuforums.org/showthread.php?t=838210
Записан
bsod
Участник
***
Сообщений: 166

387334592
Просмотр профиля
« Ответ #2 : 20 Июля 2008, 01:41:55 »

А где можно на русском посмотреть решение проблемы, т.к. тоже самое.
Записан
Вazilio
Автор темы
Новичок
*
Сообщений: 11


Kubuntu user

bazilio@co.ru
Просмотр профиля WWW
« Ответ #3 : 31 Июля 2008, 08:52:23 »

ниже постараюсь внятно перевести это: http://ubuntuforums.org/showthread.php?t=838210

Привет всем,
это очень быстрое how-to которое поможет решить проблему с перевёрнутым изображением с видеокамеры!!!
Это поможет только тем, у кого UVC совместимая вебкамера
Протестировано, работает с:
skype, amsn, kopete, luvcview, mplayer!!

Начнём!!!!

Чтобы узнать, что ваша камера UVC совместимая в командной строке запустите:
Код:
lsusb
Получите что-то вроде этого:
Код:
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID xxxx:yyyy "Your_Webcam_Model"
Bus 001 Device 001: ID 0000:0000
потом наберите:
Код:
sudo lsusb -d xxxx:yyyy -v | grep "14 Video"
Если получите что-то вроде этого, что ваша камера UVC совместима:
Код:
bFunctionClass 14 Video
bInterfaceClass 14 Video
bInterfaceClass 14 Video
bInterfaceClass 14 Video

Если ваша камера прошла этот тест, продолжайте чтение, если нет, ищите проприетарные драйвера.

Итак,
Теперь нужно загрузить исходники UVCVIDEO драйвера, но они находятся в SVN репоситории, такчто вам нужно установить SVN клиент
Код:
sudo apt-get install subversion
и теперь вы можете загрузить исходники:
Код:
svn checkout svn://svn.berlios.de/linux-uvc/linux-uvc/trunk
Исходники сохранятся в каталоге "Trunk" в каталоге из которого вы выполнили предыдущую команду.

Вот 2 решения (на самом деле 4), попробуйте оба, и скажите мне, которое лучше!!

Для обоих решений есть 2 патча: первый даёт зеркальное изображение, второй - НЕТ.
Вы должны скопировать их в каталог "Trunk" в виде файла (назовите его, например "uvc_video_solution1.patch"), потом в терминале переместитесь в каталог "Trunk" и выполните:
Код:
patch < uvc_video_solution1.patch
Предупреждение: Каждый из следующих патчей ссылается на оригинальный файл "uvc_video.c" , так что прежде чем применять патч, убедитесь что файл "uvc_video.c"  в папке "Trunk" оригинальный. Незабудте забэкапить оригинальный файл.
ПРЕДУПРЕЖДЕНИЕ:
ВЫ ДОЛЖНЫ БЫТЬ УВЕРЕНЫ ЧТО В КОНЦЕ КАЖДОГО ПАТЧА ЕСТЬ ПУСТАЯ СТРОКА, ИНАЧЕ НИ ЧЕГО НЕ ПОЛУЧИТСЯ!!


ПЕРВОЕ РЕШЕНИЕ (ЗЕРКАЛЬНОЕ ИЗОБРАЖЕНИЕ)
Код:
diff -uN UVCVIDEO_v0.1.0/uvc_video.c UVCVIDEO_patched/uvc_video.c
--- UVCVIDEO_v0.1.0/uvc_video.c    2008-06-26 10:41:01.000000000 +0200
+++ UVCVIDEO_patched/uvc_video.c    2008-06-26 15:33:33.000000000 +0200
@@ -371,23 +371,92 @@
     return data[0];
 }
 
+/* This patched function allows to overturn video images from an upside-down
+ * orientation to a normal one with mirrored effect. The conversion simply
+ * consists in reversing the order of the rows of imagines.
+ * This patch performs its job just once for each frame and only when current
+ * frame is completed, but each time it is required to allocate memory in order
+ * to store a copy of that frame.
+ * This patch should work with all YUV image formats.
+ */
 static void uvc_video_decode_data(struct uvc_video_device *video,
         struct uvc_buffer *buf, const __u8 *data, int len)
 {
     struct uvc_video_queue *queue = &video->queue;
     unsigned int maxlen, nbytes;
     void *mem;
+    /* Patch variables */
+    __u8 *mem_tmp, *ptr_tmp;
+    int i, k, row_size;
 
     if (len <= 0)
         return;
 
     /* Copy the video data to the buffer. */
+    /* How many bytes are needed to complete the buffer? */
     maxlen = buf->buf.length - buf->buf.bytesused;
+    /* Where do pixels stored in "data" have to be copied? */
     mem = queue->mem + buf->buf.m.offset + buf->buf.bytesused;
+    /* How many bytes really can be copied into "mem"? */
     nbytes = min((unsigned int)len, maxlen);
+    /* "nbytes" are copied from "data" to "mem" buffer.
+     * "data" stores a sequence of pixels coming from the video source.
+     * This sequence is not a full frame or a full row of pixel, but just an
+     * ordered vector of pixels (from top-left to bottom-right), whose
+     * represents just an area of the current frame.
+     * This function has to be called hundreds of times before a frame is
+     * completed and "nbytes" is not constant! Each time "data" contains the
+     * next part of the frame. At the end data stored in "mem" buffer will
+     * be used by the application who requested the video stream.
+     */
     memcpy(mem, data, nbytes);
     buf->buf.bytesused += nbytes;
 
+    /* Have the last copied bytes completed the current frame? */
+    if (nbytes == maxlen) {
+        /* Area where to save the upper half part of the original frame
+         * (just half in order to speed up the patch) before reversing.
+         */
+        mem_tmp = (__u8 *) kmalloc(buf->buf.bytesused / 2, GFP_ATOMIC);
+        if (mem_tmp != NULL ) {
+            /* Copy top-half part of frame in a temporary buffer */
+            memcpy(mem_tmp, queue->mem + buf->buf.m.offset,
+                   buf->buf.bytesused / 2);
+            /* "row_size" does not depend only on the width of the
+             * frame, but also on the pixel color depth (bpp).
+             */
+            row_size = video->streaming->cur_frame->wWidth *
+                   video->streaming->format->bpp / 8;
+            /* The following cycle just copy full frame rows from
+             * the last one stored in "mem" (and going up) to the
+             * first one (and going down) stored in "mem" itself.
+             */
+            ptr_tmp = queue->mem + buf->buf.m.offset
+                  + buf->buf.bytesused / 2;
+            /* When the top-half of the frame has been reversed,
+             * rows are copied from the last one stored in "mem_tmp"
+             * (and going up) into the bottom half part of "mem"
+             * buffer.
+             */
+            for (i = 0, k = buf->buf.bytesused / 2 - row_size;
+                 i < buf->buf.bytesused;
+                 i += row_size, k -= row_size) {
+                /* If the top-half of the frame has been
+                 * revesed, then it is needed to split the
+                 * source buffer from "mem" to "mem_tmp".
+                 */
+                if (i == buf->buf.bytesused / 2) {
+                    ptr_tmp = mem_tmp;
+                    k = buf->buf.bytesused / 2 - row_size;
+                }
+                memcpy(queue->mem + buf->buf.m.offset + i,
+                       ptr_tmp + k,
+                       row_size);
+            }
+            /* For this frame "mem_tmp" is not needed any more. */
+            kfree(mem_tmp);
+        }
+    }
     /* Complete the current frame if the buffer size was exceeded. */
     if (len > maxlen) {
         uvc_trace(UVC_TRACE_FRAME, "Frame complete (overflow).\n");

ПЕРВОЕ РЕШЕНИЕ (НЕ ЗЕРКАЛЬНОЕ ИЗОБРАЖЕНИЕ)

Код:
diff -uN UVCVIDEO_v0.1.0/uvc_video.c UVCVIDEO_patched/uvc_video.c
--- UVCVIDEO_v0.1.0/uvc_video.c    2008-06-26 10:41:01.000000000 +0200
+++ UVCVIDEO_patched/uvc_video.c    2008-06-26 15:33:33.000000000 +0200
@@ -371,23 +371,105 @@
     return data[0];
 }
 
+/* This patch should work ONLY with YUY2 image formats, also known as YUYV or
+ * YUV422 formats.
+ * This patched function allows to overturn video images from an upside-down
+ * orientation to a normal one. The conversion consists in copying 4 bytes at a
+ * time (Y0,U0,Y1,V0) corresponding to 2 pixels, in a bottom-up direction, from
+ * the frame (coming from the video source) to the buffer that will be used by
+ * the application requesting the video stream. But in order to satisfy the YUY2
+ * image format byte has to be copied in this way: Y1 U0 Y0 VO.
+ * This patch performs its job just once for each frame and only when current
+ * frame is completed, but each time it is required to allocate memory in order
+ * to store a copy of that frame.
+ */
 static void uvc_video_decode_data(struct uvc_video_device *video,
         struct uvc_buffer *buf, const __u8 *data, int len)
 {
     struct uvc_video_queue *queue = &video->queue;
     unsigned int maxlen, nbytes;
     void *mem;
+    /* Patch variables */
+    __u8 *mem_tmp, *ptr_tmp;
+    int i, k, pixel_size;
 
     if (len <= 0)
         return;
 
     /* Copy the video data to the buffer. */
+    /* How many bytes are needed to complete the buffer? */
     maxlen = buf->buf.length - buf->buf.bytesused;
+    /* Where do pixels stored in "data" have to be copied? */
     mem = queue->mem + buf->buf.m.offset + buf->buf.bytesused;
+    /* How many bytes really can be copied into "mem"? */
     nbytes = min((unsigned int)len, maxlen);
+    /* "nbytes" are copied from "data" to "mem" buffer.
+     * "data" stores a sequence of pixels coming from the video source.
+     * This sequence is not a full frame or a full  row of pixel, but just
+     * an ordered vector of pixels (from top-left to bottom-right), whose
+     * represents just an area of the current frame.
+     * This function has to be called hundreds of times before a frame is
+     * completed and "nbytes" is not constant! Each time "data" contains the
+     * next part of the frame. At the end data stored in "mem" buffer will
+     * be used by the application who requested the video stream.
+     */
     memcpy(mem, data, nbytes);
     buf->buf.bytesused += nbytes;
 
+    /* Have the last copied bytes completed the current frame? */
+    if (nbytes == maxlen) {
+        /* Area where to save the original frame before manipulation. */
+        mem_tmp = (__u8 *) kmalloc(buf->buf.bytesused / 2, GFP_ATOMIC);
+        if (mem_tmp != NULL ) {
+            /* Copy the original frame in a temporary buffer. */
+            memcpy(mem_tmp, queue->mem + buf->buf.m.offset,
+                   buf->buf.bytesused / 2);
+            /* "pixel_size" depens on the pixel color depth (bpp),
+             * but in YUY2 image format is constant and equal to 2.
+             */
+             pixel_size = video->streaming->format->bpp / 8;
+            /* The following loop copy 2 pixels at a time (4 bytes
+             * in YUY2 format) from the last two stored in "mem"
+             * (and going back) to the first two (and going on)
+             * stored in "mem" itself following a sort of YUY2
+             * algorithm.
+             */
+            ptr_tmp = queue->mem + buf->buf.m.offset
+                  + buf->buf.bytesused / 2;
+            /* When the top-half of the frame has been reversed,
+             * rows are copied from the last one stored in "mem_tmp"
+             * (and going up) into the bottom half part of "mem"
+             * buffer.
+             */
+            for (i = 0, k = buf->buf.bytesused / 2 - 2 * pixel_size;
+                 i < buf->buf.bytesused;
+                 i += 2 * pixel_size, k -= 2 * pixel_size){
+                /* If the top-half of the frame has been
+                 * revesed, then it is needed to split the
+                 * source buffer from "mem" to "mem_tmp".
+                 */
+                if (i == buf->buf.bytesused / 2) {
+                    ptr_tmp = mem_tmp;
+                    k = buf->buf.bytesused / 2
+                        - 2 * pixel_size;
+                }
+                 /* The order of copied bytes is changed from
+                  * (Y0 U0 Y1 V1) to (Y1 U0 Y0 V1), i.e. from
+                  * (#0 #1 #2 #3) to (#2 #1 #0 #3).
+                  */
+                 ((__u8 *)(queue->mem+buf->buf.m.offset + i))[0] =
+                 ((__u8 *)(ptr_tmp + k))[2];
+                 ((__u8 *)(queue->mem+buf->buf.m.offset + i))[1] =
+                 ((__u8 *)(ptr_tmp + k))[1];
+                 ((__u8 *)(queue->mem+buf->buf.m.offset + i))[2] =
+                 ((__u8 *)(ptr_tmp + k))[0];
+                 ((__u8 *)(queue->mem+buf->buf.m.offset + i))[3] =
+                 ((__u8 *)(ptr_tmp + k))[3];
+            }
+            /* For this frame "mem_tmp" is not needed any more. */
+            kfree(mem_tmp);
+        }
+    }
     /* Complete the current frame if the buffer size was exceeded. */
     if (len > maxlen) {
         uvc_trace(UVC_TRACE_FRAME, "Frame complete (overflow).\n");



ВТОРОЕ РЕШЕНИЕ (ЗЕРКАЛЬНОЕ ИЗОБРАЖЕНИЕ)

Код:
diff -uN UVCVIDEO_v0.1.0/uvc_video.c UVCVIDEO_patched/uvc_video.c
--- UVCVIDEO_v0.1.0/uvc_video.c    2008-06-26 10:41:01.000000000 +0200
+++ UVCVIDEO_patched/uvc_video.c    2008-06-26 14:03:58.000000000 +0200
@@ -371,23 +371,91 @@
     return data[0];
 }
 
+/* This patched function allows to overturn video images from an upside-down
+ * orientation to a normal one with mirrored effect. The conversion consists in
+ * reversing the order of the rows of imagines.
+ * "data" stores a sequence of pixels coming from the video source.
+ * This sequence is not a full frame or a full row of pixel, but just an
+ * ordered vector of pixels (from top-left to bottom-right), whose
+ * represents just an area of the current frame and which size ("nbytes") is
+ * not constant. In fact this function has to be called hundreds of times
+ * before a frame is completed. Each time "data" contains the next part of the
+ * current frame (upside-down). At the end data stored in "mem" buffer will be
+ * used by the application who requested the video stream.
+ * No memory allocation is needed because pixel order is modified directly
+ * while copying from "data" into "mem" buffer (i.e. in each call of this
+ * function), and not just once when the frame is already completed.
+ * This patch should work with all YUV image formats.
+ */
 static void uvc_video_decode_data(struct uvc_video_device *video,
         struct uvc_buffer *buf, const __u8 *data, int len)
 {
     struct uvc_video_queue *queue = &video->queue;
     unsigned int maxlen, nbytes;
     void *mem;
+    /* Patch variables */
+    unsigned int row_size, to_be_copied, shift_right;
 
     if (len <= 0)
         return;
 
     /* Copy the video data to the buffer. */
+    /* How many bytes are needed to complete the buffer? */
     maxlen = buf->buf.length - buf->buf.bytesused;
+    /* Where do pixels stored in "data" have to be copied? */
     mem = queue->mem + buf->buf.m.offset + buf->buf.bytesused;
+    /* How many bytes really can be copied into "mem"? */
     nbytes = min((unsigned int)len, maxlen);
-    memcpy(mem, data, nbytes);
-    buf->buf.bytesused += nbytes;
 
+    /* "row_size" is the number of bytes required to store a full row of
+     * the frame.
+     */
+    row_size = video->streaming->cur_frame->wWidth *
+           video->streaming->format->bpp / 8;
+    /* Each loop "nbytes" is decremented of the number of bytes just copied.
+     * So are there any other bytes to be copied?
+     */
+    while (nbytes > 0) {
+        /* As the rows of modified frames have to be fulfilled from
+         * bottom-left to top-right, each cycle tries to complete a
+         * single row.
+         * In this cycle where is it needed to start to store bytes
+         * within the selected row? From the beginning or shifted
+         * right? Because other bytes could have been already stored in
+         * that row without completing it, so it could be needed a right
+         * shift.
+         */
+        shift_right = buf->buf.bytesused % row_size;
+        /* In this cycle how many byte can we copy in the selected row?
+         */
+        if (nbytes > row_size - shift_right)
+            to_be_copied = row_size - shift_right ;
+        else
+            to_be_copied = nbytes;
+        /* "queue->mem + buf->buf.m.offset" is the base-address where to
+         * start to store the current frame. This address refers to a
+         * preallocated area (just for a sigle frame) taking part in a
+         * circular buffer, where to store a fixed number of sequent
+         * frames.
+         */
+        memcpy(queue->mem + buf->buf.m.offset
+               /* Go to the end of this frame. */
+               + row_size * video->streaming->cur_frame->wHeight
+               /* Go back for the number of bytes corrisponding to the
+                * already fully completed rows.
+            */
+               - (buf->buf.bytesused - shift_right)
+               /* Go back at the starting point of the upper row. */
+               - row_size
+               /* Shift right on this row if it is needed. */
+               + shift_right,
+               data,
+               to_be_copied );
+        /* Update "data", "byteused" and "nbytes" values. */
+        data += to_be_copied;
+        buf->buf.bytesused += to_be_copied ;
+        nbytes -= to_be_copied;
+    }
     /* Complete the current frame if the buffer size was exceeded. */
     if (len > maxlen) {
         uvc_trace(UVC_TRACE_FRAME, "Frame complete (overflow).\n");




ВТОРОЕ РЕШЕНИЕ (НЕ ЗЕРКАЛЬНОЕ ИЗОБРАЖЕНИЕ)

Код:
diff -uN UVCVIDEO_v0.1.0/uvc_video.c UVCVIDEO_patched/uvc_video.c
--- UVCVIDEO_v0.1.0/uvc_video.c    2008-06-26 10:41:01.000000000 +0200
+++ UVCVIDEO_patched/uvc_video.c    2008-06-26 14:03:58.000000000 +0200
@@ -371,23 +371,81 @@
     return data[0];
 }
 
+/* This patch should work ONLY with YUY2 image formats, also known as YUYV or
+ * YUV422 formats.
+ * This patched function allows to overturn video images from an upside-down
+ * orientation to a normal one. The conversion consists in copying 4 bytes at a
+ * time (Y0,U0,Y1,V0) corresponding to 2 pixels from the frame (coming from the
+ * video source) to the buffer that will be used by the application requesting
+ * the video stream. But in order to satisfy the YUY2 image format byte has to
+ * be copied in this way: Y1 U0 Y0 VO. Bytes are copied in a bottom-up
+ * direction into the reversed frame.
+ * "data" stores a sequence of pixels coming from the video source.
+ * This sequence is not a full frame or a full row of pixel, but just an
+ * ordered vector of pixels (from top-left to bottom-right), whose
+ * represents just an area of the current frame and which size ("nbytes") is
+ * not constant. In fact this function has to be called hundreds of times
+ * before a frame is completed. Each time "data" contains the next part of the
+ * current frame (upside-down). At the end data stored in "mem" buffer will be
+ * used by the application who requested the video stream.
+ * No memory allocation is needed because pixel order is modified directly
+ * while copying from "data" into "mem" buffer (i.e. in each call of this
+ * function), and not just once when the frame is already completed.
+ */
 static void uvc_video_decode_data(struct uvc_video_device *video,
         struct uvc_buffer *buf, const __u8 *data, int len)
 {
     struct uvc_video_queue *queue = &video->queue;
     unsigned int maxlen, nbytes;
     void *mem;
+    /* Patch variables */
+    unsigned int i, pixel_size;
+    __u8 *ptr_tmp;
 
     if (len <= 0)
         return;
 
     /* Copy the video data to the buffer. */
+    /* How many bytes are needed to complete the buffer? */
     maxlen = buf->buf.length - buf->buf.bytesused;
+    /* Where do pixels stored in "data" have to be copied? */
     mem = queue->mem + buf->buf.m.offset + buf->buf.bytesused;
+    /* How many bytes really can be copied into "mem"? */
     nbytes = min((unsigned int)len, maxlen);
-    memcpy(mem, data, nbytes);
-    buf->buf.bytesused += nbytes;
 
+    /* "pixel_size" depens on the pixel color depth (bpp),
+     * but in YUY2 image format is constant and equal to 2.
+     */
+    pixel_size = video->streaming->format->bpp / 8;
+    /* In each loop 4 bytes are modified and copied into "mem" buffer. */
+    for (i = 0; i < nbytes; i += 2 * pixel_size) {
+            /* "queue->mem + buf->buf.m.offset" is the base-address
+             * where to start to store the current frame. This
+             * address refers to a preallocated area (just for a
+             * sigle frame) taking part in a circular buffer, where
+             * to store a fixed number of sequent frames.
+             */   
+        ptr_tmp = (__u8 *)(queue->mem + buf->buf.m.offset
+            /* Go to the end of this frame. */
+            + video->streaming->cur_frame->wWidth * pixel_size
+            * video->streaming->cur_frame->wHeight
+            /* Go back for the number of already copied bytes. */
+            - buf->buf.bytesused
+            /* Go back for the number of bytes (4 bytes) to be
+             *  copied in this cycle.
+             */
+            - 2 * pixel_size);
+        /* The order of copied bytes is changed from
+         * (Y0 U0 Y1 V1) to (Y1 U0 Y0 V1), i.e. from
+         * (#0 #1 #2 #3) to (#2 #1 #0 #3).
+         */
+        ptr_tmp[0] = ((__u8 *)(data + i))[2];
+        ptr_tmp[1] = ((__u8 *)(data + i))[1];
+        ptr_tmp[2] = ((__u8 *)(data + i))[0];
+        ptr_tmp[3] = ((__u8 *)(data + i))[3];
+        /* Update "byteused" value. */
+        buf->buf.bytesused += 2 * pixel_size;
+    }
     /* Complete the current frame if the buffer size was exceeded. */
     if (len > maxlen) {
         uvc_trace(UVC_TRACE_FRAME, "Frame complete (overflow).\n");


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Так, теперь худжее позади!!!
Нам нужно скомпилить новые файлы для установки нового драйвера, так что идём в каталог "Trunk" и в коммандной строке пишем:
Код:
make
сдесь не должно быть ошибок!!

Теперь, ТОЛЬКО если у вас один из Ubuntu дистрибутивов (ubuntu, kubuntu, etc.), откройте в редакторе "Makefile" и измените следующую строку:
Код:
INSTALL_MOD_DIR := usb/media
на
Код:
INSTALL_MOD_DIR := ubuntu/media/usbvideo
Теперь нам нужно отключить uvcvideo модуль (если он ранее был установлен):
Код:
sudo modprobe -r uvcvideo
Затем:
Код:
sudo make install
sudo modprobe uvcvideo
Тперь всё должно работать!!!

Дайте мне знать!!

И, пожалуйста, попробуйте оба решения..
Если вы не видите разницы, то используйте ВТОРОЕ решение (зеркальное или нет, как пожелаете), оно безопасней!!

Удачи,
наслаждайтесь вашей вебкамерй!! Wink

Arjos85

Записан
bsod
Участник
***
Сообщений: 166

387334592
Просмотр профиля
« Ответ #4 : 31 Июля 2008, 17:09:00 »

Спасибо, получилось, а непробовал в буке оперативку поболее вставить? У меня при покупке 2гб было, все работало супер, ну кроме камеры, щас вставил 4 гб, с видюхой чтото невообразимое творится, драва на nvidia установил когда, даже словами както неописать. Так и сижу щас с vesa. Киношки толком непосмотреть, про 3д стол вообще забыл =(
Записан
bsod
Участник
***
Сообщений: 166

387334592
Просмотр профиля
« Ответ #5 : 02 Августа 2008, 00:27:15 »

Спасибо, получилось, а непробовал в буке оперативку поболее вставить? У меня при покупке 2гб было, все работало супер, ну кроме камеры, щас вставил 4 гб, с видюхой чтото невообразимое творится, драва на nvidia установил когда, даже словами както неописать. Так и сижу щас с vesa. Киношки толком непосмотреть, про 3д стол вообще забыл =(
проблема решена перепрошивкой биоса
Записан
Omikron
Участник
***
Сообщений: 163


indikt@jabber.ru
Просмотр профиля
« Ответ #6 : 01 Февраля 2009, 01:45:18 »

Что это значит?
Код:
bk@bk-laptop:~$ cd /home/bk/trunk
bk@bk-laptop:~/trunk$ patch -p1 < uvc_video_solution1.patch
patching file uvc_video.c
Hunk #1 succeeded at 424 (offset 53 lines).
bk@bk-laptop:~/trunk$
Записан
bsod
Участник
***
Сообщений: 166

387334592
Просмотр профиля
« Ответ #7 : 01 Февраля 2009, 02:09:50 »

Что это значит?
Код:
bk@bk-laptop:~$ cd /home/bk/trunk
bk@bk-laptop:~/trunk$ patch -p1 < uvc_video_solution1.patch
patching file uvc_video.c
Hunk #1 succeeded at 424 (offset 53 lines).
bk@bk-laptop:~/trunk$
Если все делать по написаному то все получается! гдето видимо ошибся
Записан
Omikron
Участник
***
Сообщений: 163


indikt@jabber.ru
Просмотр профиля
« Ответ #8 : 05 Февраля 2009, 02:20:56 »

А кто-нибудь выложите пропатченные дрова )
Записан
bsod
Участник
***
Сообщений: 166

387334592
Просмотр профиля
« Ответ #9 : 05 Февраля 2009, 16:18:22 »

А кто-нибудь выложите пропатченные дрова )
пропатченые дрова - это как?
Что мешает сделать в консоле:
sudo apt-get install subversion
svn checkout svn://svn.berlios.de/linux-uvc/linux-uvc/trunk
cd ~/trunk
далее в этот каталог заходим с помощью наутилуса и создаем там файл с содержимым или копируем туда приведеный ниже файл(ы), выбери понравившейся.
переименуй его в uvc_video_solution1.patch
Далее в консоле
~/trunk$ patch < uvc_video_solution1.patch
~/trunk$ make
Открывай в ~/trunk файл Makefile
в нем видим строчку INSTALL_MOD_DIR := usb/media переправляем ее на INSTALL_MOD_DIR := ubuntu/media/usbvideo
Опять в терминале:
sudo modprobe -r uvcvideo
sudo make install
sudo modprobe uvcvideo
з.ы. Все делается в одном и томже терминале, или незабывай переходить в папку ~/trunk Smiley

* patch_solution1_NOTmirrored.txt (4.6 Кб - загружено 80 раз.)
* patch_solution2_mirrored.txt (4.09 Кб - загружено 98 раз.)
Записан
Omikron
Участник
***
Сообщений: 163


indikt@jabber.ru
Просмотр профиля
« Ответ #10 : 05 Февраля 2009, 18:24:50 »

А кто-нибудь выложите пропатченные дрова )
пропатченые дрова - это как?
Что мешает сделать в консоле:
sudo apt-get install subversion
svn checkout svn://svn.berlios.de/linux-uvc/linux-uvc/trunk
cd ~/trunk
далее в этот каталог заходим с помощью наутилуса и создаем там файл с содержимым или копируем туда приведеный ниже файл(ы), выбери понравившейся.
переименуй его в uvc_video_solution1.patch
Далее в консоле
~/trunk$ patch < uvc_video_solution1.patch
~/trunk$ make
Открывай в ~/trunk файл Makefile
в нем видим строчку INSTALL_MOD_DIR := usb/media переправляем ее на INSTALL_MOD_DIR := ubuntu/media/usbvideo
Опять в терминале:
sudo modprobe -r uvcvideo
sudo make install
sudo modprobe uvcvideo
з.ы. Все делается в одном и томже терминале, или незабывай переходить в папку ~/trunk Smiley

Все тоже самое
Цитата
bk@bk-laptop:~/trunk$ patch < uvc_video_solution2.patch
patching file uvc_video.c
Hunk #1 succeeded at 424 (offset 53 lines).
bk@bk-laptop:~/trunk$
Записан
bsod
Участник
***
Сообщений: 166

387334592
Просмотр профиля
« Ответ #11 : 05 Февраля 2009, 20:05:09 »

Вот папка где все выше перечисленые манипуляции выполнял.
з.ы. а эту команду точно вводил?
sudo apt-get install subversion

* trunk.tar.gz (98.99 Кб - загружено 67 раз.)
Записан
Omikron
Участник
***
Сообщений: 163


indikt@jabber.ru
Просмотр профиля
« Ответ #12 : 07 Февраля 2009, 18:29:25 »

Вот папка где все выше перечисленые манипуляции выполнял.
з.ы. а эту команду точно вводил?
sudo apt-get install subversion
Все установлено. Поставил дрова из этой папки, изображение перевернутое.
Записан
bsod
Участник
***
Сообщений: 166

387334592
Просмотр профиля
« Ответ #13 : 21 Июля 2009, 19:09:07 »

Переставил ос, обновился, 2.6.24-24-generic. Проблема больше так не решается.  Undecided
Записан
Вazilio
Автор темы
Новичок
*
Сообщений: 11


Kubuntu user

bazilio@co.ru
Просмотр профиля WWW
« Ответ #14 : 21 Июля 2009, 22:17:21 »

Да, так не работает.
но можно попробовать так:
http://forum.ubuntu.ru/index.php?topic=59385.msg438527#msg438527
Записан
Страниц: [1] 2  Все   Вверх
Печать
Русскоязычное сообщество Ubuntu Linux  |  Поддержка  |  Железо  |  Тема: Лаптоп ASUS G1S: изображение с вебкамеры вверх ногами. [РЕШЕНО]
Перейти в:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006, Simple Machines LLC Best Hosting
Серверы на Ubuntu
Страница сгенерирована за 0.156 секунд. Запросов: 18.