You are not logged in.

#1 2025-08-23 18:23:25

dartfira
Member
Registered: 2010-08-23
Posts: 111

MPD Satellite Conf - audio_output on server

Hello all, I'm trying setting up the Satellite Configuration of MPD, which I hope to find very comfortable for my use. I've followed the Archlinux guide for that.

I connect to my server behind a proxy, tunneling an SSH connection then:
proxychains ncmpc  -h localhost -p 6600
To get to the server, I'm not sure that MPD has SOCKS5 configuration enable in the proxy plugin.

The problem is that I'm also connection to the audio_output of the server, the one called "null" and can't use the one of the client. Has anyone managed to have a good configuration and a working setup.

Thank you.

SERVER CONF - /etc/mpd.conf

pid_file            "/run/mpd/mpd.pid"
playlist_directory  "/var/lib/mpd/playlists"
music_directory     "/mnt/media-ext/music"

database {
    plugin           "simple"
    path             "/var/lib/mpd/mpd.db"
    cache_directory  "/var/lib/mpd/cache"
}

audio_output {
    type  "null"
    name  "This server does not need to play music, but it can"
}

CLIENT CONF - /etc/mpd.conf

# See: /usr/share/doc/mpd/mpdconf.example

pid_file "/run/mpd/mpd.pid"
#db_file "/var/lib/mpd/mpd.db"
state_file "/var/lib/mpd/mpdstate"
playlist_directory "/var/lib/mpd/playlists"

# WebDAV setup
#music_directory     "https://optional_user:optional_password@example.com/path/to/your/music/"

# WebDAV setup
music_directory     "http://username:password@192.168.1.212/svn/music/"
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"

audio_output {
         type            "pipewire"
         name            "PipeWire Sound Server"
}

# Note the proxy here
# database {
#     plugin  "proxy"
#     host    "localhost"
#     port    "8080"
# }

# database {
#     plugin           "simple"
#     path             "/var/lib/mpd/mpd.db"
#     cache_directory  "/var/lib/mpd/cache"
# }

# audio_output {
#     type        "alsa"
#     name        "My ALSA Device"
#     device      "hw:0,0"  # Cambia questo in base al tuo dispositivo
# }

# audio_output {
#         type "pulse"
#         name "pulse audio"
# }

# Configurazione client
# client {
#     type "local"
#     name "My MPD Client"
# }

port "8080"
bind_to_address "0.0.0.0"

Last edited by dartfira (2025-08-23 19:04:30)

Offline

#2 2025-08-23 19:34:57

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,617

Re: MPD Satellite Conf - audio_output on server

proxychains ncmpc  -h localhost -p 6600

Why would you proxychain some mpd client? It would talk to the local (proxy) daemon, no?

You'll need

database {
     plugin  "proxy"
     host    "somehost"
     port    "someport"
}

where somehost and someport must somehow™ connect the master daemon. So if we'd scrap the socks situation (Why, btw? You can access if via webdav?)

database {
     plugin  "proxy"
     host    "192.168.1.212"
     port    "6600"
}

If you'd need proxychains to access the destination (local socks) you'd proxychains mpd, not ncmpc - the latter would just talk to the local mpd satellite.

My impression is that currently you're running ncmpc against the remote daemon.

nmap 192.168.1.212

Offline

#3 2025-08-23 21:38:41

dartfira
Member
Registered: 2010-08-23
Posts: 111

Re: MPD Satellite Conf - audio_output on server

Thank you for the answer.

seth wrote:

Why would you proxychain some mpd client? It would talk to the local (proxy) daemon, no?

I'm not tunneling all the connection from client through the server, that's because I was using proxychain.

seth wrote:

where somehost and someport must somehow™ connect the master daemon. So if we'd scrap the socks situation (Why, btw? You can access if via webdav?)

I don't want to open webdav outside SSH, that's because i tunnel my connection and use proxychain, is there any other way to do that?

I'm just getting into SSH and networking so maybe I'm just doing something wrong, but I think the guide in Archlinux is assuming that the connection to server is not within a tunnel.

Last edited by dartfira (2025-08-24 06:07:59)

Offline

#4 2025-08-24 08:25:01

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,617

