Discussion:
[emms-help] emms-stream-info-bookmark doesn't get any results
Julien Cubizolles
2016-10-12 13:15:32 UTC
Permalink
Can anyone get some info using "i" (emms-stream-info-bookmark) from the
*Emms Streams* buffer ?

With SomaFM: Indie Pop Rocks (from emms-stream-default-list) I always
get :
--8<---------------cut here---------------start------------->8---
querying stream...done
now playing: N/A on N/A, genre: N/A, bitrate: N/A
--8<---------------cut here---------------end--------------->8---

I'm running emms-20160801.1349 from melpa.

Julien.
Yoni Rabkin
2016-10-13 00:05:26 UTC
Permalink
Post by Julien Cubizolles
Can anyone get some info using "i" (emms-stream-info-bookmark) from the
*Emms Streams* buffer ?
With SomaFM: Indie Pop Rocks (from emms-stream-default-list) I always
querying stream...done
now playing: N/A on N/A, genre: N/A, bitrate: N/A
I just tried it and got:

querying stream...done
now playing: Indie LoFi College on SomaFM presents: Indie Pop Rocks! [SomaFM], genre: Indie LoFi College, bitrate: Indie LoFi College
Post by Julien Cubizolles
I'm running emms-20160801.1349 from melpa.
I'm not involved with melpa. I tried it with the latest Savannah git.
--
"Cut your own wood and it will warm you twice"
Julien Cubizolles
2016-10-13 04:27:59 UTC
Permalink
Post by Julien Cubizolles
Post by Julien Cubizolles
querying stream...done
now playing: N/A on N/A, genre: N/A, bitrate: N/A
querying stream...done
now playing: Indie LoFi College on SomaFM presents: Indie Pop Rocks!
[SomaFM], genre: Indie LoFi College, bitrate: Indie LoFi College
Post by Julien Cubizolles
I'm running emms-20160801.1349 from melpa.
I'm not involved with melpa. I tried it with the latest Savannah git.
I tried emms from Savannah git and still got the N/A results. Maybe I'm
Post by Julien Cubizolles
emms-info functions: (emms-info-mpd emms-info-libtag).
Which one do you have ?

Julien.
Yoni Rabkin
2016-10-13 14:35:27 UTC
Permalink
Post by Julien Cubizolles
Post by Julien Cubizolles
Post by Julien Cubizolles
querying stream...done
now playing: N/A on N/A, genre: N/A, bitrate: N/A
querying stream...done
now playing: Indie LoFi College on SomaFM presents: Indie Pop Rocks!
[SomaFM], genre: Indie LoFi College, bitrate: Indie LoFi College
Post by Julien Cubizolles
I'm running emms-20160801.1349 from melpa.
I'm not involved with melpa. I tried it with the latest Savannah git.
I tried emms from Savannah git and still got the N/A results. Maybe I'm
Post by Julien Cubizolles
emms-info functions: (emms-info-mpd emms-info-libtag).
Which one do you have ?
Getting info from a stream is a different thing than getting it from a
file, so the info functions don't apply. The streaming info backend is
determined by the variable `*emms-stream-info-backend*', which is set to
mplayer in my case.

I also note that while setting `*emms-stream-info-backend*' is mentioned
in emms-stream-info.el, it isn't mentioned in the manual. I'll add it to
the manual so people can do that in future.

(unless you feel like sending in a patch against the manual adding
that...)
--
"Cut your own wood and it will warm you twice"
Julien Cubizolles
2016-10-14 11:58:51 UTC
Permalink
Post by Yoni Rabkin
Getting info from a stream is a different thing than getting it from a
file, so the info functions don't apply. The streaming info backend is
determined by the variable `*emms-stream-info-backend*', which is set to
mplayer in my case.
I also have *emms-stream-info-backend* set to mplayer. But I finally
noticed the difference: I was using one of the .pls playlist link given
in emms-stream-default-list. And playlist parsing is disabled in mplayer
by default. You have to allow it with for instance:

--8<---------------cut here---------------start------------->8---
mplayer -ao null -vo null -endpos 0 -nocache -playlist http://somafm.com/bagel64.pls
--8<---------------cut here---------------end--------------->8---

Also, in this case of a stream being played, mplayer returns the name of
the stream and not the name of song currently playing, because there
isn't any "ICY Info: StreamTitle" in the output with these options. You
can however get this field if you enable a minimum cache (150Ko is not
enough) with for instance:

--8<---------------cut here---------------start------------->8---
mplayer -ao null -vo null -endpos 0 -cache 180 -playlist http://somafm.com/bagel64.pls
--8<---------------cut here---------------end--------------->8---

It's fine when you run mplayer in a terminal but the temp buffer used
by emms-stream-info-mplayer-backend gets filled by several Mo of
"Cache fill: 0.00% (0 bytes)" messages. You can get rid of these
messages, and some other, with the following cmdline options:

--8<---------------cut here---------------start------------->8---
-msglevel decaudio=-1:cache=-1:statusline=-1:cplayer=-1
--8<---------------cut here---------------end--------------->8---

The clean thing would be to remove all messages (with all=-1) and then
only enable the right modules but I couldn't find the module responsible
for the ICY info message.

We can add these options to emms-stream-info-mplayer-backend but maybe
the -playlist one should only be used when the url is indeed a playlist.
Post by Yoni Rabkin
I also note that while setting `*emms-stream-info-backend*' is mentioned
in emms-stream-info.el, it isn't mentioned in the manual. I'll add it to
the manual so people can do that in future.
(unless you feel like sending in a patch against the manual adding
that...)
Would the attached patch do ?

