LCD in RuneAudio! Can't get the info from mpd in the screen!

Raspberry Pi related support

Re: LCD in RuneAudio! Can't get the info from mpd in the scr

Postby den_hr » 17 Feb 2015, 19:42

Hmm, perhaps I was a bit hasty above... :oops:

How do I pass the json_encode($status) to my Python script (to sort out the segments I need, like "currentsong", "currentalbum", etc.?
I don't have much experience with JSON...
den_hr
 
Posts: 52
Joined: 06 Feb 2015, 17:10
Location: Croatia

Re: LCD in RuneAudio! Can't get the info from mpd in the scr

Postby den_hr » 17 Feb 2015, 22:11

Last edited by den_hr on 20 Nov 2015, 07:20, edited 1 time in total.
den_hr
 
Posts: 52
Joined: 06 Feb 2015, 17:10
Location: Croatia

Re: LCD in RuneAudio! Can't get the info from mpd in the scr

Postby drew » 18 Feb 2015, 09:20

or you could just use to extract out the data from the JSON :)
drew
 
Posts: 1
Joined: 18 Feb 2015, 09:18

Re: LCD in RuneAudio! Can't get the info from mpd in the scr

Postby den_hr » 18 Feb 2015, 11:24

den_hr
 
Posts: 52
Joined: 06 Feb 2015, 17:10
Location: Croatia

Re: LCD in RuneAudio! Can't get the info from mpd in the scr

Postby emilot » 18 Feb 2015, 15:48

Excellent work and very helpful.....

Thank you.
emilot
 
Posts: 15
Joined: 30 Oct 2014, 18:34

Re: LCD in RuneAudio! Can't get the info from mpd in the scr

Postby ACX » 18 Feb 2015, 15:55

User avatar
ACX
RuneAudio co-founder
 
Posts: 1693
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: LCD in RuneAudio! Can't get the info from mpd in the scr

Postby den_hr » 19 Feb 2015, 10:44

den_hr
 
Posts: 52
Joined: 06 Feb 2015, 17:10
Location: Croatia

Re: LCD in RuneAudio! Can't get the info from mpd in the scr

Postby hondagx35 » 19 Feb 2015, 15:05

User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: LCD in RuneAudio! Can't get the info from mpd in the scr

Postby den_hr » 19 Feb 2015, 22:31

den_hr
 
Posts: 52
Joined: 06 Feb 2015, 17:10
Location: Croatia

Re: LCD in RuneAudio! Can't get the info from mpd in the scr

Postby bastienauneau » 24 Feb 2015, 01:49

I still think using mpc is a good alternative :
mpc stats (for what's playing)
mpc idleloop (to catch events)
is a better option, because :
_ it's portable/outside runeaudio, so you wont have to apply your patch every time you update rune audio. And what if one day, there's such a change that you need to re-design your patch ?
_ it's more simple, so easier to maintain
_ in both case (using mpc or calling the python script), you start a new process. Eventhough there's an extra process listenning to idleloop (I guess), what's expensive is creating a process

Also, having an extra daemon to do the screen is nothing wrong, I would say : it's the way to go. Not talking here about adding ten's of daemons, just one, doing a simple job, but doing it well (namely printing whatever status on the screen)
Finally, you're killing a process at every message, which doesn't look wise to me. Usually, you never need to kill a process, or else you've done a bad design choice earlier

If you want to stick on adding an extra line in runeaudio code to forward the message to your python script. I would suggest using a socket, pipe or file interface
This would allow you to catch message reading the socket/pipe/file with your python script
bastienauneau
 
Posts: 17
Joined: 16 Jan 2015, 15:18

support RuneAudio Donate with PayPal

PreviousNext

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 15 guests