Sunday, October 26, 2014

Guvcview black screen with Linux kernel 3.16

Sorry I haven't posted anything in forever, I've just been really busy gaming and livestreaming using Linux via obs-studio along with nginx to push a 2,000Kbps flv stream to both Hitbox and Twitch at the same time. This recent incident made me feel obligated to let other Linux users know what I experienced so I decided to come to my long forgotten blog and blog it.
My system has been running rock solid as of late (Xubuntu 14.04) but my friend was telling me about Ubuntu 14.10 and how it had kernel 3.16 in it by default. I believe Xubuntu 14.04 will only ever have kernel 3.13 so after feeling inadequate I thought to myself, "what's preventing me from running kernel 3.16 also?" So I found a great tutorial for installing Ubuntu Utopic's mainline 3.16 kernel into my Xubuntu 14.04 system. It was painless and believe it or not DKMS actually worked for my proprietary Nvidia graphics driver so I didn't even need to reinstall the graphics driver after installing the new kernel.

The system booted right up and all was well, or was it? I noticed that when I launched Guvcview I was only getting a black screen. To the terminal I went, launching an app from a terminal window provides a lot of information that you just don't see when launching an app from a menu or launcher. The output looked like this
guvcview 1.7.1
file guvcview_video.mkv has extension type 1
file guvcview_image.jpg has extension type 0

** (guvcview:2853): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-RZEC5PqweK: Connection refused
file guvcview_image.jpg has extension type 0
Video file suffix detected: 0
Image file suffix detected: 3
ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started

(guvcview:2853): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:63:17: Theming engine 'unico' not found
video device: /dev/video0
Init. UVC Camera (046d:081a) (location: usb-0000:00:14.0-3)
{ pixelformat = 'YUYV', description = 'YUV 4:2:2 (YUYV)' }
{ discrete: width = 640, height = 480 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 160, height = 120 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 176, height = 144 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 320, height = 176 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 320, height = 240 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 352, height = 288 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 432, height = 240 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 544, height = 288 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 640, height = 360 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 752, height = 416 }
 Time interval between frame: 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 800, height = 448 }
 Time interval between frame: 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 800, height = 600 }
 Time interval between frame: 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 864, height = 480 }
 Time interval between frame: 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 960, height = 544 }
 Time interval between frame: 1/15, 1/10, 1/5,
{ discrete: width = 960, height = 720 }
 Time interval between frame: 1/10, 1/5,
{ discrete: width = 1024, height = 576 }
 Time interval between frame: 1/10, 1/5,
{ discrete: width = 1184, height = 656 }
 Time interval between frame: 1/10, 1/5,
{ discrete: width = 1280, height = 720 }
 Time interval between frame: 1/10, 1/5,
{ discrete: width = 1280, height = 960 }
 Time interval between frame: 2/15, 1/5,
{ pixelformat = 'MJPG', description = 'MJPEG' }
{ discrete: width = 640, height = 480 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 160, height = 120 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 176, height = 144 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 320, height = 176 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 320, height = 240 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 352, height = 288 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 432, height = 240 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 544, height = 288 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 640, height = 360 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 752, height = 416 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 800, height = 448 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 800, height = 600 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 864, height = 480 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 960, height = 544 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 960, height = 720 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1024, height = 576 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1184, height = 656 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1280, height = 720 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1280, height = 960 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ pixelformat = 'RGB3', description = 'RGB3' }
{ discrete: width = 640, height = 480 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 160, height = 120 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 176, height = 144 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 320, height = 176 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 320, height = 240 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 352, height = 288 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 432, height = 240 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 544, height = 288 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 640, height = 360 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 752, height = 416 }
 Time interval between frame: 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 800, height = 448 }
 Time interval between frame: 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 800, height = 600 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 864, height = 480 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 960, height = 544 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 960, height = 720 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1024, height = 576 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1184, height = 656 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1280, height = 720 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1280, height = 960 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ pixelformat = 'BGR3', description = 'BGR3' }
{ discrete: width = 640, height = 480 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 160, height = 120 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 176, height = 144 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 320, height = 176 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 320, height = 240 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 352, height = 288 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 432, height = 240 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 544, height = 288 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 640, height = 360 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 752, height = 416 }
 Time interval between frame: 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 800, height = 448 }
 Time interval between frame: 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 800, height = 600 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 864, height = 480 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 960, height = 544 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 960, height = 720 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1024, height = 576 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1184, height = 656 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1280, height = 720 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1280, height = 960 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ pixelformat = 'YU12', description = 'YU12' }
{ discrete: width = 640, height = 480 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 160, height = 120 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 176, height = 144 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 320, height = 176 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 320, height = 240 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 352, height = 288 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 432, height = 240 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 544, height = 288 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 640, height = 360 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 752, height = 416 }
 Time interval between frame: 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 800, height = 448 }
 Time interval between frame: 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 800, height = 600 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 864, height = 480 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 960, height = 544 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 960, height = 720 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1024, height = 576 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1184, height = 656 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1280, height = 720 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1280, height = 960 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ pixelformat = 'YV12', description = 'YV12' }
{ discrete: width = 640, height = 480 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 160, height = 120 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 176, height = 144 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 320, height = 176 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 320, height = 240 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 352, height = 288 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 432, height = 240 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 544, height = 288 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 640, height = 360 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 752, height = 416 }
 Time interval between frame: 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 800, height = 448 }
 Time interval between frame: 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 800, height = 600 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 864, height = 480 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 960, height = 544 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 960, height = 720 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1024, height = 576 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1184, height = 656 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1280, height = 720 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 1280, height = 960 }
 Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
