the rhythmbox mtp code hijacks cameras

Bug #544994 reported by Dave Morley
58
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Rhythmbox
Expired
Medium
rhythmbox (Ubuntu)
Fix Released
Medium
Martin Pitt
Lucid
Won't Fix
Medium
Unassigned
Maverick
Fix Released
Medium
Unassigned

Bug Description

This camera is being mounted in Rhythmbox as a media player rather than in F-spot as a camera.

Steps to reproduce:
1. Connect the camera to the computer.
2. Switch on the camera to enable usb mode transfers
3. Open Rhythmbox not it appears in there under media device however it doesn't show up in Nautilus at all.

== Regression details ==
Discovered in version: rhythmbox | 0.12.8-0ubuntu3
Last known good version: ?

ProblemType: Bug
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.21.
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: davmor2 2164 F.... pulseaudio
 /dev/snd/pcmC0D0p: davmor2 2164 F...m pulseaudio
 /dev/snd/controlC1: davmor2 2164 F.... pulseaudio
CRDA: Error: [Errno 2] No such file or directory
Card0.Amixer.info:
 Card hw:0 'NVidia'/'HDA NVidia at 0xdfff8000 irq 22'
   Mixer name : 'Realtek ALC662 rev1'
   Components : 'HDA:10ec0662,18493662,00100101'
   Controls : 36
   Simple ctrls : 19
Card1.Amixer.info:
 Card hw:1 'default'/'C-Media USB Headphone Set at usb-0000:00:02.1-4.2.2, full speed'
   Mixer name : 'USB Mixer'
   Components : 'USB0d8c:000c'
   Controls : 7
   Simple ctrls : 3
Date: Tue Mar 23 11:42:19 2010
DistroRelease: Ubuntu 10.04
GvfsMonitorLog: Monitoring events. Press Ctrl+C to quit.
HibernationDevice: RESUME=UUID=49dbc685-d3cb-4396-adca-97e7b3beda5a
HotplugNewDevices:

HotplugNewMounts:

InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Beta amd64 (20100318)
IwConfig:
 lo no wireless extensions.

 eth0 no wireless extensions.
MachineType: To Be Filled By O.E.M. To Be Filled By O.E.M.
NonfreeKernelModules: nvidia
Package: linux-image-2.6.32-16-generic 2.6.32-16.25
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.32-16-generic root=UUID=13be5a81-5200-492d-a0f5-f35e65a158cc ro quiet splash
ProcEnviron:
 LANG=en_GB.utf8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-16.25-generic
Regression: Yes
RelatedPackageVersions: linux-firmware 1.33
Reproducible: Yes
RfKill:

SourcePackage: linux
Symptom: storage
TestedUpstream: No
UdisksMonitorLog: Monitoring activity from the disks daemon. Press Ctrl+C to cancel.
Uname: Linux 2.6.32-16-generic x86_64
dmi.bios.date: 09/18/2008
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: P1.00
dmi.board.name: N61P-S
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrP1.00:bd09/18/2008:svnToBeFilledByO.E.M.:pnToBeFilledByO.E.M.:pvrToBeFilledByO.E.M.:rvn:rnN61P-S:rvr:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.name: To Be Filled By O.E.M.
dmi.product.version: To Be Filled By O.E.M.
dmi.sys.vendor: To Be Filled By O.E.M.

Revision history for this message
Dave Morley (davmor2) wrote :
Changed in linux (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Dave Morley (davmor2) wrote :

Martin I added a snapshot of nautilus and RB together so you can see what I mean about it showing up in one and not the other

Revision history for this message
Hernando Torque (htorque) wrote :

I can reproduce it with a Fuji F100fd.

Plugging it in with RB not running: automounts + dialog "You have just inserted a medium with digital photos. [...]".

Plugging it in with RB running: no automount, doesn't show up in Nautilus, shows up in RB under "Devices".

Starting RB while camera mounted: trying to access it in Nautilus results in a dialog: "The folder contents could not be displayed. 'USB PTP Camera' could not be found. Perhaps it has recently been deleted.", camera shows up in RB.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Hernando Torque (htorque) wrote :

Sorry, forgot:

Starting RB while camera not mounted (but detected by Nautilus): trying to mount it results in a dialog: "Unable to mount USB PTP Camera Error initializing camera: -60: Could not lock the device"

Revision history for this message
Martin Pitt (pitti) wrote :

Dave,

it seems that the camera wasn't connected whey you ran the symptom? I can't find anything related in the udev dump, and udev and gvfs log are empty. Can you please switch it on and connect it, and then do

 udevadm info --export-db > /tmp/udev.txt

and attach /tmp/udev.txt here?

affects: linux (Ubuntu) → libgphoto2 (Ubuntu)
Changed in libgphoto2 (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Hernando Torque (htorque) wrote :

FWIW, here's my udev.txt.

I also noted following messages in .xsession-errors:

*) Connecting camera while RB running or starting RB while camera connected:

Device 0 (VID=04cb and PID=01e0) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team

*) Disconnecting while RB running:

