Bug 815581

Summary: Could not map/get buffers from device '/dev/video0' errors when trying to record
Product: [Fedora] Fedora Reporter: fedora
Component: cheeseAssignee: Matthias Clasen <mclasen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: a.volovic, edosurina, fedora, hdegoede, mclasen, nhorman, peter.weber
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-10 23:57:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description fedora 2012-04-24 00:07:12 UTC
Description of problem:
Cheese takes photos as expected, but doesn't record videos.
When trying to record videos, the picture from the webcam freezes and nothing is recorded, but cheese is still responsive.

Version-Release number of selected component (if applicable):
latest version in fedora 16

How reproducible:
Always


Steps to Reproduce:
1. Open cheese
2. Select "Video"
3. Click "Record a Video"


Additional info:
Output on console:
$ LC_ALL=C cheese

(cheese:7294): Gtk-WARNING **: Attempting to add a widget with type GtkImage to a GtkToggleButton, but as a GtkBin subclass a GtkToggleButton can only contain one widget at a time; it already contains a widget of type GtkLabel

(cheese:7294): Gtk-WARNING **: Attempting to add a widget with type GtkImage to a GtkToggleButton, but as a GtkBin subclass a GtkToggleButton can only contain one widget at a time; it already contains a widget of type GtkLabel

(cheese:7294): Gtk-WARNING **: Attempting to add a widget with type GtkImage to a GtkToggleButton, but as a GtkBin subclass a GtkToggleButton can only contain one widget at a time; it already contains a widget of type GtkLabel

(cheese:7294): Gtk-WARNING **: Attempting to add a widget with type GtkHBox to a GtkButton, but as a GtkBin subclass a GtkButton can only contain one widget at a time; it already contains a widget of type GtkLabel

(cheese:7294): Gtk-WARNING **: Attempting to add a widget with type GtkImage to a GtkButton, but as a GtkBin subclass a GtkButton can only contain one widget at a time; it already contains a widget of type GtkLabel

(cheese:7294): Gtk-WARNING **: Attempting to add a widget with type GtkHBox to a GtkToggleButton, but as a GtkBin subclass a GtkToggleButton can only contain one widget at a time; it already contains a widget of type GtkLabel

(cheese:7294): Gtk-WARNING **: Attempting to add a widget with type GtkImage to a GtkButton, but as a GtkBin subclass a GtkButton can only contain one widget at a time; it already contains a widget of type GtkLabel

** (cheese:7294): WARNING **: Could not get buffers from device '/dev/video0'.


** (cheese:7294): WARNING **: Could not map buffers from device '/dev/video0'


** (cheese:7294): WARNING **: Could not negotiate format


** (cheese:7294): WARNING **: Could not get buffers from device '/dev/video0'.


** (cheese:7294): WARNING **: Could not map buffers from device '/dev/video0'


** (cheese:7294): WARNING **: Could not negotiate format

Comment 1 Peter Weber 2012-05-01 14:50:26 UTC
Exactly the same here, with Archlinux. One thing to add, if I set a lower resolution for "video" in cheese, it write this line before I hit the record button:

libv4l2: warning v4l2 mmap buffers still mapped on close()

After I push the record button, this lines will follow:
** (cheese:1590): WARNING **: Could not get buffers from device '/dev/video0'.


** (cheese:1590): WARNING **: Could not map buffers from device '/dev/video0'


** (cheese:1590): WARNING **: Could not negotiate format


** (cheese:1590): WARNING **: Could not get buffers from device '/dev/video0'.


** (cheese:1590): WARNING **: Could not map buffers from device '/dev/video0'


** (cheese:1590): WARNING **: Could not negotiate format

Comment 2 Hans de Goede 2012-06-06 10:41:20 UTC
*** Bug 822091 has been marked as a duplicate of this bug. ***

Comment 3 Hans de Goede 2012-06-06 10:43:44 UTC
Can I get the output of "lsusb" from all people who are seeing this bug please? Hopefully I've one of your webcams in my collection, so that I can reproduce.

Also it would be helpful if you can check if you can still reproduce this with all the latest updates (preferably with Fedora-17).

Comment 4 Alexander Volovics 2012-06-06 11:05:46 UTC
Hello,

The photo resolution and video resolution are (and have been) the same.
No other video programs are (were) open. The bug remains: cheese can take photos
but it cannot record videos!

By the way there is another problem (maybe related to the above?).
If an attempt is made to record a video (which fails) and cheese
is switched back to photo mode to try to take a photo nothing happens.
Cheese is 'frozen' and has to be restarted to be able to take a photo.

Dell Vostro lsusb:
Bus 001 Device 005: ID 05ca:181f Ricoh Co., Ltd

Lenovo ThinkCentre Edge 91z lsusb:
Bus 001 Device 003: ID 0ac8:c449 Z-Star Microelectronics Corp

Lenovo ThinPad T520 lsusb:
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd 

Fedora 17 completely up to date in all 3 devices.

Alexander Volovics

