Another way of playing Apple Music in Roon

Build your own app. :wink:

Selecting the Roon Zone generates a FLAC radio stream that autoplays on the selected zone in Roon – no further action required (communication via a small extension). Fixed clock @ 96 kHz plays uninterrupted – auto clock follows the correct sample rate, but leaves a small gap at rate changes as it needs to tear down/restart the stream. Best I can do with Roon ATM.

Now superseded by using audioinput extension in Roon:

Small peek at Basso: a nice little Apple Music player (macOS, iOS, iPadOS, tvOS, watchOS – for me only, so far ;-)), playing Apple Music bit-perfect to cloud controlled zones (a la Connect): anything Apple, Sonos (via official Control API), UPnP (HQ Player, KEF LS60, Meridian Ellipse & Naim Mu-so) and Roon (via radio).

13 Likes

Using the Basso infrastructure, here’s Apple Music playing directly into Roon – bit perfect and rate switching:

Could work with any source, theoretically. Apple Music today – Spotify tomorrow.

4 Likes

There we go:

2 Likes

Congrats for the effort and the promising results obtained.

Can you share some info about Bass app? If i understand correctly the app runs, say, on iPad acting as an Apple Music client (like Lysoniq, for example) and streams the audio to Roon Server which, in turns, sends the audio flow to a chosen Audio Zone/End Point.

Does the Room app need to be open or can Bass app communicate with Roon running in background?

What about availability and pricing?

For now, there’s the Basso part (the app: Mac, iPhone, iPad, Apple TV, Watch) leveraging the Apple Music library via MusicKit) and Continuo (the bridge, receiving audio from the Apple Music app, Roon or Spotify and distributing to UPnP, Roon and HQPlayer). Library and zones are cloud managed, so they’re available everywhere (think Connect for anything Apple, Sonos or UPnP – as well as Roon (all zones) and HQPlayer) – playback logic is local to the device.

I started the project wanting to use the Apple Music catalog, but disliking the apps and the fact that lossless/hi-res playback is near impossible. I ended up my building the ideal music app – for me, with hi-res playback anywhere. The tie-ins with Roon and Spotify are just fun for now (though Apple Music playback via Roon using MUSE has its charms). Basso talks directly to Roon Server via an extension.

Basso has all of the library functionality from Apple, but also lets you import your listening history from Apple or Spotify (maybe even Roon in the future). That allows for all kinds of recommendation and filtering options. It leverages AI to gather metadata from multiple sources (Discogs, MusicBrainz, LastFM, WikiData, Wikipedia, Apple, etc.) to create a super set for display and writes liner notes and artist bios based on that.

There’s a personalized New Music Friday guide (based on library and listening history), a monthly listening review and of course a yearly wrapped. There’s Journeys (started from an album, finds related albums), Threads (recommendations based on recent listening) and a Librarian able to answer questions inside and outside your library. To top it off, there’s a full fledged MCP server, so your can command Basso via cloud from the LLM of your choice.

To be honest, I don’t know if I will ever be able to release this as is – the cloud infra and AI stuff is multi-tenant ready but carries costs. If I were to develop this towards release, I would need to quit my day job, I’m afraid…

3 Likes

It carries far more features than I thought. Definitely an ambitious project.

As you probably got from my reply I was mainly interested in the Apple Music → Roon relationship – the one you define “for fun” yet charming.

I guess many would appreciate a stripped down version offering Apple Music audio stream reaching a Roon compatible end point without the cloud/AI bells and whistles.

Let’s see if anyone else will chime in sharing my thoughts. If the demand for it would be high enough and technically doable maybe you could consider to release something “for the masses”.

Anyway, congratulations again for the project.

The shortest route would be to isolate the bridge and remove the unnecessary stuff. This would give you a bit-perfect audio pipeline for Apple Music (macOS) to play into, redirected to Roon via an audioinput extension for playback:

You could turn the bridge on/off and select a Roon zone in a little menu bar app. The audioinput extension in Roon is present in the official API, but undocumented – I’d have to check with Roon if it is OK to distribute.

1 Like

That would work only on desktop, I suppose, because all the components required should run on the same machine.

Ideally, I guess, many users would find very tempting to leverage the Mac as a “Roon audio router” fed by a MusicKit-powered client (from an iPad/iPhone) in order to have the convenience of controlling the playback from the listening seat.

