How I got Roon working over OpenVPN (hard for me, easy for you)

Hey @Jarle_L:

So not sure if you’re running pfSense on both ends or how technical you are… If you’re up for checking out the code and building it yourself you’ll want to check out the site-to-site branch of code:

git clone https://github.com/synfinatic/udp-proxy-2020.git
cd udp-proxy-2020
git checkout site-to-site
make help
# read help to figure out the correct target name
make <target>

Depending on what platform(s) you need you may need Docker and/or VirtualBox/Vagrant.

Otherwise, you can tell me what OS/Hardware your two ends are and I can see about getting you some binaries.

So with that said:

  1. Run udp-proxy-2020 on the RoonCore/server side as normal. Don’t forget to use the correct port: 9003 for Roon’s discovery protocol
  2. Run udp-proxy-2020 on the Roon client side, but you’ll need to add another flag: --fixed-ip ovpnc2@x.x.x.x where x.x.x.x is the IP address of the OpenVPN tunnel interface on the other end.

This is a little hack honestly, and I really want to avoid passing in the --fixed-ip argument, but since I have no good way of testing your config locally, this would at least ensure I’m on the right path.

I should mention, if you can leave any feedback on github that would be preferred as it’s much easier to track everything there: https://github.com/synfinatic/udp-proxy-2020/issues/41 If that’s not possible for you, no worries, I’ll deal with it here.

Hi and thanks Aaron!

I am not ready to take on building it myself at the moment, but both ends are pfSense running on amd64 hardware. If you can make a binary for that it would be great!

I am not using it for Roon, but for a client broadcasting on UDP port 1456.
Will continue giving feedback on github.

Best regards,
Jarle

Cool stuff !

Has anyone managed to run it on a Asus router with Merlin ?

No idea. I assume it’s Linux based? What CPU/arch?

It is, this is what I found out : “RT-AC86U have aarch64 architecture, and can run both armv7 (32 bit) and aarch64 (64 bit) binaries”

You should try the linux-arm64 binary then: https://github.com/synfinatic/udp-proxy-2020/releases

I tried but it bombed out, I should have started with that in my first message :slight_smile:

./udp-proxy-2020-0.0.6-linux-arm64-static
fatal error: out of memory allocating heap arena map

runtime stack:
runtime.throw(0x6703eb, 0x27)
/usr/lib/go-1.14/src/runtime/panic.go:1116 +0x54 fp=0x7fe2ac0de0 sp=0x7fe2ac0db0 pc=0x42f04c
runtime.(*mheap).sysAlloc(0x886460, 0x400000, 0x7fe2ac0ef8, 0x423630)
/usr/lib/go-1.14/src/runtime/malloc.go:725 +0x5f0 fp=0x7fe2ac0e90 sp=0x7fe2ac0de0 pc=0x40b018
runtime.(*mheap).grow(0x886460, 0x1, 0x0)
/usr/lib/go-1.14/src/runtime/mheap.go:1286 +0x134 fp=0x7fe2ac0f00 sp=0x7fe2ac0e90 pc=0x423aac
runtime.(*mheap).allocSpan(0x886460, 0x1, 0x2a00, 0xdb8948, 0x0)
/usr/lib/go-1.14/src/runtime/mheap.go:1124 +0x610 fp=0x7fe2ac0f80 sp=0x7fe2ac0f00 pc=0x423818
runtime.(*mheap).alloc.func1()
/usr/lib/go-1.14/src/runtime/mheap.go:871 +0x60 fp=0x7fe2ac0fe0 sp=0x7fe2ac0f80 pc=0x4582c8
runtime.(*mheap).alloc(0x886460, 0x1, 0x7fe2ac012a, 0x414ddc)
/usr/lib/go-1.14/src/runtime/mheap.go:865 +0x64 fp=0x7fe2ac1030 sp=0x7fe2ac0fe0 pc=0x422e1c
runtime.(*mcentral).grow(0x897338, 0x0)
/usr/lib/go-1.14/src/runtime/mcentral.go:255 +0x74 fp=0x7fe2ac1080 sp=0x7fe2ac1030 pc=0x4155cc
runtime.(*mcentral).cacheSpan(0x897338, 0x40c508)
/usr/lib/go-1.14/src/runtime/mcentral.go:106 +0x338 fp=0x7fe2ac10d0 sp=0x7fe2ac1080 pc=0x4150c0
runtime.(*mcache).refill(0x7fa76c2108, 0x2a)
/usr/lib/go-1.14/src/runtime/mcache.go:138 +0xa4 fp=0x7fe2ac1100 sp=0x7fe2ac10d0 pc=0x414b0c