Re: MPD Satellite Conf - audio_output on server

I'm not tunneling all the connection from client through the server

The point is that you don't want the mpd client (ncmpc) connect to the master mpd daemon (on 192.168.1.212, I guess?) at all but the local satellite one. You should™ not need a proxy for that relation at all.
If anything you want to use proxychains w/ the local mpd satellite instance and the config of the satellite needs to reference the remote server and port

database {
     plugin  "proxy"
     host    "192.168.1.212"
     port    "6600"
}
port 6666

Right now you're running ncmpc through proxychains, so it basically connects to and operates the remote mpd, your local mpd instance is just "there"
The only question (idg that) is whether proxychains interferes w/ the satellites local port, check ss whether the satellite is still listening on local port 6666 so instead you might want to

bind_to_address    "/run/user/1000/mpd.socket"

and

mpd_host = /run/user/1000/mpd.socket

in at least ncmpcpp (no idea whether that's supported in ncmpc) to make the satellite listening to a local socket instead of a udp host:port (and this way hopefully the server part immune against proxychains)

Offline

#5 2025-08-24 08:50:08

dartfira
Member
Registered: 2010-08-23
Posts: 111

Re: MPD Satellite Conf - audio_output on server

Maybe I did a mess before explaining what I'd like to do. I get that I was wrong before, trying to connect by proxychains it only means that i can control MPD-Server by remote, no use for me.
I've got a server with MPD and music on HDD, I use to connect to that server through SSH, MPD can't be used by SSH, so i tunnel my connection and used a proxy to be in the server LAN and get to WebDav.

That's the command I use for tunneling:
ssh -TN -D 1080 someuser@somehost.org
I checked with Proxy setting in Falkon localhost 1080 works.

So I made some changes to my mpd.conf
SERVER

pid_file            "/run/mpd/mpd.pid"
playlist_directory  "/var/lib/mpd/playlists"
#music_directory     "/mnt/media-ext/music"
music_directory "http://linuxconfig:linuxtest@192.168.1.212/svn/music/"

database {
    plugin           "simple"
    path             "/var/lib/mpd/mpd.db"
    cache_directory  "/var/lib/mpd/cache"
}

audio_output {
    type  "null"
    name  "This server does not need to play music, but it can"
}

#port "6600"
bind_to_address "0.0.0.0"
port "1080"

CLIENT

# See: /usr/share/doc/mpd/mpdconf.example

#pid_file "/run/mpd/mpd.pid"
#db_file "/var/lib/mpd/mpd.db"
state_file "/var/lib/mpd/mpdstate"
playlist_directory "/var/lib/mpd/playlists"

# WebDAV setup
#music_directory     "https://optional_user:optional_password@example.com/path/to/your/music/"

# WebDAV setup
music_directory "http://optional_user:optional_password@192.168.1.212/svn/music/"
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"

audio_output {
         type            "pipewire"
         name            "PipeWire Sound Server"
}

#Note the proxy here
database {
    plugin  "proxy"
    host    "localhost"
    port    "1080"
}

# database {
#     plugin           "simple"
#     path             "/var/lib/mpd/mpd.db"
#     cache_directory  "/var/lib/mpd/cache"
# }

# audio_output {
#     type        "alsa"
#     name        "My ALSA Device"
#     device      "hw:0,0"  # Cambia questo in base al tuo dispositivo
# }

# audio_output {
#         type "pulse"
#         name "pulse audio"
# }

# Configurazione client
# client {
#     type "local"
#     name "My MPD Client"
# }

# port "1080"
# bind_to_address "0.0.0.0"

Then if I tried to connect/restart my mpd.service

ago 24 10:44:57 user1 systemd[1]: Starting Music Player Daemon...
ago 24 10:44:57 user1 mpd[446657]: server_socket: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use
ago 24 10:45:27 user1 mpd[446657]: exception: Failed to connect to remote MPD "localhost"; Timeout
ago 24 10:45:27 user1 systemd[1]: Started Music Player Daemon.

So that's what I'm thinking about, it's like the MPD proxy plugin won't connect to my server MPD by proxy, and also why it's trying to bind yo 6600.

Offline

#6 2025-08-24 09:05:28

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,617

Re: MPD Satellite Conf - audio_output on server

6600 is the default local port of the local (satellite) mpd - the suggestions would be to
1. proxychains mpd
2. make the satellite mpd use a unix socket to avoid interference from proxychains (the satellite mpd will then not attempt to open 6600 on localhost, but the local socket in your runfs)

Offline

#7 2025-08-24 15:59:29

dartfira
Member
Registered: 2010-08-23
Posts: 111

Re: MPD Satellite Conf - audio_output on server

Tried something but I'm not really catching up what to do.

seth wrote:

6600 is the default local port of the local (satellite) mpd

To be sure, Satellite is the Server or the client, first one for me?

seth wrote:

1. proxychains mpd

Talking about the client MPD, that wouldn't reproduce the problem I had before?

seth wrote:

2. make the satellite mpd use a unix socket to avoid interference from proxychains (the satellite mpd will then not attempt to open 6600 on localhost, but the local socket in your runfs)

So I've edited the mpd.socket of the server adding this line:
ListenStream=1080
and commenting the one on 6600.

Offline

#8 2025-08-24 18:26:32

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,617

Re: MPD Satellite Conf - audio_output on server

(main) mpd => socks => (satellite) mpd => ncmpc

The connection between ncmpc and the satellite mpd is (afaiu) local, socks is completely irrelevant to this, your concern is to properly forward the main mpd to the satellite one.
You *might* have to use proxychains for this (ie. w/ the satellite mpd to make sure it connects through the proxy) and you therefore *might* have to make the satellite listen on a unix socket to keep that connection (which is then be used by ncmpc) away from the socks proxy.

The "problem you had before" was (most likely) that you simply connected ncmpc to the main mpd server, completely skipping the satellite one

ListenStream=1080

Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
What kind of setting is that supposed to be?
https://man.archlinux.org/man/mpd.conf.5#port

Offline

#9 2025-09-23 08:03:10

dartfira
Member
Registered: 2010-08-23
Posts: 111

Re: MPD Satellite Conf - audio_output on server

Hello all and thanks seth for the support, I'm back with that.

ncmpc still can't connect to the server/main from my satellite, and I suppose the problem is with the satellite one, not the server.

SATELLITE SIDE CONF
/usr/lib/systemd/system/mpd.service (added proxychains to tunnel the connection to main MPD)

[Unit]
Description=Music Player Daemon
Documentation=man:mpd(1) man:mpd.conf(5)
After=network.target sound.target

[Service]
Type=notify
ExecStart=/usr/bin/proxychains /usr/bin/mpd --systemd
#ExecStart=/usr/bin/mpd --systemd

# Enable this setting to ask systemd to watch over MPD, see
# systemd.service(5).  This is disabled by default because it causes
# periodic wakeups which are unnecessary if MPD is not playing.
#WatchdogSec=120

# allow MPD to use real-time priority 40
LimitRTPRIO=40
LimitRTTIME=infinity

# for io_uring
LimitMEMLOCK=64M

# disallow writing to /usr, /bin, /sbin, ...
ProtectSystem=yes

# more paranoid security settings
NoNewPrivileges=yes
ProtectKernelTunables=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
RestrictNamespaces=yes

[Install]
WantedBy=multi-user.target
Also=mpd.socket

Start command and status for mpd

sudo systemctl restart mpd && systemctl status mpd
● mpd.service - Music Player Daemon
     Loaded: loaded (/usr/lib/systemd/system/mpd.service; disabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/mpd.service.d
             └─00-arch.conf
     Active: active (running) since Tue 2025-09-23 09:37:49 CEST; 11ms ago
 Invocation: f4289ef9a6554b9784f6434e3e4f8820
       Docs: man:mpd(1)
             man:mpd.conf(5)
   Main PID: 307084 (mpd)
      Tasks: 3 (limit: 28024)
     Memory: 20.3M (peak: 20.3M)
        CPU: 90ms
     CGroup: /system.slice/mpd.service
             └─307084 /usr/bin/mpd --systemd

set 23 09:37:48 esseci-arch systemd[1]: Starting Music Player Daemon...
set 23 09:37:49 esseci-arch proxychains[307084]: [proxychains] config file found: /etc/proxychains.conf
set 23 09:37:49 esseci-arch proxychains[307084]: [proxychains] preloading /usr/lib/libproxychains4.so
set 23 09:37:49 esseci-arch proxychains[307084]: [proxychains] DLL init: proxychains-ng 4.17
set 23 09:37:49 esseci-arch systemd[1]: Started Music Player Daemon.

grep -v '^#' /etc/proxychains.conf

strict_chain
proxy_dns
remote_dns_subnet 224
tcp_read_time_out 15000
tcp_connect_time_out 8000
[ProxyList]
socks5 127.0.0.1 1080

nano /usr/lib/systemd/system

[Socket]
ListenStream=%t/mpd/socket
#ListenStream=6600
ListenStream=1080
Backlog=5
KeepAlive=true
PassCredentials=true

[Install]
WantedBy=sockets.target

Offline

#10 2025-09-24 20:21:41

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,617

Re: MPD Satellite Conf - audio_output on server

ncmpc still can't connect to the server/main from my satellite

You *only* want ncmpc to connect to the satellite, never try to connect it to the server.

Then I'd skip the service for now and manually run "/usr/bin/proxychains /usr/bin/mpd"
Also what does the satellite's mpd.conf look like now?
(As well as you ncmpc*.conf)

Offline

#11 2025-09-26 16:33:24

dartfira
Member
Registered: 2010-08-23
Posts: 111

Re: MPD Satellite Conf - audio_output on server

seth wrote:

You *only* want ncmpc to connect to the satellite, never try to connect it to the server.

Yeah, you're right I was wrong with the words.

seth wrote:

Then I'd skip the service for now and manually run "/usr/bin/proxychains /usr/bin/mpd"

/usr/bin/proxychains /usr/bin/mpd
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.17
server_socket: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use
exception: Failed to create pid file "/run/mpd/mpd.pid": Permission denied
seth wrote:

Also what does the satellite's mpd.conf look like now?
(As well as you ncmpc*.conf)

/etc/mpd.conf

pid_file            "/run/mpd/mpd.pid"
playlist_directory  "/var/lib/mpd/playlists"
#music_directory     "/mnt/media-ext/music"
music_directory "http://linuxconfig:linuxtest@192.168.1.212/svn/music/"

database {
    plugin           "simple"
    path             "/var/lib/mpd/mpd.db"
    cache_directory  "/var/lib/mpd/cache"
}

audio_output {
    type  "null"
    name  "This server does not need to play music, but it can"
}

#port "6600"
bind_to_address "0.0.0.0"
port "1080"

Offline

#12 2025-09-28 17:48:02

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,617

Re: MPD Satellite Conf - audio_output on server

That looks like the remote config from #5 - the satellite is the system where you intend to hear the music.
The suggestion would then be to there (the satellite, where you're listening) use eg.

bind_to_address    "/run/user/1000/mpd.socket"

(the file location depends on as what user you want to run the mpd satellite, but you can use /tmp/mpd.socket for testing purposes)
Then

MPD_HOST=/run/user/1000/mpd.socket mpc status

to check principal function.
ncmpcpp (nb the "pp", idk about ncmpc) then also allows you to set

mpd_host = /run/user/1000/mpd.socket

to talk to that socket.

Using a unix socket on the satellite system side-steps any port-related issues you might otherwise get w/ proxychains (and as a bonus playback of local files wink)

Offline

#13 2025-10-01 10:29:04

dartfira
Member
Registered: 2010-08-23
Posts: 111

Re: MPD Satellite Conf - audio_output on server

I'm sorry but I can't follow what to do. I've stopped the mpd.service and mpd.socket and try to run them directly by
/usr/bin/proxychains /usr/bin/mpd

If I tried to run

MPD_HOST=/run/user/1000/mpd.socket mpc status

Keeps getting: MPD error: No such file or directory

Also while i try to tunnel my connection through

ssh -TN -D 1080 someuser@somehost.org
Enter passphrase for key ': 
bind [127.0.0.1]:1080: Address already in use
channel_setup_fwd_listener_tcpip: cannot listen to port: 1080
Could not request local forwarding.

Offline

Board footer

Powered by FluxBB