Steps:
video loopback driver is loaded, adb has forwarded port correctly and USB webcam application is started on Android phone.
After starting the application on my Debian linux desktop I get the following error:
Initializing objects...
Opening connection..
Could not open video device: "Device or resource busy" ( 5 )
error on VIDIOCGCAP: Bad file descriptor
error on VIDIOCGPICT: Bad file descriptor
Stack trace from GDB is below.
(gdb) r /dev/video0
Starting program: /home/wise0wl/marcogulino-AndroidUsbCamera-f4da78b/AndroidUsbCamera /dev/video0
[Thread debugging using libthread_db enabled]
Initializing objects...
[New Thread 0x7ffff2a83710 (LWP 20740)]
Opening connection..
Could not open video device: "Device or resource busy" ( 5 )
[Thread 0x7ffff2a83710 (LWP 20740) exited]
[New Thread 0x7ffff2282710 (LWP 20741)]
error on VIDIOCGCAP: Bad file descriptor
error on VIDIOCGPICT: Bad file descriptor
Program received signal SIGSEGV, Segmentation fault.
0x000000000040b9b5 in FramesConverter::gotFrame(Frame*) ()
(gdb) bt
0 0x000000000040b9b5 in FramesConverter::gotFrame(Frame*) ()
1 0x000000000040bf3f in FramesConverter::qt_metacall(QMetaObject::Call, int, void**) ()
2 0x00007ffff7ada2e6 in QMetaObject::activate(QObject, QMetaObject const, int, void**) () from /usr/lib/libQtCore.so.4
3 0x000000000040abbf in FramesCreator::frameProcessed(Frame*) ()
4 0x000000000040a9aa in FramesCreator::addFramesData(QByteArray const&) ()
5 0x000000000040adfd in FramesDataExtractor::gotFramesData(QByteArray) ()
6 0x000000000040b2d7 in SocketConnector::gotData() ()
7 0x000000000040b41a in SocketConnector::qt_metacall(QMetaObject::Call, int, void**) ()
8 0x00007ffff7ada2e6 in QMetaObject::activate(QObject, QMetaObject const, int, void**) () from /usr/lib/libQtCore.so.4
9 0x000000000040c445 in SocketInterface::readyRead() ()
10 0x000000000040c3e4 in SocketInterface::qt_metacall(QMetaObject::Call, int, void**) ()
11 0x00007ffff7ada2e6 in QMetaObject::activate(QObject, QMetaObject const, int, void**) () from /usr/lib/libQtCore.so.4
12 0x00007ffff71798ef in ?? () from /usr/lib/libQtNetwork.so.4
13 0x00007ffff7168a61 in ?? () from /usr/lib/libQtNetwork.so.4
14 0x00007ffff7ac709c in QCoreApplication::notifyInternal(QObject, QEvent) () from /usr/lib/libQtCore.so.4
15 0x00007ffff7af0a6a in ?? () from /usr/lib/libQtCore.so.4
16 0x00007ffff4e856f2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
17 0x00007ffff4e89568 in ?? () from /lib/libglib-2.0.so.0
18 0x00007ffff4e8971c in g_main_context_iteration () from /lib/libglib-2.0.so.0
19 0x00007ffff7af06b3 in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /usr/lib/libQtCore.so.4
20 0x00007ffff7ac59c2 in QEventLoop::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /usr/lib/libQtCore.so.4
21 0x00007ffff7ac5d9c in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from /usr/lib/libQtCore.so.4
22 0x00007ffff7acaa2b in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
Steps: video loopback driver is loaded, adb has forwarded port correctly and USB webcam application is started on Android phone.
After starting the application on my Debian linux desktop I get the following error: Initializing objects... Opening connection.. Could not open video device: "Device or resource busy" ( 5 ) error on VIDIOCGCAP: Bad file descriptor error on VIDIOCGPICT: Bad file descriptor
Stack trace from GDB is below.
(gdb) r /dev/video0 Starting program: /home/wise0wl/marcogulino-AndroidUsbCamera-f4da78b/AndroidUsbCamera /dev/video0 [Thread debugging using libthread_db enabled] Initializing objects... [New Thread 0x7ffff2a83710 (LWP 20740)] Opening connection.. Could not open video device: "Device or resource busy" ( 5 ) [Thread 0x7ffff2a83710 (LWP 20740) exited] [New Thread 0x7ffff2282710 (LWP 20741)] error on VIDIOCGCAP: Bad file descriptor error on VIDIOCGPICT: Bad file descriptor
Program received signal SIGSEGV, Segmentation fault. 0x000000000040b9b5 in FramesConverter::gotFrame(Frame*) () (gdb) bt
0 0x000000000040b9b5 in FramesConverter::gotFrame(Frame*) ()
1 0x000000000040bf3f in FramesConverter::qt_metacall(QMetaObject::Call, int, void**) ()
2 0x00007ffff7ada2e6 in QMetaObject::activate(QObject, QMetaObject const, int, void**) () from /usr/lib/libQtCore.so.4
3 0x000000000040abbf in FramesCreator::frameProcessed(Frame*) ()
4 0x000000000040a9aa in FramesCreator::addFramesData(QByteArray const&) ()
5 0x000000000040adfd in FramesDataExtractor::gotFramesData(QByteArray) ()
6 0x000000000040b2d7 in SocketConnector::gotData() ()
7 0x000000000040b41a in SocketConnector::qt_metacall(QMetaObject::Call, int, void**) ()
8 0x00007ffff7ada2e6 in QMetaObject::activate(QObject, QMetaObject const, int, void**) () from /usr/lib/libQtCore.so.4
9 0x000000000040c445 in SocketInterface::readyRead() ()
10 0x000000000040c3e4 in SocketInterface::qt_metacall(QMetaObject::Call, int, void**) ()
11 0x00007ffff7ada2e6 in QMetaObject::activate(QObject, QMetaObject const, int, void**) () from /usr/lib/libQtCore.so.4
12 0x00007ffff71798ef in ?? () from /usr/lib/libQtNetwork.so.4
13 0x00007ffff7168a61 in ?? () from /usr/lib/libQtNetwork.so.4
14 0x00007ffff7ac709c in QCoreApplication::notifyInternal(QObject, QEvent) () from /usr/lib/libQtCore.so.4
15 0x00007ffff7af0a6a in ?? () from /usr/lib/libQtCore.so.4
16 0x00007ffff4e856f2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
17 0x00007ffff4e89568 in ?? () from /lib/libglib-2.0.so.0
18 0x00007ffff4e8971c in g_main_context_iteration () from /lib/libglib-2.0.so.0
19 0x00007ffff7af06b3 in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /usr/lib/libQtCore.so.4
20 0x00007ffff7ac59c2 in QEventLoop::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /usr/lib/libQtCore.so.4
21 0x00007ffff7ac5d9c in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from /usr/lib/libQtCore.so.4
22 0x00007ffff7acaa2b in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
23 0x0000000000407385 in main ()