UPnP Endpoint on MacOS

There was a question recently about using a computer running MacOS (for example, a MacBook Pro or a Mac Mini) as a UPnP endpoint. At that time I wasn’t aware of a way to run the needed software (a UPnP renderer) on MacOS.

Just within the past few days, the developer of the UPnP renderer software upmpdcli has ported it to the Mac, and I have it installed and running on my MacBook. Installation is perhaps not elementary, but at least currently this is the only way I know of to use a computer running MacOS as a UPnP endpoint. Knowledge of Linux (you won’t have to install Linux, so don’t worry about that) or familiarity with using the terminal on the Mac is probably helpful.

I don’t want to get into more than a general overview in this initial post, but if anyone has questions I’ll try to answer them when and if I can.

In summary, these are the steps:

  • Install Homebrew on the Mac, then install mpd with Homebrew. (It’s also possible with MacPorts AIUI, but the MacPorts version is older, and I like using the current stable version if possible.) Edit the mpd.conf file to configure appropriately for your installation. Start (or restart) mpd to be sure the configuration works and mpd is running.

  • Download and install upmpdcli’s dependencies and upmpdcli from the source files, as outlined at these links:
    Upmpdcli on MacOS
    Upmpdcli and associated libraries downloads
    Upmpdcli

I used the first MacOS installation method (following the Linux meson directions, but installing to /usr/local rather than /usr). Before beginning the build you’ll need to install at least meson and jsoncpp with Homebrew - I think those are all that’s needed IIRC.

After build and install, edit the upmpdcli.conf file as appropriate and type upmpdcli in the terminal to run it.

What can I say, I like playing with this stuff. If there’s anyone who feels like repurposing an Apple computer as a UPnP endpoint, at least now you know it’s possible.

4 Likes

I have been using the Openhome player on my MacBook, which seems to work fine, although I haven’t tested extensively.

http://openhome.org/pages/use/downloads/mac.html

I may play around with mpd and upmpdcli just for the fun of it… :wink:

1 Like

Yep, that’s another (more convenient) way to go. The reason I went the upmpdcli route is because I normally upsample to DSD, and it handles DSD and doesn’t limit upsampling. IIRC, the OpenHome player isn’t compatible with DSD output from Audirvana. (Is that correct? Always happy to learn about another UPnP option for my use case.)

I tried DSD (DOP) with the Openhome player and it didn’t work, although I’m not sure how to set the bitrate in Midi settings which is still controlling my DAC rate.

1 Like

Interesting setup (particularly since I just happened to have Homebrew installed on my Mac and I‘m experimenting with it :grinning:).

So how does your setup work: I guess you have Audirvana running on a different computer and use the Mac for UPnP rendering which in turn feeds your HiFi via USB? Correct?

Soundwise, no concerns of using a computer that has a myriad of background processes running at the same time (just to mention those ever occurring audiophile arguments :grinning:)?

That’s generally correct, though the MacBook is feeding a portable DAC with headphones via USB, rather than feeding the main system.

For me this is part of an experiment involving a VPN (Tailscale) where I want to see whether I can send music via Audirvana and UPnP to a location outside my home network.

Why bother when I could simply run Audirvana on the MacBook? Because using Tailscale I have secure access to my entire home digital music collection wherever I am without having to bring any physical media with me. (I initially tried out Tailscale just with the idea of being able to securely ssh into a home computer when I was away, but then this other possibility opened up.)

For this usage I’m not necessarily looking for the ultimate in a silent UPnP endpoint. However, stay tuned on that front, because I have a very tiny mini-computer that could fill that role.

Interesting setup, indeed! Please keep us informed how it goes! Br, Paul

1 Like

I’ve read enough about the hazards of using UPnP outside the home LAN that I’ve decided not to do this. Whether there’s a more secure way to approach it, I don’t know.

Perhaps you might resort to Roon with its ARC app? Or the Audirvāna people develop something as an equivalent to Roon‘s ARC. It seems to be doable.

1 Like

Would this be a solution?

:notes: :eye: :headphones: :eye: :notes:

Thanks for the suggestion, but unfortunately it doesn’t change the situation.

Tailscale is a VPN just like Nord. Here’s what Nord has to say about UPnP (note the connection to the gaming server in Nord’s Meshnet illustration is using port forwarding rather than UPnP):

