amarok doesn't see all the audio files on my Sansa E260 (includes a patch)

Aran Cox arancox at gmail.com
Mon Oct 12 16:53:50 UTC 2009


On Sun, Oct 11, 2009 at 10:34 PM, Jeff Mitchell <mitchell at kde.org> wrote:
> Aran Cox wrote:
>>> application/octet-stream is a default mime type for when it can't be
>>> determined. This could signal a problem with the flac files...not sure.
>>> It would be good if there was a way to check a file against the
>>> shared-mime-info directory directly -- I don't know if there is, but if
>>> you can find one, see what is returned. Also compare that to the output
>>> of "file" run on those files. It could be a bug in the s-m-i database.
>>
>> There is a gst-typefind program that will print mime types.  It thinks
>> my mp3 files are application/x-id3
>
> That's crazy. And it's certainly not from shared-mime-info -- at least,
> not from the default file included with it.
>
>> and my flac files are audio/x-flac!
>
> audio/x-flac should be getting detected now with my updated code...are
> you really still having problems with them?
>
> If you can find one file of each type that you can send to me or make
> available to me, I could examine them more closely.
>

I used strace to see what files gst-typefind is opening and it doesn't
look like it opens any of the files in /usr/share/mime/ . x-id3
doesn't seem to be defined in any of those files anyway, so it's
possible gst-typefind is using it's own database of mimetypes and
isn't a good test at all.

audio/x-flac is defined in the freedesktop.org.xml file, but only as a
wildcard.  I looked at a flac in a hex-editor and it starts with a
magic string, just like an ogg so I wonder why it isn't defined like
x-ogg is.  I added this to the freedesktop.org.xml definition for
audio/x-flac:

   <magic priority="50">
      <match value="fLaC" type="string" offset="0"/>
    </magic>

and then used update-mime-database /usr/share/mime.

Now, amarok recoginizes my flac files on my Sansa!

There are still the two mp3s that show up as application/octet-stream
and I'll look at those files later.  There must be something odd about
the files or the mime definition for mp3, I would guess.

I'd like to make a little wrapper program around the KMimeType calls
at some point, too, but we'll see.



More information about the Amarok mailing list