ERROR: Could not close session!
inep: usb_get_endpoint_status(): No such device
outep: usb_get_endpoint_status(): No such device
usb_clear_halt() on IN endpoint: No such device
usb_clear_halt() on OUT endpoint: No such device
usb_clear_halt() on INTERRUPT endpoint: No such device

(rhythmbox:4350): Rhythmbox-WARNING **: Unable to remount MTP device: Error initializing camera: -105: Unknown model

Strange, because the camera correctly shows up as "FinePix F100fd" in RB ("USB PTP Camera" in Nautilus).

Revision history for this message
Marcus Meissner (meissner) wrote :

All modern cameras for some reason also appear as MTP devices.

I guess libmtp detects this and offers it then in rhythmbox. Not sure how to ignore it there.

The USB id is listed in libgphoto2 at least.

Revision history for this message
Dave Morley (davmor2) wrote :
Changed in libgphoto2 (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

Ah, thanks. So it's not tagged with ID_MEDIA_PLAYER, so Rhythmbox shouldn't see it unless it's also recognized by libmtp. But libmtp's udev rules do not create a /dev/libmtp* device symlink, so it seem rhythmbox gets confused about this.

affects: libgphoto2 (Ubuntu) → rhythmbox (Ubuntu)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Could you try if running the mtp-detect command list the device?

Revision history for this message
Hernando Torque (htorque) wrote :

In my case it does.

Revision history for this message
Martin Pitt (pitti) wrote :

This mtp-detect looks fine AFAIK. It detects image capabilities (PTP and MTP are very similar), and says that libmtp does not know about this device, which it shouldn't.

Revision history for this message
Sebastien Bacher (seb128) wrote :

the issue is also there for non camera devices, see bug #559892, though they might be different bug

Changed in rhythmbox (Ubuntu):
importance: Undecided → Medium
summary: - Fugi FinePix S5800 is showning up as a media player and not a camera
+ the rhythmbox mtp code hijacks cameras
Martin Pitt (pitti)
Changed in rhythmbox (Ubuntu Lucid):
status: Confirmed → Triaged
Martin Pitt (pitti)
Changed in rhythmbox (Ubuntu Lucid):
status: Triaged → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Patch sent to upstream.

Changed in rhythmbox (Ubuntu Lucid):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rhythmbox - 0.12.8-0ubuntu2

---------------
rhythmbox (0.12.8-0ubuntu2) lucid; urgency=low

  * Add 05_ignore_ptp_cameras.patch: MTP plugin: Ignore PTP cameras.
    (LP: #544994)
  * Add 06_mtp_memleak.patch: Fix a memory leak in the MTP plugin.
 -- Martin Pitt <email address hidden> Wed, 14 Apr 2010 17:10:06 +0200

Changed in rhythmbox (Ubuntu Lucid):
status: Fix Committed → Fix Released
Changed in rhythmbox:
status: Unknown → Confirmed
Revision history for this message
floid (jkanowitz) wrote :
Download full text (3.6 KiB)

If it was fixed in 0.12.8-0ubuntu2 it's now regressed in 0.12.8-0ubuntu3 on my fresh Lucid upgrade.

lsof snippet:
gvfs-gpho 6062 floid 13u CHR 189,146 0t0 2544556 /dev/bus/usb/002/019
...
rhythmbox 6244 floid 43u CHR 189,146 0t0 2544556 /dev/bus/usb/002/019

Rhythmbox gets hung up sleeping (Sl state) as soon as the camera is connected / if it is run with the camera connected.

This causes the ever-complained-of "Error mounting location: Error initializing camera: -60: Could not lock the device" from gphoto2 and its consumers. At some point I got a -1 error out of it as well.

Of course it's an unexpected race depending whether gphoto2/F-Spot/similar is run before Rhythmbox or not. But with Rhythmbox closed, the device actually works as a PTP camera in F-Spot, much to my relief, and it even gvfs mounts (so turns out I'm not affected by another bug I thought I was).

Observed with a Kodak Easyshare Z1485 IS:

Bus 002 Device 019: ID 040a:05c8 Kodak Co.
Device Descriptor:
  bLength 18
  bDescriptorType 1
  bcdUSB 2.00
  bDeviceClass 0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 64
  idVendor 0x040a Kodak Co.
  idProduct 0x05c8
  bcdDevice 1.00
  iManufacturer 1 Eastman Kodak Company
  iProduct 2 KODAK EASYSHARE Z1485 IS Digital Camera
  iSerial 3 KCXKF92400305
  bNumConfigurations 1
  Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 39
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0xc0
      Self Powered
    MaxPower 2mA
    Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 0
      bAlternateSetting 0
      bNumEndpoints 3
      bInterfaceClass 6 Imaging
      bInterfaceSubClass 1 Still Image Capture
      bInterfaceProtocol 1 Picture Transfer Protocol (PIMA 15470)
      iInterface 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x01 EP 1 OUT
        bmAttributes 2
          Transfer Type Bulk
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0200 1x 512 bytes
        bInterval 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x82 EP 2 IN
        bmAttributes 2
          Transfer Type Bulk
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0200 1x 512 bytes
        bInterval 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x84 EP 4 IN
        bmAttributes 3
          Transfer Type Interrupt
   ...

Read more...

Revision history for this message
Martin Pool (mbp) wrote :

reopening as I can still reproduce this in 0.12.8-0ubuntu4 as floid says. closing rhythmbox lets the camera mount under nautilus. The device is

Bus 001 Device 047: ID 04a9:319a Canon, Inc.
Device Descriptor:
  bLength 18
  bDescriptorType 1
  bcdUSB 2.00
  bDeviceClass 0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 64
  idVendor 0x04a9 Canon, Inc.
  idProduct 0x319a
  bcdDevice 0.02
  iManufacturer 1 Canon Inc.
  iProduct 2 Canon Digital Camera
  iSerial 0
  bNumConfigurations 1
  Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 39
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0xc0
      Self Powered
    MaxPower 2mA
    Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 0
      bAlternateSetting 0
      bNumEndpoints 3
      bInterfaceClass 6 Imaging
      bInterfaceSubClass 1 Still Image Capture
      bInterfaceProtocol 1 Picture Transfer Protocol (PIMA 15470)
      iInterface 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x81 EP 1 IN
        bmAttributes 2
          Transfer Type Bulk
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0200 1x 512 bytes
        bInterval 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x02 EP 2 OUT
        bmAttributes 2
          Transfer Type Bulk
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0200 1x 512 bytes
        bInterval 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x83 EP 3 IN
        bmAttributes 3
          Transfer Type Interrupt
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0008 1x 8 bytes
        bInterval 10
Device Qualifier (for other device speed):
  bLength 10
  bDescriptorType 6
  bcdUSB 2.00
  bDeviceClass 0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 64
  bNumConfigurations 1
Device Status: 0x0001
  Self Powered

Changed in rhythmbox (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

Martin,

can you please install mtp-tools and give me the output of mtp-detect?

Also, can you please do "rhythmbox -D mtp 2>&1 | tee /tmp/rb.log" with the camera attached, let it settle, close it, and attach /tmp/rb.log here? Thanks!

Changed in rhythmbox (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Martin Pool (mbp) wrote :

mtp-detect output

Changed in rhythmbox (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

fwiw the camera for me doesn't actually show up in rhythmbox, perhaps because of the "didn't match anything" messages. so it would be nice if rb then released its hold on the device.

Revision history for this message
Pedro Villavicencio (pedro) wrote :
Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 544994] Re: the rhythmbox mtp code hijacks cameras

Pedro Villavicencio [2010-05-19 12:21 -0000]:
> There's a fix upstream for this issue as well:
> http://git.gnome.org/browse/rhythmbox/commit/?id=4874bac91d30e6ed46ef88b900eb5f881dfe6c29

Right, but that's just based on my patch, so I don't think it'll
change the situation.

(I'll follow up with Martin later)

Revision history for this message
Spoilerhead (spoilerhead) wrote :

Getting the same bug with a canon 7d, rythmnbox 0.12.8-0ubuntu6 and ubuntu 10.4 (64 bits)

Changed in rhythmbox:
importance: Unknown → Medium
Revision history for this message
Jack Leigh (leighman) wrote :

Any news?
Still fix released?

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Reopen lucid task per comments 16, 17 and 23.
Do you experience the same issue in Maverick ?

Changed in rhythmbox (Ubuntu Lucid):
status: Fix Released → In Progress
tags: added: regression-release
removed: regression-potential
description: updated
Revision history for this message
Benjamin_L (benjamin-lebsanft) wrote :

Still the same with natty, rb 0.13.1 and a canon ixus 300hs

Martin Pitt (pitti)
Changed in rhythmbox (Ubuntu Lucid):
status: In Progress → Confirmed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your feedback. I've added a Maverick task to track the regression there too.

Changed in rhythmbox (Ubuntu Maverick):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Martin Pitt (pitti) wrote :

This is fixed in the current natty version, most probably also in maverick.

Changed in rhythmbox (Ubuntu):
status: Confirmed → Fix Released
Changed in rhythmbox (Ubuntu Lucid):
assignee: Martin Pitt (pitti) → nobody
status: Confirmed → Won't Fix
Martin Pitt (pitti)
Changed in rhythmbox (Ubuntu Maverick):
status: Confirmed → Fix Released
Changed in rhythmbox:
status: Confirmed → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.