“out of memory”… well that would explain it. Your router has only 512MB of total RAM. Sounds like you’ve run out. I might be able to shave some memory usage off by building a 32bit ARM version, but due to the need to create a cross-compile toolchain it might take a day or two. Also, no idea if that will actually help you.

Are you running services on your router you don’t need?

I have about half free. Not running any QOS/Game accelerator. Even my Open VPN is not running there but on my synology (I might be confused, your process must run on the router or whatever runs the VPN ?).
So a 32 bits version might be handy, no rush whatsoever … Those Asus routers are quite popular actually, I would be shocked if I was the only one having one in combination with roon.

Of course, if there are other alternatives to use OpenVPN with Android phones and Samsung then it could be another option, I have not been able to fully read the ‘other’ vpn thread :slight_smile:

So far I liked your solution the best though.

If your OpenVPN server is your Synology NAS then you’ll need to run udp-proxy-2020 there. Your Asus router only sees the encrypted packets and can’t see the packets from Roon running on your phone/etc.

FYI: two kinds of arm32 binaries are now available on the releases page: https://github.com/synfinatic/udp-proxy-2020/releases/tag/v0.0.6

Don’t ask me if you need the linux-arm32 or linux-arm32hf… I don’t know. :slight_smile: I just know the latter is for CPU’s with hardware floating point.

1 Like

Amazing ! Thanks !

Hi @Aaron_Turner

My roon core was installed on a linux debian machine (intel x86).
OpenVPN was set up on the the same machine using docker container.

I’ve configured the virtual server for port 1194 to the linux machine on the router side.
(and tried ports 500/4500/1701 for l2tp/ipsec vpn before)

No matter what I did with various configurations, I can browse roon albums but just could not find phone’s audio device outdoors.

I am not sure how to run udp-proxy-2020 since openvpn is launched from container so no tun0 interface exposed on the linux machine.

Do I need additional configuration from the router and phone ends?
Thank you so much for your help.

If you can’t see the tun0 interface, then you can’t use udp-proxy-2020 in this configuration. You’d have to figure out how to run both in the container. Or just run OpenVPN on your Debian box without Docker (apt-get install openvpn or whatever).

Hai. I am following this topic with great interest. I have a rpi 4 ubuntu server 20.04 with Wireguard. This is going well. I just don’t understand how I can install udp-proxy-2020 and configurate on this. Is there someone who can guide me in this?

Have you read the docs? Have you downloaded the binary off github and given it a try? Maybe if you had specific questions someone could help you.

As Aaron wrote, we can help with more specific questions.
On my Rpi4 with dietpi, I have installed golang package, downloaded the sources from github, compiled the application, copied the binaries to a “production” directory under /opt and created a simple script for sysconfig to have udp-proxy-2020 starting automatically at boot.

Thanks in advance Aaron and Francesco. I’ll try to be more specific. I am not that skilled at programming. I am gradually starting to learn some terms. After a lot of trying I finally got WireGuard working under Ubuntu 20.04 server on the Raspberry Pi 4 (arm 64). My question now is what steps should I take. I understand that I must first download and install Golang package for ubuntu (arm 64).

No need to install GoLang or compile it yourself. There are binaries for RaspberryPi available on the releases page: Releases · synfinatic/udp-proxy-2020 · GitHub

Okay Aaron. Then I don’t know which one to use and how to install it. (I am digitally illiterate sorry)