Tiny Core Linux
Tiny Core Extensions => TCE Talk => Topic started by: mb0 on February 07, 2012, 05:18:37 PM
-
I'm trying to connect to music player daemon via sockets, from the command line (yes, i know mpc exists). Its not something i'm familiar with, although i have got the same effect with php and fsockopen /fwrite.
There is a guide here (http://mpd.wikia.com/wiki/How_to_connect_to_the_Unix_Socket_for_added_operations)*, however there is no '/home/USER/.mpd/socket' path, nor can i find one similar.
[*i assume the last line there is meant to be mpd not c.]
Could anyone help please?
-
Controlling 'mpd' via socket does not mean that you don't need a client any more, or that 'mpd' takes the role of a client itself. It's just another communications mechanism between the server and the client (which does not need to be 'mpc' of course).
The socket does not exist by itself, you can create it with following commands:
# mkdir /home/tc/.mpd/
# mkfifo /home/tc/.mpd/socket
You can verify the effect after having modified 'mpd.conf' and restarted 'mpd' using command 'netstat -an|grep LISTEN'. There won't be a LISTENING port on the address/port as before (something like: 0 0.0.0.0:6600) but now there will be a socket (something like: LISTENING 99401 /home/tc/.mpd/socket).
After pointing 'mpc' to use the socket via variable MPD_HOST you can then control the server via, for example: mpc add file.mp3, mpc play,.