Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Multimedia
  • Search

MPD and Pipewire [SOLVED]

Help with creation, editing, or playback of sounds, images, or video. Amarok, audacious, mplayer, grip, cdparanoia and anything else that makes a sound or plays a video.
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
paulj
Guru
Guru
User avatar
Posts: 546
Joined: Thu Sep 30, 2004 4:55 am
Location: Wales, UK

MPD and Pipewire [SOLVED]

  • Quote

Post by paulj » Thu Oct 13, 2022 6:44 am

Good morning!

Following the informative news article in July about pipewire and pulseaudio, I decided to migrate my systems over to pipewire. This proceeded without any problem, but I have one remaining issue which I would like to fix. I use MPD to manage my music collection, and since the migration I am struggling to get it working. First of all, pipewire and wire plumber are at the unstable level:

Code: Select all

media-video/pipewire
     Installed versions:  0.3.59(0/0.4)^t{tbz2}(06:30:36 13/10/22)(X bluetooth dbus doc pipewire-alsa sound-server ssl udev v4l -echo-cancel -extra -flatpak -gstreamer -jack-client -jack-sdk -lv2 -system-service -systemd -test -zeroconf ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")

media-video/wireplumber
    Installed versions:  0.4.12(0/0.4)^t{tbz2}(22:09:38 12/10/22)(elogind -system-service -systemd -test LUA_SINGLE_TARGET="lua5-4 -lua5-3")
I made the USE flag changes as instructed in the news item (-daemon / sound-server) along with the emerge instructions.

MPD configuration - I have issues when choosing to use pulse or pipewire. Here is the relevant section of the /etc/mpd.conf file:

Code: Select all

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

#audio_output {
#    type            "pulse"
#    name            "My pulse output"
#}
(commented out section showing the alternative pa option tested).

Here is the output of the log file from mpd - pulseaudio first, followed by pipewire:

Code: Select all

Oct 12 20:19 : player: played "4beat6/01_Airmail_Special.mp3"
Oct 12 21:48 : exception: Failed to enable output "My pulse output" (pulse); pa_context_connect() has failed: Connection refused
...
Oct 13 06:17 : player: played "BBC_Music/Wind_Quintets/03-Carl_Nielson-Praeludium-Adagio-Tema_con_variazioni.ogg"
Oct 13 06:37 : exception: Failed to open "Pipewire Sound Server" (pipewire); Failed to connect stream: Host is down
mpd was stopped, the configuration changed from pulse to pipewire and then restarted between these two outputs.

I have tried enabling the pipewire-alsa use flag, but no change to the output. Strangely, I can't find anything on google with this "...Host is down" error message.

So I guess my questions are as follows:
  • Have any of you managed to get mpd working with pipewire?
  • Was it an "out of the box" experience, or did you have to make configuration changes? If so, what did you do?
  • Any pointers as to where I should investigate next to resolve this problem? I have it on two similarly configured gentoo systems (AMD desktop and Intel laptop), so I don't think this is a hardware issue, It seems to be more of a configuration issue.
Many thanks for reading through, and for your comments!
Last edited by paulj on Thu Oct 20, 2022 4:12 pm, edited 1 time in total.
Top
CaptainBlood
Advocate
Advocate
User avatar
Posts: 4237
Joined: Sun Jan 24, 2010 9:38 am

  • Quote

Post by CaptainBlood » Thu Oct 13, 2022 11:09 am

Code: Select all

## An example of a pipewire output:                                            
audio_output {                                                                 
    type     "pipewire"                                                        
    name     "PipeWire Sound Server"                                           
    enabled  "no"                                                              
}                                                                              
#                                                                              
## An example of a local pulseaudio output:                                    
audio_output {                                                                 
    type     "pulse"                                                           
    name     "Local PulseAudio Server"                                         
    enabled  "yes"                                                             
}            
works fine here with older pipewire/wireplumber versions.
Latest not tested yet, but I don't expect big issues to raise in this respect.

Thks 4 ur attention, interest & support.
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Top
paulj
Guru
Guru
User avatar
Posts: 546
Joined: Thu Sep 30, 2004 4:55 am
Location: Wales, UK

  • Quote

Post by paulj » Thu Oct 13, 2022 1:13 pm

Hi CaptainBlood,
CaptainBlood wrote:works fine here with older pipewire/wireplumber versions.
Latest not tested yet, but I don't expect big issues to raise in this respect.
Thanks for your comments. Do you remember doing anything with the setup apart from the changes you shared in order to get it working?

Given the lack of people with problems, I feel there is some configuration I have made in the past which is now causing problems!
Top
paulj
Guru
Guru
User avatar
Posts: 546
Joined: Thu Sep 30, 2004 4:55 am
Location: Wales, UK

  • Quote

Post by paulj » Tue Oct 18, 2022 2:18 pm

Okay, so I have this working by running mpd as a local program rather than system wide.

I will continue to see if I can get it working properly as a system wide application.
Top
paulj
Guru
Guru
User avatar
Posts: 546
Joined: Thu Sep 30, 2004 4:55 am
Location: Wales, UK

  • Quote

Post by paulj » Thu Oct 20, 2022 4:11 pm

Ok, so now it seems I have got to the bottom of this:

You can run mpd as a system daemon, provided you use pulse as the audio type:

Code: Select all

audio_output {
    type            "pulse"
    server          "127.0.0.1"
    mixer_control   "Master"
    name            "My pulse output"
}
and enable one of the tcp lines in /etc/pipewire/pipewire-pulse.conf:

Code: Select all

pulse.properties = {
    # the addresses this server listens on
    server.address = [
       "unix:native"
        #"unix:/tmp/something"              # absolute paths may be used
        "tcp:4713"                          # IPv4 and IPv6 on all addresses
        #"tcp:[::]:9999"                    # IPv6 on all addresses
        #"tcp:127.0.0.1:8888"               # IPv4 on a single address
        #
        #{ address = "tcp:4713"             # address
        #  max-clients = 64                 # maximum number of clients
        #  listen-backlog = 32              # backlog in the server listen queue
        #  client.access = "restricted"     # permissions for clients
        #}
    ]
    #pulse.min.req          = 256/48000     # 5ms
    #pulse.default.req      = 960/48000     # 20 milliseconds
    #pulse.min.frag         = 256/48000     # 5ms
    #pulse.default.frag     = 96000/48000   # 2 seconds
    #pulse.default.tlength  = 96000/48000   # 2 seconds
    #pulse.min.quantum      = 256/48000     # 5ms
    #pulse.default.format   = F32
    #pulse.default.position = [ FL FR ]
    # These overrides are only applied when running in a vm.
    vm.overrides = {
        pulse.min.quantum = 1024/48000      # 22ms
    }
}
Details here: https://wiki.gentoo.org/wiki/PipeWire, under "Adding multi user support".

This only works with pulse - currently, the pipewire socket is not writable by group or other, so the option to set the MPD audio_output type to pipewire is only available if you use MPD as a user level daemon.

Edit: You need to have one of the tcp options enabled as well as the unix:native, otherwise MPD will work but nothing else will!
Last edited by paulj on Fri Oct 21, 2022 9:58 am, edited 2 times in total.
Top
CaptainBlood
Advocate
Advocate
User avatar
Posts: 4237
Joined: Sun Jan 24, 2010 9:38 am

  • Quote

Post by CaptainBlood » Thu Oct 20, 2022 8:07 pm

paulj wrote:Okay, so I have this working by running mpd as a local program rather than system wide.

I will continue to see if I can get it working properly as a system wide application.
Indeed mpd isn't system wide here.
Thks 4 ur attention, interest & support.
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Top
acidrums4
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 148
Joined: Thu Feb 05, 2009 11:22 pm
Location: Al otro lado del monitor

  • Quote

Post by acidrums4 » Thu Nov 17, 2022 2:35 pm

Maybe a bit of an extreme solution, but what let me use pipewire and mpd with its own user (aka system-wide mpd) was to make pipewire work system-wide.
Top
stebe
n00b
n00b
Posts: 1
Joined: Wed Jun 14, 2023 9:22 am

  • Quote

Post by stebe » Wed Jun 14, 2023 9:30 am

Posting this here because this answer seems to come up near the top when searching fpr MPD and pipewire. I uncommented the address= section and change restricted to allowed as well, will allow MPD to connect.

Code: Select all

    server.address = [
        "unix:native"
        #"unix:/tmp/something"              # absolute paths may be used
        "tcp:4713"                          # IPv4 and IPv6 on all addresses
        #"tcp:[::]:9999"                    # IPv6 on all addresses
        #"tcp:127.0.0.1:8888"               # IPv4 on a single address
        #
        { address = "tcp:4713"              # address
          max-clients = 64                  # maximum number of clients
          listen-backlog = 32               # backlog in the server listen queue
          client.access = "allowed"         # permissions for clients (was restricted)
        }
Top
paulj
Guru
Guru
User avatar
Posts: 546
Joined: Thu Sep 30, 2004 4:55 am
Location: Wales, UK

  • Quote

Post by paulj » Fri Oct 20, 2023 10:23 am

stebe wrote:Posting this here because this answer seems to come up near the top when searching fpr MPD and pipewire. I uncommented the address= section and change restricted to allowed as well, will allow MPD to connect.

Code: Select all

    server.address = [
        "unix:native"
        #"unix:/tmp/something"              # absolute paths may be used
        "tcp:4713"                          # IPv4 and IPv6 on all addresses
        #"tcp:[::]:9999"                    # IPv6 on all addresses
        #"tcp:127.0.0.1:8888"               # IPv4 on a single address
        #
        { address = "tcp:4713"              # address
          max-clients = 64                  # maximum number of clients
          listen-backlog = 32               # backlog in the server listen queue
          client.access = "allowed"         # permissions for clients (was restricted)
        }
Hi Stebe!

Thanks for sharing this. Could you please also share how you configured mpd? Did you use the audio_output type pipewire?

For anyone else looking, the above code can be found in /etc/pipewire/pipewire-pulse.conf
Top
Post Reply

9 posts • Page 1 of 1

Return to “Multimedia”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic