Re: Get state when using mpc idel event

2019-08-15 Thread Jonas Smedegaard
Quoting john doe (2019-08-15 12:40:39)
> According to the mpd protocol (1),  that is, if my understanding is
> correct, I should be able, using an idle event, to get the state
> ('state: play, stop, or pause').
> If I connect to mpd using telnet and enter status I get among other
> lines the desired line.
> 
> I'm using mpd to locally stream an internet stream with as output 'httpd'.
> The internet stream will sometime stop and I manually need to do 'mpc
> play' to restart the internet stream which is not practicle.
> To work around this, I now use a cronjob that executes 'mpc play' every
> minute:
> 
> * * * * * user mpc play
> 
> 
> I'd like to understand how idle events work and how I can get the
> desired output.
> 
> In addition of understanding how idle events work, is there a better
> approach to this?
> 
> Any input is welcome.

My guess is that MPD sees an internet stream as an endlesly continuing 
stream(!) of media, and you therefore cannot rely on MPD change of state 
for those: If the stream is hangling then that's not an "end of tune" so 
not part of MPD defined interface.


 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private


signature.asc
Description: signature


Get state when using mpc idel event

2019-08-15 Thread john doe
Hi,

According to the mpd protocol (1),  that is, if my understanding is
correct, I should be able, using an idle event, to get the state
('state: play, stop, or pause').
If I connect to mpd using telnet and enter status I get among other
lines the desired line.

I'm using mpd to locally stream an internet stream with as output 'httpd'.
The internet stream will sometime stop and I manually need to do 'mpc
play' to restart the internet stream which is not practicle.
To work around this, I now use a cronjob that executes 'mpc play' every
minute:

* * * * * user mpc play


I'd like to understand how idle events work and how I can get the
desired output.

In addition of understanding how idle events work, is there a better
approach to this?

Any input is welcome.


1)  https://www.musicpd.org/doc/html/protocol.html

--
John Doe