Inconsistent storage.bus and storage.originating_device info

View: New views
5 Messages — Rating Filter:   Alert me  

Inconsistent storage.bus and storage.originating_device info

by Baz Walter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hello

i'm writing a small application for portable audio players which needs
to get the vendor_id and some properties from the portable_audio_player
namespace. at the moment, i use dbus to search for all devices with
storage.bus == usb, and then use the storage.originating_device to check
the vendor_id.

unfortunately, sometimes this works and sometimes it doesn't. what i'm
finding is that (apparently ramdomly) the bus will be shown as "pci",
the originating_device as "/org/freedesktop/Hal/devices/computer", and
all the portable_audio_player properties will be missing. other than
showing the wrong information, though, the device works totally
correctly (it's a Samsung YP-P3).

looking in gnome-device-manager i see that the SCSI Host Adapter for the
  relevant Mass Storage Drive appears as a child of the USB Device
rather than the USB Mass Storage Interface. The correct UMS interface is
there - it just isn't linked to the correct SCSI Host Adapter.

so is this a problem with hal, or with hal-info?

is there a reliable way to get the relevant UMS Interface that doesn't
depend on querying storage.originating_device?

some info about my setup:

distro: mandriva 2009.1
hal : 0.5.12-0.rc1.20090403.1mdv2009.1
hal-info : 0.0-5.20090414.1mdv2009.1
udev : 140-3.2mnb2
hotplug : 2.4.4-2mdv2009.1
kernel : 2.6.29.6-2mnb2
policykit : 0.9-5mdv2009.1
consolekit : 0.3.0-5mdv2009.1

TIA
baz walter
_______________________________________________
hal mailing list
hal@...
http://lists.freedesktop.org/mailman/listinfo/hal

Re: Inconsistent storage.bus and storage.originating_device info

by Dan Williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 2009-09-20 at 15:51 +0100, Baz Walter wrote:
> hello
>
> i'm writing a small application for portable audio players which needs
> to get the vendor_id and some properties from the portable_audio_player
> namespace. at the moment, i use dbus to search for all devices with
> storage.bus == usb, and then use the storage.originating_device to check
> the vendor_id.

You want '.subsystem', not .bus.  .bus has been deprecated for quite a
long time.

What HAL version are you using?

Dan

> unfortunately, sometimes this works and sometimes it doesn't. what i'm
> finding is that (apparently ramdomly) the bus will be shown as "pci",
> the originating_device as "/org/freedesktop/Hal/devices/computer", and
> all the portable_audio_player properties will be missing. other than
> showing the wrong information, though, the device works totally
> correctly (it's a Samsung YP-P3).
>
> looking in gnome-device-manager i see that the SCSI Host Adapter for the
>   relevant Mass Storage Drive appears as a child of the USB Device
> rather than the USB Mass Storage Interface. The correct UMS interface is
> there - it just isn't linked to the correct SCSI Host Adapter.
>
> so is this a problem with hal, or with hal-info?
>
> is there a reliable way to get the relevant UMS Interface that doesn't
> depend on querying storage.originating_device?
>
> some info about my setup:
>
> distro: mandriva 2009.1
> hal : 0.5.12-0.rc1.20090403.1mdv2009.1
> hal-info : 0.0-5.20090414.1mdv2009.1
> udev : 140-3.2mnb2
> hotplug : 2.4.4-2mdv2009.1
> kernel : 2.6.29.6-2mnb2
> policykit : 0.9-5mdv2009.1
> consolekit : 0.3.0-5mdv2009.1
>
> TIA
> baz walter
> _______________________________________________
> hal mailing list
> hal@...
> http://lists.freedesktop.org/mailman/listinfo/hal

_______________________________________________
hal mailing list
hal@...
http://lists.freedesktop.org/mailman/listinfo/hal

Re: Inconsistent storage.bus and storage.originating_device info

by Baz Walter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dan Williams wrote:

> On Sun, 2009-09-20 at 15:51 +0100, Baz Walter wrote:
>> hello
>>
>> i'm writing a small application for portable audio players which needs
>> to get the vendor_id and some properties from the portable_audio_player
>> namespace. at the moment, i use dbus to search for all devices with
>> storage.bus == usb, and then use the storage.originating_device to check
>> the vendor_id.
>
> You want '.subsystem', not .bus.  .bus has been deprecated for quite a
> long time.
>
> What HAL version are you using?

hal version is 0.5.12

you mean info.subsystem?

i want to find ums devices that are audio players, which means searching
for storage.bus == usb, doesn't it? if i look at the Mass Storage Drive
entry in gnome-device-manager for my Samsung YP-P3, there is no entry
for info.subsystem.

but in any case, this doesn't deal with the problem i am facing.
hal-info doesn't consistently show the same originating_device every
time i plug the device in.

_______________________________________________
hal mailing list
hal@...
http://lists.freedesktop.org/mailman/listinfo/hal

Re: Inconsistent storage.bus and storage.originating_device info

by Baz Walter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Baz Walter wrote:
> but in any case, this doesn't deal with the problem i am facing.
> hal-info doesn't consistently show the same originating_device every
> time i plug the device in.

just to make things clear, here are two outputs from lshal which show
the inconsistencies:

====== start (1) ========

[root@localhost ~]# lshal -u
/org/freedesktop/Hal/devices/storage_serial_SAMSUNG_YP_P3_7B3655A8E0D400000000000000000000_0_0
udi =
'/org/freedesktop/Hal/devices/storage_serial_SAMSUNG_YP_P3_7B3655A8E0D400000000000000000000_0_0'
   access_control.file = '/dev/sdd'  (string)
   access_control.type = 'removable-block'  (string)
   block.device = '/dev/sdd'  (string)
   block.is_volume = false  (bool)
   block.major = 8  (0x8)  (int)
   block.minor = 48  (0x30)  (int)
   block.storage_device =
'/org/freedesktop/Hal/devices/storage_serial_SAMSUNG_YP_P3_7B3655A8E0D400000000000000000000_0_0'
  (string)
   info.addons = {'hald-addon-storage'} (string list)
   info.callouts.add = {'hal-acl-tool --add-device'} (string list)
   info.callouts.remove = {'hal-acl-tool --remove-device'} (string list)
   info.capabilities = {'storage', 'block', 'portable_audio_player',
'access_control'} (string list)
   info.category = 'portable_audio_player'  (string)
   info.interfaces = {'org.freedesktop.Hal.Device.Storage.Removable'}
(string list)
   info.parent =
'/org/freedesktop/Hal/devices/usb_device_4e8_5119_7B3655A8E0D400000000000000000000_if0_scsi_host_0_scsi_device_lun0'
  (string)
   info.product = 'YP-P3'  (string)
   info.udi =
'/org/freedesktop/Hal/devices/storage_serial_SAMSUNG_YP_P3_7B3655A8E0D400000000000000000000_0_0'
  (string)
   info.vendor = 'SAMSUNG'  (string)
   linux.hotplug_type = 3  (0x3)  (int)
   linux.sysfs_path =
'/sys/devices/pci0000:00/0000:00:02.1/usb1/1-6/1-6:1.0/host19/target19:0:0/19:0:0:0/block/sdd'
  (string)
   portable_audio_player.access_method.protocols = {'storage'} (string list)
   portable_audio_player.audio_folders = {'Music/', 'Video/',
'Datacasts/', 'Recorded Files/FM Radio/', 'Recorded Files/Voice/'}
(string list)
   portable_audio_player.input_formats = {'audio/mpeg'} (string list)
   portable_audio_player.output_formats = {'audio/mpeg',
'application/ogg', 'audio/aac', 'audio/x-flac', 'audio/x-ms-wma'}
(string list)
   portable_audio_player.playlist_format = {'audio/x-spl',
'application/vnd.ms-wpl'} (string list)
   portable_audio_player.playlist_path = 'Playlists/%File'  (string)
   portable_audio_player.storage_device =
'/org/freedesktop/Hal/devices/storage_serial_SAMSUNG_YP_P3_7B3655A8E0D400000000000000000000_0_0'
  (string)
   storage.automount_enabled_hint = true  (bool)
   storage.bus = 'usb'  (string)
   storage.drive_type = 'disk'  (string)
   storage.firmware_version = '1.00'  (string)
   storage.hotpluggable = true  (bool)
   storage.lun = 0  (0x0)  (int)
   storage.media_check_enabled = true  (bool)
   storage.model = 'YP-P3'  (string)
   storage.no_partitions_hint = false  (bool)
   storage.originating_device =
'/org/freedesktop/Hal/devices/usb_device_4e8_5119_7B3655A8E0D400000000000000000000_if0'
  (string)
   storage.partitioning_scheme = 'none'  (string)
   storage.removable = true  (bool)
   storage.removable.media_available = true  (bool)
   storage.removable.media_size = 7764443136  (0x1cecc0000)  (uint64)
   storage.removable.support_async_notification = false  (bool)
   storage.requires_eject = false  (bool)
   storage.serial = 'SAMSUNG_YP-P3_7B3655A8E0D400000000000000000000-0:0'
  (string)
   storage.size = 0  (0x0)  (uint64)
   storage.vendor = 'SAMSUNG'  (string)

====== end (1) =========

====== start (2) ========

[root@localhost ~]# lshal -u
/org/freedesktop/Hal/devices/storage_serial_SAMSUNG_YP_P3_7B3655A8E0D400000000000000000000_0_0
udi =
'/org/freedesktop/Hal/devices/storage_serial_SAMSUNG_YP_P3_7B3655A8E0D400000000000000000000_0_0'
   access_control.file = '/dev/sdd'  (string)
   access_control.type = 'removable-block'  (string)
   block.device = '/dev/sdd'  (string)
   block.is_volume = false  (bool)
   block.major = 8  (0x8)  (int)
   block.minor = 48  (0x30)  (int)
   block.storage_device =
'/org/freedesktop/Hal/devices/storage_serial_SAMSUNG_YP_P3_7B3655A8E0D400000000000000000000_0_0'
  (string)
   info.addons = {'hald-addon-storage'} (string list)
   info.callouts.add = {'hal-acl-tool --add-device'} (string list)
   info.callouts.remove = {'hal-acl-tool --remove-device'} (string list)
   info.capabilities = {'storage', 'block', 'access_control'} (string list)
   info.category = 'storage'  (string)
   info.interfaces = {'org.freedesktop.Hal.Device.Storage.Removable'}
(string list)
   info.parent =
'/org/freedesktop/Hal/devices/usb_device_4e8_5119_7B3655A8E0D400000000000000000000_scsi_host_scsi_device_lun0'
  (string)
   info.product = 'YP-P3'  (string)
   info.udi =
'/org/freedesktop/Hal/devices/storage_serial_SAMSUNG_YP_P3_7B3655A8E0D400000000000000000000_0_0'
  (string)
   info.vendor = 'SAMSUNG'  (string)
   linux.hotplug_type = 3  (0x3)  (int)
   linux.sysfs_path =
'/sys/devices/pci0000:00/0000:00:02.1/usb1/1-6/1-6:1.0/host18/target18:0:0/18:0:0:0/block/sdd'
  (string)
   storage.automount_enabled_hint = true  (bool)
   storage.bus = 'pci'  (string)
   storage.drive_type = 'disk'  (string)
   storage.firmware_version = '1.00'  (string)
   storage.hotpluggable = false  (bool)
   storage.lun = 0  (0x0)  (int)
   storage.media_check_enabled = true  (bool)
   storage.model = 'YP-P3'  (string)
   storage.no_partitions_hint = false  (bool)
   storage.originating_device = '/org/freedesktop/Hal/devices/computer'
  (string)
   storage.partitioning_scheme = 'none'  (string)
   storage.removable = true  (bool)
   storage.removable.media_available = true  (bool)
   storage.removable.media_size = 7764443136  (0x1cecc0000)  (uint64)
   storage.removable.support_async_notification = false  (bool)
   storage.requires_eject = false  (bool)
   storage.serial = 'SAMSUNG_YP-P3_7B3655A8E0D400000000000000000000-0:0'
  (string)
   storage.size = 0  (0x0)  (uint64)
   storage.vendor = 'SAMSUNG'  (string)

====== end (2) ======

_______________________________________________
hal mailing list
hal@...
http://lists.freedesktop.org/mailman/listinfo/hal

Re: Inconsistent storage.bus and storage.originating_device info

by Dan Williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 2009-09-20 at 08:05 -0700, Dan Williams wrote:

> On Sun, 2009-09-20 at 15:51 +0100, Baz Walter wrote:
> > hello
> >
> > i'm writing a small application for portable audio players which needs
> > to get the vendor_id and some properties from the portable_audio_player
> > namespace. at the moment, i use dbus to search for all devices with
> > storage.bus == usb, and then use the storage.originating_device to check
> > the vendor_id.
>
> You want '.subsystem', not .bus.  .bus has been deprecated for quite a
> long time.

Sorry, I lied... I was thinking "info.subsystem" which should be used
instead of "info.bus"...  storage appears to still use ".bus".

Dan

> What HAL version are you using?
>
> Dan
>
> > unfortunately, sometimes this works and sometimes it doesn't. what i'm
> > finding is that (apparently ramdomly) the bus will be shown as "pci",
> > the originating_device as "/org/freedesktop/Hal/devices/computer", and
> > all the portable_audio_player properties will be missing. other than
> > showing the wrong information, though, the device works totally
> > correctly (it's a Samsung YP-P3).
> >
> > looking in gnome-device-manager i see that the SCSI Host Adapter for the
> >   relevant Mass Storage Drive appears as a child of the USB Device
> > rather than the USB Mass Storage Interface. The correct UMS interface is
> > there - it just isn't linked to the correct SCSI Host Adapter.
> >
> > so is this a problem with hal, or with hal-info?
> >
> > is there a reliable way to get the relevant UMS Interface that doesn't
> > depend on querying storage.originating_device?
> >
> > some info about my setup:
> >
> > distro: mandriva 2009.1
> > hal : 0.5.12-0.rc1.20090403.1mdv2009.1
> > hal-info : 0.0-5.20090414.1mdv2009.1
> > udev : 140-3.2mnb2
> > hotplug : 2.4.4-2mdv2009.1
> > kernel : 2.6.29.6-2mnb2
> > policykit : 0.9-5mdv2009.1
> > consolekit : 0.3.0-5mdv2009.1
> >
> > TIA
> > baz walter
> > _______________________________________________
> > hal mailing list
> > hal@...
> > http://lists.freedesktop.org/mailman/listinfo/hal
>
> _______________________________________________
> hal mailing list
> hal@...
> http://lists.freedesktop.org/mailman/listinfo/hal

_______________________________________________
hal mailing list
hal@...
http://lists.freedesktop.org/mailman/listinfo/hal