vid:046d
pid:081a
driver:uvcvideo
mapping control for Pan (relative)
UVCIOC_CTRL_MAP - Error: No such file or directory
mapping control for Tilt (relative)
UVCIOC_CTRL_MAP - Error: No such file or directory
mapping control for Pan Reset
UVCIOC_CTRL_MAP - Error: No such file or directory
mapping control for Tilt Reset
UVCIOC_CTRL_MAP - Error: No such file or directory
mapping control for Focus (absolute)
UVCIOC_CTRL_MAP - Error: No such file or directory
mapping control for LED1 Mode
UVCIOC_CTRL_MAP - Error: No such file or directory
mapping control for LED1 Frequency
UVCIOC_CTRL_MAP - Error: No such file or directory
mapping control for Disable video processing
UVCIOC_CTRL_MAP - Error: No such file or directory
mapping control for Raw bits per pixel
UVCIOC_CTRL_MAP - Error: No such file or directory
mapping control for Off
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
checking format: 1196444237
VIDIOC_G_COMP:: Inappropriate ioctl for device
fps is set to 1/20
drawing controls

=======[ Output Device #1 ]=======
Description: Built-in Audio Analog Stereo
Name: alsa_output.pci-0000_00_1b.0.analog-stereo
Index: 0
Channels: 2
SampleRate: 44100
Latency: 10438 (usec)
Card: 2

=======[ Input Device #1 ]=======
Description: 081a Analog Mono
Name: alsa_input.usb-046d_081a_13339CA0-02-U0x46d0x81a.analog-mono
Index: 0
Channels: 1 (default to: 1)
SampleRate: 48000
Latency: 140 (usec)
Card: 1

=======[ Input Device #2 ]=======
Description: Monitor of Built-in Audio Analog Stereo
Name: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
Index: 1
Channels: 2 (default to: 2)
SampleRate: 44100
Latency: 0 (usec)
Card: 2

=======[ Input Device #3 ]=======
Description: Built-in Audio Analog Stereo
Name: alsa_input.pci-0000_00_1b.0.analog-stereo
Index: 2
Channels: 2 (default to: 2)
SampleRate: 44100
Latency: 59 (usec)
Card: 2

Checking video mode 320x240@32bpp : OK
Ignoring empty buffer ...
Ignoring empty buffer ...
write /home/ubu/.config/guvcview/video0 OK
free controls
cleaned allocations - 100%
Closing portaudio ...OK
Closing GTK... OK

Now I don't know exactly what this means but basically it's not receiving anything from the buffer. I tried to play around with the video format from MJPG to YU12 but that just changed the preview window from black to green.

I thought maybe I needed to get a more recent version of Guvcview since the one that's provided within the Ubuntu 14.04 repository is only version 1.7.1 but even after enabling a PPA which had version 2.0.0 that still provided the same results which was a black screen. The error I got using the 2.0.0 version was as follows:
GUVCIEW: Error - Couldn't decode frame
V4L2_CORE: not decoding empty raw frame
Booting my machine using kernel 3.13.0-38-generic made Guvcview work again so there's something wrong with Guvcview with the new 3.16 kernel but I would like to point out that Cheese, OBS-Studio (using the v4l plugin) as well as Skype video chat work just fine so I believe it's something specific to Guvcview or even possibly the module that it uses which is uvcvideo but I'm not so sure about that since those 3 other software titles worked with the 3.16 kernel.

I really enjoy Guvcview because it has a lot of options that just aren't in Cheese and I haven't searched for any other applications that can record video from my Logitech C260 webcam. For now I have to just keep booting into kernel 3.13 if I want to use Guvcview. That's one thing I really like about Linux is it's versatility in options, I install a new kernel but if something isn't working right with the new kernel than all I have to do is watch for the GRUB boot menu and choose the kernel that I'd like to boot into. I can then either uninstall kernel 3.16 OR modify GRUB so that it boots the kernel I want by default and not just the latest installed kernel. Accomplishing that is possibly for another blog post so until next, I'll smell ya when I smell ya.

-Ubu out

UPDATE: The developer got back to me via email within about 6 hours and informed me that I needed to run his testing PPA in order to get Guvcview to work with kernel 3.16 and sure enough as soon as I enabled the testing PPA now Guvcview works again. To reiterate the testing PPA has version 2.0.1 in it whereas the stable PPA only has version 2.0.0 for Trusty Tahr. YIPPIE!!! One thing I would like to point out about PPA's is that just removing a certain PPA (add-apt-repository -r) does NOT revert packages back to their previously installed versions before you enabled a particular PPA, you need to use the ppa-purge command. That not only removes a certain PPA but also reverts any packages that were installed using the PPA that you're purging so to ensure this all works if you had installed his Stable PPA which provided version 2.0.0 and it still didn't work ensure you used ppa-purge ppa:pj-assis/ppa and then add his Testing PPA using sudo add-apt-repository ppa:pj-assis/testing and you should be golden.
Post a Comment