Comment 0 for bug 215761

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Binary package hint: hal

This probably has a bunch of existing duplicates, but since we've already debugged this on IRC, I figured I'd just open a new bug with the pertinent information for you and weed the duplicates out in a little bit.

In order for Rhythmbox to use a portable audio player, it needs "portable_audio_player" in info.capabilities for the device, as well as various portable_audio_player.* properties.

information/10freedesktop/10-usb-music-players.fdi matches all of the various USB media players and adds the necessary portable_audio_player.* properties to them.

At the bottom, it attempts to match portable_audio_player.type being set, and if so, always adds the portable_audio_player capability.

HOWEVER as noted in a couple of places in that file, portable_audio_player.type is deprecated and many entries no longer set it.

This means that the only players which will work are iPod (sets type), Motorola phones (sets type), Archos GMini (sets type), iFP (sets type), LG Fusic Phone (explicitly adds capability) and PSP (explicitly adds capability).

The stuff at the bottom to add the capability looks logically wrong to me:

    <!-- Set common keys for detected audio player if you have special cases add
 the player below this match -->
    <match key="portable_audio_player.type" exists="true">
      <match key="portable_audio_player.access_method.protocols" contains="storage">
        <!-- NOTE: for backward compatibility until key get removed finally -->
        <merge key="portable_audio_player.access_method" type="string">storage</merge>
        <!-- NOTE: for backward compatibility until key get removed finally -->
        <merge key="portable_audio_player.type" type="string">generic</merge>
        <merge key="portable_audio_player.storage_device" type="copy_property">info.udi</merge>
      </match>
      <append key="info.capabilities" type="strlist">portable_audio_player</append>
      <merge key="info.category" type="string">portable_audio_player</merge>
      <!-- all player in the list above support this output format -->
      <append key="portable_audio_player.output_formats" type="strlist">audio/mpeg</append>
    </match>

It matches those with an existing type, then matches those with storage in their protocols list (which everything does have, I've checked) and then sets type to "generic"; which is somewhat strange since that means it overrides whatever was already set.

I think that inner match is supposed to be a previous match in the opposite direction.

    <match key="portable_audio_player.type" exists="false">
      <match key="portable_audio_player.access_method.protocols" contains="storage">
        <!-- NOTE: for backward compatibility until key get removed finally -->
        <merge key="portable_audio_player.access_method" type="string">storage</merge>
        <!-- NOTE: for backward compatibility until key get removed finally -->
        <merge key="portable_audio_player.type" type="string">generic</merge>
        <merge key="portable_audio_player.storage_device" type="copy_property">info.udi</merge>
      </match>

So if we _DON'T_ have type set, but have set access_method.protocols, add the old compatibility keys.

THEN:

    <match key="portable_audio_player.type" exists="true">
      <append key="info.capabilities" type="strlist">portable_audio_player</append>
      <merge key="info.category" type="string">portable_audio_player</merge>
      <!-- all player in the list above support this output format -->
      <append key="portable_audio_player.output_formats" type="strlist">audio/mpeg</append>
    </match>

For everything (since type is now set) add the capability and category.

That fix works for me, does it look reasonable to you?