Julien.
Julien Cubizolles
2016-10-14 22:18:06 UTC
Permalink
The attached patch take care of:
* adding some mplayer options to get the now playing song name
* adding the -playlist option in case the webradio has the streamlist type

I'm not a programmer, so there is certainly room for improvement but
it's basically doing its job.

Two minor things to note though:

* mplayer advises against using the -playlist option for security
reasons, I guess it shouldn't be used by default and emms should use
an option allowing the user to decide whether to use it or not.

* The mplayer output for some webradios has two different ICY fields
(see
--8<---------------cut here---------------start------------->8---
mplayer -ao null -vo null -cache 200 -endpos 0 http://ouifm5.ice.infomaniak.ch/ouifm2.aac
--8<---------------cut here---------------end--------------->8---
for instance)
the first one being empty. emms-stream-info-call-backend unfortunately
picks up the first (empty one). Some modifications should be made so
that it picks the non empty one.

Regards,

Julien.
Yoni Rabkin
2016-10-21 19:32:14 UTC
Permalink
I'll probably be re-writing those substantially, so I don't think we
need to worry about these patches in particular.
--
"Cut your own wood and it will warm you twice"
Yoni Rabkin
2016-11-08 14:06:39 UTC
Permalink
After digging into this I think fixing emms-stream-info won't make it
into 4.2 since it will need to be re-written (again! it needs to be
re-written apparently every five years or so). I'm thinking of ditching
`vlc' and `mplayer' for grabbing the ICY embedded in the stream.

I'll trying to use `streamripper' instead, which should be available on
every GNU/Linux distro out there. I have an experimental branch with
that. After 4.2 I'll put it out there and people can play around with it
and see if it works for them.
--
"Cut your own wood and it will warm you twice"
Julien Cubizolles
2016-10-30 11:21:39 UTC
Permalink
(condition-case excep
(call-process "mplayer" nil t nil
"-cache" "256"
"-endpos" "0" "-vo" "null" "-ao" "null"
"-msglevel" "all=-1:network=4:demuxer=4"
+ urlcall
(if (eq type 'streamlist) "-playlist" "")
^^^^^^^^^
or even just put this line here directly instead of making 'urlcall'
variable.
You're right it's much simpler this way. Here is the corresponding
patch.

Julien.
Yoni Rabkin
2016-10-21 19:30:37 UTC
Permalink
Post by Yoni Rabkin
Post by Julien Cubizolles
Post by Julien Cubizolles
Post by Julien Cubizolles
querying stream...done
now playing: N/A on N/A, genre: N/A, bitrate: N/A
querying stream...done
now playing: Indie LoFi College on SomaFM presents: Indie Pop Rocks!
[SomaFM], genre: Indie LoFi College, bitrate: Indie LoFi College
Post by Julien Cubizolles
I'm running emms-20160801.1349 from melpa.
I'm not involved with melpa. I tried it with the latest Savannah git.
I tried emms from Savannah git and still got the N/A results. Maybe I'm
Post by Julien Cubizolles
emms-info functions: (emms-info-mpd emms-info-libtag).
Which one do you have ?
Getting info from a stream is a different thing than getting it from a
file, so the info functions don't apply. The streaming info backend is
determined by the variable `*emms-stream-info-backend*', which is set to
mplayer in my case.
I also note that while setting `*emms-stream-info-backend*' is mentioned
in emms-stream-info.el, it isn't mentioned in the manual. I'll add it to
the manual so people can do that in future.
Could you please remove '*' from this variable name? Using * for global
variables is not an emacs convention. Besides it's the only emms
variable that does it, I think it would be better to name it just
'emms-stream-info-backend' for consistency.
Those are all good ideas. I'll include these in the upcoming release.
--
"Cut your own wood and it will warm you twice"
Loading...