1 Like

Yeah – that’s what I built Basso for… :stuck_out_tongue:

MusicKit on the Mac is a no-go, as it is limited to AAC256. From iOS, you could send an AirPlay stream to the Mac, but that would limit you to 44.1/16 – probably lossy as well.

Lysoniq was built for this: controlling Apple Music playback on any other Apple device remotely. Their latest Mac app takes the same approach as Basso: MusicKit for the interface, using the Music app for playback. Combined with the bridge approach outlined above, that would give you what you want: Apple Music controlled remotely, bit-perfect output, playback via Roon.

For now, I threw a line out to Roon to check the temperature.

1 Like

Oh, I didn’t know MusicKit is limited to AAC on Mac. One of those non-sense things that Apple sometimes does.

Yes, I’m familiar with Lysoniq. It partially solves the Apple Music/convenience “audiophile” needs. By the way, there’s another app named Bit Perfect that works on the same principle.

Thanks for approaching Roon regarding the experimentation of the audioinput extension related to third party (Apple Music) audio flows.

Checked with Roon: the audioinput is part of the official API (node-roon-api-audioinput), and free to use as outlined above.

I’ve got most components already built:

  • CoreAudio HAL driver for receiving Music app’s output
  • Clocking Bridge for streaming sliced audio over HTTP
  • Roon extension (Swift) for enabling audioinput, accepting the stream and communicate with the bridge (zone selection, track controls)

I just need to wrap them up in a little menu bar app with a zone picker and on/off switch. I’ll see what I can do next weekend. :slight_smile:

3 Likes

Really really good work here :+1:

Tell me about it, thankfully my employer is terrible at planning jobs and I get plenty of time at work to develop my stuff. Lucky indeed I am.

Really impressive stuff @RBM

The duck approves :duck:

Good to hear that it’s a viable option! Not only technically, even legally (terms of use).

Really curious to see the outcome. Thank you, René, appreciated.

Sneak preview: Roon zone selection and volume control in macOS menubar:

Playback as continuous stream working. Now starting on stream-per-track, so track timings are in sync and the clock follows the sample rate of the playing track:

2 Likes

Getting there… Per track and hi-res autoswitching:

2 Likes

Almost done. Beta-release via GitHub this weekend.

As Apple Music is inconsistent in reporting its queue, I chose a middle road as to enable gapless play:

  • Continuous stream as long as sample rate stays the same (albums play lossless)
  • New stream at sample rate changes to allow for lossless playback (switches inaudibly between tracks)

Roon audio input has a neat mechanism for pre-queueing the next track to make gapless track changes. I have this in place for Basso (a bit easier, since I own the queue).

The app is called Arco. It lives in your menu bar, where you can enable/disable the stream to Roon. It auto selects correct the audio output and auto senses between Apple Music and Spotify (last play wins). It also hosts the Roon extension needed for communication, metadata exchange, track controls and enabling the audio input.

Packaging and Apple notarization all done. It’s a packaged installer (needed to install the CoreAudio HAL driver), but I’ll publish the full source to GitHub.

5 Likes

I’ll try the beta of Arco this weekend. Thank you.

Thinking about moving out the Spotify stuff to a Raspberry Pi:

A simple Pi, Spotify Soloist + Pipewire and the Node extension for Roon make for a nice scenario:

  • The Soloist instance is a fully featured Spotify Connect endpoint
  • Playing to the Soloist Pi autostarts a (lossless and gapless) stream to the Roon zone selected in the extension
  • Metadata, album art, track controls all carry over to Roon.
1 Like

OK: first public release:

Download, install, grant the required permissions, enable extension in Roon.

Start from the menubar menu, pick a Roon zone, play something in Apple Music and watch the magic happen. :wink:

Consider this in beta for now – I’ll do a proper post sometime this weekend if it all holds up. Enjoy. :slight_smile:

3 Likes

Thank you for the very fast release.

Mac mini 2018 (Intel) here. It works, except the sample rate is fixed.

If I play, say, a 44.1 kHz track followed by a 96 kHz one (mixed playlist), it keeps 44.1 kHz. Basically I have to switch manually in Audio MIDI Setup the sample rate matching.

Does it change automatically on your side with Apple Silicon?