Comment 5 Hans de Goede 2012-06-06 11:11:47 UTC
*** Bug 827218 has been marked as a duplicate of this bug. ***

Comment 6 Hans de Goede 2012-06-06 11:18:59 UTC
Hi,

(In reply to comment #4)
> Hello,
> 
> The photo resolution and video resolution are (and have been) the same.
> No other video programs are (were) open. The bug remains: cheese can take
> photos
> but it cannot record videos!
> 
> By the way there is another problem (maybe related to the above?).
> If an attempt is made to record a video (which fails) and cheese
> is switched back to photo mode to try to take a photo nothing happens.
> Cheese is 'frozen' and has to be restarted to be able to take a photo.
> 
> Dell Vostro lsusb:
> Bus 001 Device 005: ID 05ca:181f Ricoh Co., Ltd
> 
> Lenovo ThinkCentre Edge 91z lsusb:
> Bus 001 Device 003: ID 0ac8:c449 Z-Star Microelectronics Corp
> 
> Lenovo ThinPad T520 lsusb:
> Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd 

Ok, so some pretty standard UVC cams, at which resolution are you trying to record, and can
you try to lower the resolution?

Also can you provide me with the output of:
rpm -q libv4l
uname -a

Thanks,

Hans

Comment 7 Alexander Volovics 2012-06-06 11:29:16 UTC
All resolutions the same: can take photo but not record video.
(and idem for different resolutions for photo and video)

$ rpm -q libv4l
libv4l-0.8.8-1.fc17.x86_64

$ uname -a
Linux vol.localhost.localdomain 3.3.7-1.fc17.x86_64 #1 SMP Mon May 21 22:32:19 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Alexander

Comment 8 Hans de Goede 2012-06-06 13:58:19 UTC
I've prepared a gstreamer-plugins-good update for Fedora-17, which *may* fix this issue, please give it a try. Note I've also done a new cheese build fixing some (likely) unrelated issues. When testing please get both the updated cheese and the updated gstreamer-plugins-good. Download the rpms for your architecture here (for cheese you also need to download cheese-libs):
http://koji.fedoraproject.org/koji/buildinfo?buildID=322301
http://koji.fedoraproject.org/koji/buildinfo?buildID=322308

And then run as root:
rpm -Uvh *.rpm

Comment 9 Aram Agajanian 2012-06-06 15:06:19 UTC
The builds from Comment #8 have been installed on my PC and it is otherwise up-to-date.

Improvements:

= Cheese doesn't become completely unresponsive when I try to record a video.

= When I lower the resolution to 1024x576, the responsiveness of the video preview is much better when Recording a Video.

= There are no more messages to the console, including "WARNING **: Device '/dev/video0' is busy".

Issues:

= Starting cheese still takes about 30 seconds.

= Changing resolution in Preferences takes about 50 seconds.

= Recording a Video at a higher resolution makes the frame rate slow.

= There are no recorded images or videos in the area at the bottom of the window.

Comment 10 Aram Agajanian 2012-06-06 15:20:13 UTC
I just noticed that the recorded photos and videos are accessible if Cheese switches to Wide Mode.  (The option to do this is in the Cheese menu.)

Comment 11 Hans de Goede 2012-06-06 15:23:37 UTC
Hi,

(In reply to comment #9)
> The builds from Comment #8 have been installed on my PC and it is otherwise
> up-to-date.
> 
> Improvements:
> 
> = Cheese doesn't become completely unresponsive when I try to record a video.
> 

Good :)

> = When I lower the resolution to 1024x576, the responsiveness of the video
> preview is much better when Recording a Video.
> 

This is expected, encoding is pretty CPU intensive, and we don't support GPU offloading for this unfortunately, also see bug 

> = There are no more messages to the console, including "WARNING **: Device
> '/dev/video0' is busy".

Good.

> Issues:
> 
> = Starting cheese still takes about 30 seconds.

Hmm, do you have any files under: ~/Videos/Webcam, and if you do could you try moving them to some other place (or removing them altogether) ?

> 
> = Changing resolution in Preferences takes about 50 seconds.
> 

Hmm again, probably related to the startup delay, lets try to tackle that first.

> = Recording a Video at a higher resolution makes the frame rate slow.

See above.

> = There are no recorded images or videos in the area at the bottom of the
> window.

Yes, I've noticed this too, can you please file a separate Fedora bug for tracking this, and in that bug report include a link to this upstream bug:
https://bugzilla.gnome.org/show_bug.cgi?id=671725

Thanks & Regards,

Hans

Comment 12 Aram Agajanian 2012-06-06 15:40:33 UTC
(In reply to comment #11)
> > Issues:
> > 
> > = Starting cheese still takes about 30 seconds.
> 
> Hmm, do you have any files under: ~/Videos/Webcam, and if you do could you
> try moving them to some other place (or removing them altogether) ?
> 

After I moved any files out of ~/Videos/Webcam, it still takes about 30 seconds for the Cheese window to appear.

Comment 13 Alexander Volovics 2012-06-06 21:12:05 UTC
I downloaded and installed the 3 rpm's.

The situation has improved in so far as it is possible to record
videos (at least with resolution 1920x1080, 1600x1200, 1280x1024
and 1280x720. The start is delayed and the movement on the cheese
screen is a little jerky).

At ALL resolutions below 1280x720 cheese freezes or at the lowest
resolutions, 176x144 and 160x120, crashes and disappears.
Empty files are written to /Videos/Webcam.

After the crash cheese would start up but was not responsive.
The cheese screen remained black and the menu's and buttons did
not work. After waiting a very long time cheese became 'alive'
again.

Even when working cheese is not very responsive and makes an
'unstable' impression.

It is not up to the standard displayed in Fedora 16.

Alexander

Comment 14 Aram Agajanian 2012-06-07 21:29:11 UTC
(In reply to comment #11)
> > = There are no recorded images or videos in the area at the bottom of the
> > window.
> 
> Yes, I've noticed this too, can you please file a separate Fedora bug for
> tracking this, and in that bug report include a link to this upstream bug:
> https://bugzilla.gnome.org/show_bug.cgi?id=671725

See bug #829957.

Comment 15 Hans de Goede 2012-06-08 12:42:30 UTC
Hi,

(In reply to comment #13)
> I downloaded and installed the 3 rpm's.
> 
> The situation has improved in so far as it is possible to record
> videos (at least with resolution 1920x1080, 1600x1200, 1280x1024
> and 1280x720. The start is delayed and the movement on the cheese
> screen is a little jerky).

The startup delay is a known issue which is being tracked in bug 797188. I'm currently preparing an update fixing this.

> 
> At ALL resolutions below 1280x720 cheese freezes or at the lowest
> resolutions, 176x144 and 160x120, crashes and disappears.

This is likely bug 820959, cheese is prone to crash when changing settings, I need to investigate this. Try first changing the resolution, then exiting cheese, then re-start cheese and start recording directly (without going to the effectspage first).

> Empty files are written to /Videos/Webcam.

This is a result of the crashes.

> After the crash cheese would start up but was not responsive.
> The cheese screen remained black and the menu's and buttons did
> not work. After waiting a very long time cheese became 'alive'
> again.

This is caused by the empty files, I've filed bug 830166 to track this.

> Even when working cheese is not very responsive and makes an
> 'unstable' impression.

I'm afraid that you're right. I hope to be able to fix this in the coming time ...

Note that this bug from now on only is for tracking the recording not working in combination with
"Could not map/get buffers from device '/dev/video0'" errors printed to the console, for other issues please add comments to the relevant bugs, or file a new one.

Regards,

Hans

Comment 16 Hans de Goede 2012-06-08 12:46:51 UTC
As you all have noticed, I've been working a lot on fixing cheese / gstreamer bugs the last few days, unfortunately the various bugs about cheese all contain comments about various different issues,
so in order to sort things out, I'm going to update the summary of various bugs, to make clear
which bug is about what.

Pease only add comments to bugs if the bug matches the problem you are having! If none of the below bugs match your issue, please file a new bug!

Here is a list of all bugs I'm actively working on, or which are on my todo list:

bug 797188   10-90 seconds delay before showing video
bug 810429   Cheese crashes on machines with radio/tv devices
bug 815134   Cheese not working with webcam on Thinkpad x120e / x121e
bug 815581   Could not map/get buffers from device '/dev/video0' errors when trying to record
bug 820959   Crash when selecting effects, followed by starting recording or switching resolution
bug 829957   Recorded pictures and videos do not appear in area at bottom of Cheese window
bug 830166   Long starup delay when 0 sized filed exist under Videos/Webcam

Comment 17 Fedora Update System 2012-06-08 21:11:28 UTC
gstreamer-plugins-bad-free-0.10.23-6.fc17,gstreamer-plugins-good-0.10.31-3.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/gstreamer-plugins-bad-free-0.10.23-6.fc17,gstreamer-plugins-good-0.10.31-3.fc17

Comment 18 Fedora Update System 2012-06-10 01:30:30 UTC
Package gstreamer-plugins-bad-free-0.10.23-6.fc17, gstreamer-plugins-good-0.10.31-3.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gstreamer-plugins-bad-free-0.10.23-6.fc17 gstreamer-plugins-good-0.10.31-3.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-9182/gstreamer-plugins-bad-free-0.10.23-6.fc17,gstreamer-plugins-good-0.10.31-3.fc17
then log in and leave karma (feedback).

Comment 19 Fedora Update System 2012-06-10 23:57:39 UTC
gstreamer-plugins-bad-free-0.10.23-6.fc17, gstreamer-plugins-good-0.10.31-3.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 20 Alexander Volovics 2012-06-11 08:14:11 UTC
Sorry for the delay. Was away all Saturday and Sunday.
Did not see your comments before this morning, 11 juni.

No problems accessing /dev/video0 when trying to record anymore!

All other "problems" with cheese remain though.
I have no idea how the gstreamer plugins are involved.