Edit: Please note they are only talking about opening up UPnP connections to the outside world, not within the home network.

Hello @Jud

I’d like to setup a upnp/dnla renderer on my Mac, and I found this thread but I would need so help if you accept :slight_smile:

  • I know homebrew and it’s installed
  • I already have mpv installed too via homebrew.
  • I installed meson and jsoncpp via homebrew too.
  • I did brew install libupnp and it’s installed

Now I have to built but I don’t understand the configuration…

In the configuration manual they say I have to :

meson setup --prefix /usr build
cd build
ninja
sudo meson install

I guess I have to adapt those command lines to my config but I don’t know how do it…

I’m not a computer engineer :melting_face:

Could you help me ? Thanks !!

Welcome…
By using the ‘Shift + @’ keys together you can tag @Jud as I have just done for you to see if he can be of help here…

:musical_notes: :eye: :nose: :eye: :musical_notes:

Thank you Agoldnear, I sent him a message :slight_smile: thank you for your help !

I’m here :slightly_smiling_face:. When answering a question like this about something I haven’t looked at in a while, I want to be careful to be thorough and accurate in my reply, which takes time. I won’t have that time today, but will try to get back to you sometime tomorrow.

Thank you very much Jud !

1 Like

Wow, it’s been a while, but I finally got some time this evening and after a few fits and starts, it’s working. :slightly_smiling_face:

From the place where you are now, here are the next things to do:

You wrote that you installed mpv. Don’t know if this was a typo, but upmpdcli uses mpd. So if you have indeed installed mpv, remove it and install mpd. There will be a message at the end of the mpd installation telling you where to copy the mpd.conf file - follow that instruction.

Upmpdcli uses libnpupnp rather than libupnp. So remove libupnp and install libnpupnp with Homebrew. Next, use Homebrew to install libupnpp.

Now you’ll use meson to install upmpdcli. The configuration manual is for Linux and there’s one variation for the Mac installation. Open the Terminal and issue the following commands in sequence:

meson setup build

cd build

ninja

sudo meson install

Then you will have to edit a couple of configuration files on the Mac.

The mpd.conf file will be in the .mpd folder in your user directory where you copied it. If I’m remembering what I did correctly, all you need to edit here is the audio output. The Mac audio output is way down toward the end of the file. Just as proof of concept I’m using the Mac speakers for output at this point, so I’ve edited the uncommented lines to look like this:

audio_output {

type “osx”

name “CoreAudio”

mixer_type “software”

}

Then you want to edit the upmpdcli.conf-xml file, which is in the /opt/homebrew/share/upmpdcli directory. The only thing you should need to uncomment and add there is the network interface, which is in all probability en0 (though you should check by issuing ifconfig in the terminal).

Then you can restart mpd and start upmpdcli. I haven’t bothered to set these up as services with launchctl, because again, I’m just doing proof of concept at this point. So you’d issue from the terminal:

brew services restart mpd

upmpdcli

Then check the computer where you have Audirvana running and see whether the Mac is showing as a UPnP endpoint. Hopefully it is. Don’t turn on upsampling if you’re playing to the Mac’s speakers, since I believe the Mac’s sound system only goes up to 24/96. (Happy to be corrected if that’s not true.) Try to play something from Audirvana and see if it works!

@Badsheep
Seems like a kluge to try and make a Mac operate as a UPnP endpoint… My question is Why ? :thinking:

:musical_notes: :eye: :nose: :eye: :musical_notes:

Hello Jud !

Thank you SO MUCH for taking the time to answer me !

I have mpd installed (and mpv too, I did some experimentations for other setup with mpv).
I’m stucked at one moment : when I do brew install libnpupnp , it doesn’t work…

Terminal displays :

Warning: No available formula with the name "libnpupnp". Did you mean libupnp or libnatpmp?

==> Searching for similarly named formulae and casks...

==> Formulae

libupnp ✔                                libnatpmp



To install libupnp ✔, run:

  brew install libupnp ✔

And it’s the same for libupnpp. Do you think I cound do try to donwoload that libraries elsewhere, on Macport for example ?

Or I can download everything here : Upmpdcli and associated libraries downloads
But I don’t know where to put them on my system…