What Library Does Roon Use for SRC (Mac)?

What library does Roon use for on-the-fly sample rate conversion / bit rate truncation (e.g. streaming a 24/96khz to Airplay)?

Does it use SoX, Core Audio / Quicktime, or something else?

We own our DSP code.

All integer-ratio down-sampling uses filters designed by Meridian. As of the Roon/Sooloos split, these were the same filters used in their Sooloos products (we have no reason to believe that this has changed since). These are minimum-phase FIR decimation filters.

Asynchronous down-sampling uses polynomial interpolation. This is only used for AirPlay.

DSD-to-PCM conversion is 2-stage: first we do an 8x FIR decimation (antialiasing filter), then apply a (configurable + optional) IIR filter to reduce ultrasonic noise. This second stage simulates the analog reconstruction filter in a DSD DAC.

All filtering operations are dithered appropriately with a TPDF dither. When filtering or processing, we expand bit-depth when possible to maximize headroom.

When playing 96k to AirPlay, we use the FIR decimation filters to get to 48k, then use polynomial interpolation for the 44.1k-48k step.

We are working on expanding DSP/sample rate conversion options. The polynomial converter used for AirPlay is on the chopping block as there are better ways to accomplish that conversion.

2 Likes

Ahh, interesting. :smiley:

Interesting, and I’m a bit surprised its all custom.

Since most of my listening is via streaming…

(I do have an external DAC in the office where the Roon server lives, but my wife is usually hogging that machine during prime listening hours watching streaming Asian soap operas…sigh…best sounding soaps you’ve ever heard!)

…but I digress…

…is there any advantage to just SRCing all my high resolution files in advance using SoX (I usually use VHQ Linear Phase) or similar so that Roon doesn’t have to do it on the fly while listening via AppleTV?

Or would I be making extra work for myself for no good reason?

…is there any advantage to just SRCing all my high resolution files in advance using SoX (I usually use VHQ Linear Phase) or similar so that Roon doesn’t have to do it on the fly while listening via AppleTV?

Short answer: don’t do it :slight_smile:

Long answer:

Our 96/192/48->44.1k resampling process is not as good as SOX VHQ Linear Phase. The one we use for integer ratio conversions is at least on par. We are working on replacing our sample rate converters with something that should be an improvement over sox (we will use a similar implementation technique to sox, but with filter designs tailored for playback applications). That should close or exceed any gaps.

So there’s a slight theoretical advantage to pre-processing, but I’m about to throw a wrench into the plan:

No matter how you resample your audio to 44.1k, the AppleTV is going to convert it to 48k internally before playback–this is a very unfortunate quirk of AppleTVs. This step is likely to be more damaging than anything happening in Roon, and will be your main quality bottleneck.

(Before you ask: no, it’s not possible to send 48k to the AppleTV to skip this step…the AirPlay protocol is pegged at 44.1k. We’ve tried…)

Finally: in general, we don’t advocate for pre-processing audio offline. The best thing to archive is the original files that you got from the source, not a derivative. Quite a lot of very high quality DSP is pracitcal in real-time on modern computers, and functionality/technology is moving forward in this area on an ongoing basis, both within Roon and in the world at large. If you resolve to use real-time DSP, you will always be in a position to send your source files through newer/better stuff as it is made available, and you will avoid all of the bookkeeping, storage requirements, and hassle associated with pre-processing files repeatedly as the world changes.

Makes sense.

Also, I knew ATV outputs 48khz, but I had no idea AirPlay was limited to 44.1…that seems, well…stupid.

[quote="brian, post:5, topic:7943, full:true"]

Our 96/192/48->44.1k resampling process is not as good as SOX VHQ Linear Phase. The one we use for integer ratio conversions is at least on par. We are working on replacing our sample rate converters with something that should be an improvement over sox (we will use a similar implementation technique to sox, but with filter designs tailored for playback applications). That should close or exceed any gaps.
[/quote]
Are there any successes in your work now?

Yeah, we replaced everything with modern, state of the art polyphase converters back in February, then did further iteration/improvement a couple of months later that added more filters/options.