1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries from June
2016</title>
5 <description>Entries from June
2016</description>
6 <link>http://www.hungry.com/~pere/blog/
</link>
10 <title>The new
"best
" multimedia player in Debian?
</title>
11 <link>http://www.hungry.com/~pere/blog/The_new__best__multimedia_player_in_Debian_.html
</link>
12 <guid isPermaLink=
"true">http://www.hungry.com/~pere/blog/The_new__best__multimedia_player_in_Debian_.html
</guid>
13 <pubDate>Mon,
6 Jun
2016 12:
50:
00 +
0200</pubDate>
14 <description><p
>When I set out a few weeks ago to figure out
15 <a href=
"https://people.skolelinux.org/pere/blog/What_is_the_best_multimedia_player_in_Debian_.html
">which
16 multimedia player in Debian claimed to support most file formats /
17 MIME types
</a
>, I was a bit surprised how varied the sets of MIME types
18 the various players claimed support for. The range was from
55 to
130
19 MIME types. I suspect most media formats are supported by all
20 players, but this is not really reflected in the MimeTypes values in
21 their desktop files. There are probably also some bogus MIME types
22 listed, but it is hard to identify which one this is.
</p
>
24 <p
>Anyway, in the mean time I got in touch with upstream for some of
25 the players suggesting to add more MIME types to their desktop files,
26 and decided to spend some time myself improving the situation for my
27 favorite media player VLC. The fixes for VLC entered Debian unstable
28 yesterday. The complete list of MIME types can be seen on the
29 <a href=
"https://wiki.debian.org/DebianMultimedia/PlayerSupport
">Multimedia
30 player MIME type support status
</a
> Debian wiki page.
</p
>
32 <p
>The new
"best
" multimedia player in Debian? It is VLC, followed by
33 totem, parole, kplayer, gnome-mpv, mpv, smplayer, mplayer-gui and
34 kmplayer. I am sure some of the other players desktop files support
35 several of the formats currently listed as working only with vlc,
36 toten and parole.
</p
>
38 <p
>A sad observation is that only
14 MIME types are listed as
39 supported by all the tested multimedia players in Debian in their
40 desktop files: audio/mpeg, audio/vnd.rn-realaudio, audio/x-mpegurl,
41 audio/x-ms-wma, audio/x-scpls, audio/x-wav, video/mp4, video/mpeg,
42 video/quicktime, video/vnd.rn-realvideo, video/x-matroska,
43 video/x-ms-asf, video/x-ms-wmv and video/x-msvideo. Personally I find
44 it sad that video/ogg and video/webm is not supported by all the media
45 players in Debian. As far as I can tell, all of them can handle both
51 <title>A program should be able to open its own files on Linux
</title>
52 <link>http://www.hungry.com/~pere/blog/A_program_should_be_able_to_open_its_own_files_on_Linux.html
</link>
53 <guid isPermaLink=
"true">http://www.hungry.com/~pere/blog/A_program_should_be_able_to_open_its_own_files_on_Linux.html
</guid>
54 <pubDate>Sun,
5 Jun
2016 08:
30:
00 +
0200</pubDate>
55 <description><p
>Many years ago, when koffice was fresh and with few users, I
56 decided to test its presentation tool when making the slides for a
57 talk I was giving for NUUG on Japhar, a free Java virtual machine. I
58 wrote the first draft of the slides, saved the result and went to bed
59 the day before I would give the talk. The next day I took a plane to
60 the location where the meeting should take place, and on the plane I
61 started up koffice again to polish the talk a bit, only to discover
62 that kpresenter refused to load its own data file. I cursed a bit and
63 started making the slides again from memory, to have something to
64 present when I arrived. I tested that the saved files could be
65 loaded, and the day seemed to be rescued. I continued to polish the
66 slides until I suddenly discovered that the saved file could no longer
67 be loaded into kpresenter. In the end I had to rewrite the slides
68 three times, condensing the content until the talk became shorter and
69 shorter. After the talk I was able to pinpoint the problem
&ndash;
70 kpresenter wrote inline images in a way itself could not understand.
71 Eventually that bug was fixed and kpresenter ended up being a great
72 program to make slides. The point I
'm trying to make is that we
73 expect a program to be able to load its own data files, and it is
74 embarrassing to its developers if it can
't.
</p
>
76 <p
>Did you ever experience a program failing to load its own data
77 files from the desktop file browser? It is not a uncommon problem. A
78 while back I discovered that the screencast recorder
79 gtk-recordmydesktop would save an Ogg Theora video file the KDE file
80 browser would refuse to open. No video player claimed to understand
81 such file. I tracked down the cause being
<tt
>file --mime-type
</tt
>
82 returning the application/ogg MIME type, which no video player I had
83 installed listed as a MIME type they would understand. I asked for
84 <a href=
"http://bugs.gw.com/view.php?id=
382">file to change its
85 behavour
</a
> and use the MIME type video/ogg instead. I also asked
86 several video players to add video/ogg to their desktop files, to give
87 the file browser an idea what to do about Ogg Theora files. After a
88 while, the desktop file browsers in Debian started to handle the
89 output from gtk-recordmydesktop properly.
</p
>
91 <p
>But history repeats itself. A few days ago I tested the music
92 system Rosegarden again, and I discovered that the KDE and xfce file
93 browsers did not know what to do with the Rosegarden project files
94 (*.rg). I
've reported
<a href=
"http://bugs.debian.org/
825993">the
95 rosegarden problem to BTS
</a
> and a fix is commited to git and will be
96 included in the next upload. To increase the chance of me remembering
97 how to fix the problem next time some program fail to load its files
98 from the file browser, here are some notes on how to fix it.
</p
>
100 <p
>The file browsers in Debian in general operates on MIME types.
101 There are two sources for the MIME type of a given file. The output from
102 <tt
>file --mime-type
</tt
> mentioned above, and the content of the
103 shared MIME type registry (under /usr/share/mime/). The file MIME
104 type is mapped to programs supporting the MIME type, and this
105 information is collected from
106 <a href=
"https://www.freedesktop.org/wiki/Specifications/desktop-entry-spec/
">the
107 desktop files
</a
> available in /usr/share/applications/. If there is
108 one desktop file claiming support for the MIME type of the file, it is
109 activated when asking to open a given file. If there are more, one
110 can normally select which one to use by right-clicking on the file and
111 selecting the wanted one using
'Open with
' or similar. In general
112 this work well. But it depend on each program picking a good MIME
114 <a href=
"http://www.iana.org/assignments/media-types/media-types.xhtml
">a
115 MIME type registered with IANA
</a
>), file and/or the shared MIME
116 registry recognizing the file and the desktop file to list the MIME
117 type in its list of supported MIME types.
</p
>
119 <p
>The
<tt
>/usr/share/mime/packages/rosegarden.xml
</tt
> entry for
120 <a href=
"http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec
">the
121 Shared MIME database
</a
> look like this:
</p
>
123 <p
><blockquote
><pre
>
124 &lt;?xml version=
"1.0" encoding=
"UTF-
8"?
&gt;
125 &lt;mime-info xmlns=
"http://www.freedesktop.org/standards/shared-mime-info
"&gt;
126 &lt;mime-type type=
"audio/x-rosegarden
"&gt;
127 &lt;sub-class-of type=
"application/x-gzip
"/
&gt;
128 &lt;comment
&gt;Rosegarden project file
&lt;/comment
&gt;
129 &lt;glob pattern=
"*.rg
"/
&gt;
130 &lt;/mime-type
&gt;
131 &lt;/mime-info
&gt;
132 </pre
></blockquote
></p
>
134 <p
>This states that audio/x-rosegarden is a kind of application/x-gzip
135 (it is a gzipped XML file). Note, it is much better to use an
136 official MIME type registered with IANA than it is to make up ones own
137 unofficial ones like the x-rosegarden type used by rosegarden.
</p
>
139 <p
>The desktop file of the rosegarden program failed to list
140 audio/x-rosegarden in its list of supported MIME types, causing the
141 file browsers to have no idea what to do with *.rg files:
</p
>
143 <p
><blockquote
><pre
>
144 % grep Mime /usr/share/applications/rosegarden.desktop
145 MimeType=audio/x-rosegarden-composition;audio/x-rosegarden-device;audio/x-rosegarden-project;audio/x-rosegarden-template;audio/midi;
146 X-KDE-NativeMimeType=audio/x-rosegarden-composition
148 </pre
></blockquote
></p
>
150 <p
>The fix was to add
"audio/x-rosegarden;
" at the end of the
151 MimeType= line.
</p
>
153 <p
>If you run into a file which fail to open the correct program when
154 selected from the file browser, please check out the output from
155 <tt
>file --mime-type
</tt
> for the file, ensure the file ending and
156 MIME type is registered somewhere under /usr/share/mime/ and check
157 that some desktop file under /usr/share/applications/ is claiming
158 support for this MIME type. If not, please report a bug to have it