You are not logged in.

#1 2015-03-08 16:42:22

Registered: 2008-05-03
Posts: 13

accessing remote hosts’ mpd / ncmpcpp FIFO visualizer over network

Hey folks!

I’m looking for a Linux/Unix independent solution for accessing mpd / ncmpcpp FIFO visualizer running on some remote host via my terminal on localhost.

Unfortunately I did not find a how-to or some guidelines for this, so I tried to figure out one way of achieving my goal. But I think it’s improvable!

On the remote host (server) – which runs mpd and is always connected to the network – I’m using this in a crontab:

@reboot nc -k -l 1337 < /tmp/fifo.fifo

On the localhost (client) – a computer which runs ncmpcpp and is not always connected to the network – I’m using this command:

nc -d $IP_OF_SERVER 1337 > /tmp/mpd.fifo & ncmpcpp -s visualizer

The server permanently listens for a connection on the specified port (thanks to the -k parameter).

The client just connects to the server when it needs to.

This is the important part of the ncmpcpp config on the localhost:

mpd_host = "$IP_OF_SERVER"
visualizer_fifo_path = "/tmp/mpd.fifo"

This is the important part of the mpd config on the remote server:

audio_output {
  path    "/tmp/fifo.fifo"

Unfortunately, running the 'nc' command on the client seems to use a very high amount of resources … ~100% of my CPU performance.

Unfortunately, it’s not possible to just specify a network-path for visualizer_fifo_path, like:

visualizer_fifo_path = "$IP_OF_SERVER:/tmp/fifo.fifo"

Maybe the problem is that 'nc' is started in 'tmux' together with 'ncmpcpp' … this is from my tmux-bash-script:

tmux split-window -t "$session":1 -v -p 28 "nc -d $IP_OF_SERVER 1337 > /tmp/mpd.fifo & ncmpcpp -s visualizer"

Maybe you could permanently run 'nc -d $IP_OF_SERVER 1337' in the background? Maybe also started by a crontab?

Is there something like the -k parameter for connecting to a server?

If anyone would be able to improve this, I would be very thankful.

Also it would be great if this would be added to the Arch Linux wiki afterwards. … yer_Daemon

Thanks very much and kindest regards!

PS: Sure, you could also use 'ssh' to run 'ncmpcpp' from the remote host. The problem with 'ssh' is, that when the connection is lost, the window is closed and not automatically reopened.

ssh -t $IP_OF_SERVER 'ncmpcpp -s visualizer'

Last edited by And1 (2015-10-31 09:45:11)


#2 2020-10-14 13:12:39

Registered: 2015-09-03
Posts: 1

Re: accessing remote hosts’ mpd / ncmpcpp FIFO visualizer over network

after long long time, I will reply: … etcat.html

> start on ncmpcpp host with:

nc -l -p 1337 > /tmp/mpd.fifo

> start netcat on mpd host:

nc $ncmpcpp_host 1337 < /tmp/mpd.fifo

it's works...


Board footer

Powered by FluxBB