! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
usb flash drive recognized as audio player
Status:
RESOLVED: FIXED
Product:
Thunar-volman
Component:
General

Comments

Description Ben Ford 2007-02-01 21:59:55 CET
When I plugged in my USB flash drive, gtkpod was started.  I have the audio player recognition turned on.
Comment 1 Ben Ford 2007-02-01 22:00:27 CET
Created attachment 978 
hal-device output
Comment 2 Benedikt Meurer editbugs 2007-02-04 11:48:44 CET
Are you talking about the thunar-volman? Because Thunar doesn't start gtkpod.
Comment 3 Ben Ford 2007-02-04 19:37:07 CET
Yes, sorry.  thunar-volman isn't available in the dropdown.
Comment 4 Benedikt Meurer editbugs 2007-02-12 19:37:38 CET
It's part of the 'Thunar Plugins' product... Back to the issue: thunar-volman detects audio player asking HAL whether the storage device has the portable_audio_player capability. So HAL seems to detect your flash drive incorrectly.
Comment 5 Ben Ford 2007-02-12 21:16:14 CET
I just noticed that it starts gtkpod any time any removable media is inserted, whether it's my iPod, USB stick or just a cdrom.
Comment 6 Benedikt Meurer editbugs 2007-02-12 23:01:31 CET
Are you sure that it's thunar-volman launching gtkpod?
Comment 7 Ben Ford 2007-02-12 23:41:45 CET
Yes.  When I uncheck the start audio player box in the thunar-volman prefs the problem goes away.
Comment 8 Tino Keitel 2007-07-31 06:00:34 CEST
Hi,

I had the same problem. It set gtkpod as the command for "portable music players", and now gtkpod starts when I:

- plug in my iPod (good)

- plug in my external firewire hard disk (bad)

- plug in my USB card reader with the CF from the camera (bad)

- insert a DVD (bad)

Maybe even more.

I looked into the source code of tvm-block-device.c. The command seems to be "autoipod_command". There is a tvm_block_device_autoipod() function that checks new block devices for the "portable_audio_player" HAL capability:

if (libhal_device_query_capability (context, storage_udi, "portable_audio_player", NULL))

However, at the end of the function, the result of this capability check is ignored and the "response" variable is set to "TVM_RESPONSE_MUSIC" regardless of this capability check, so that every block device is handled as a music player.
Comment 9 Tino Keitel 2007-07-31 06:10:37 CEST
Created attachment 1296 
limit the autoipod_command to music players

This patch only sets response to TVM_RESPONSE_MUSIC when the HAL capability check for "portable_audio_player" was successful. Now gtkpod only starts when I plug in the iPod. It doesn't start anymore when I insert a DVD, plug in the card reader or plug in the firewire hard disk.
Comment 10 Tino Keitel 2007-07-31 06:20:57 CEST
P.S.: The patch is for thunar-volman 0.1.2.
Comment 11 Tino Keitel 2007-08-03 21:13:47 CEST
Created attachment 1297 
fix check for VIDEO_TS on inserted DVDs

Now I tried the same with a DVD command. It was never executed.

The reason was a check for the video path. If I change it from video_ts to VIDEO_TS, then it works.

I think the "video_ts" check works in the case that the DVD is automounted as ISO9660 instead of UDF. However, for me, it is mounted as UDF:

/dev/scd0 on /media/CDROM type udf (ro,nosuid,nodev,uid=1001)

This patch also checks for "VIDEO_TS". Now my DVDs are detected as they should.
Comment 12 Tino Keitel 2007-08-20 15:31:37 CEST
Comment on attachment 1297 
fix check for VIDEO_TS on inserted DVDs

This patch doesn't really belong here, I also attached it to Bug #3038, which is more appropriate.
Comment 13 Colin Leroy 2008-03-04 12:19:43 CET
Created attachment 1542 
updated patch 

I can confirm this bug and the patch works. I'd add initialisation of response, though, as in the attached patch.

Would it be possible to get that in SVN? :)
Comment 14 Benedikt Meurer editbugs 2008-03-15 09:33:59 CET
Committed revision with 4057.

2008-03-15      Benedikt Meurer <benny@xfce.org>

        * thunar-volman/tvm-block-device.c: Apply patch from Tino Keitel
          and Colin Leroy to fix USB flash drives being incorrectly
          recognized as audio players. Bug #2856.

Bug #2856

Reported by:
Ben Ford
Reported on: 2007-02-01
Last modified on: 2009-11-09

People

Assignee:
Jannis Pohlmann
CC List:
3 users

Version

Version:
unspecified

Attachments

hal-device output (10.00 KB, text/plain)
2007-02-01 22:00 CET , Ben Ford
no flags
limit the autoipod_command to music players (1.10 KB, patch)
2007-07-31 06:10 CEST , Tino Keitel
no flags
fix check for VIDEO_TS on inserted DVDs (1.12 KB, patch)
2007-08-03 21:13 CEST , Tino Keitel
no flags
updated patch (1.47 KB, patch)
2008-03-04 12:19 CET , Colin Leroy
no flags

Additional information