Native FLAC via iRadio?

Having some more time to answer. :slight_smile:

Taking into account the hardware specs of the Gen 1 systems (internal buffer size), it gets tricky to guarantee continuous playing for HD streams. This is Naim’s main official statement on this.

But… This doesn’t mean it “cannot” work, and this is what I wanted to prove. Naim never contradicted this.

I’ve a decent system where I can hear the difference amongst a MP3 (lossless) and FLAC/WAV (lossy) format. As I’m very happy with the ND5XS as a streaming device, feeding the digital out in an external DAC, I don’t mind the message from Naim I should buy a Gen 2 to be able to stream hi-res (see also my remarks on this above).

For me this started as a challenge. From a professional point of view, I do run a team of Application Development specialists for Western Europe, but we’ve never been into streaming. Besides my job of running the team, I’m still heavily in love with the technology. So, on the go, I figured out that 1) I should write something in Java, so I could deploy it everywhere and in the kitchen sink and 2) this had to be low level , as I wanted to scale this for multiple connections and multiple radio stations.

I actually shall never forget the moment, after zillions of debugging sessions, in the middle of the night, that suddenly my ND5XS started playing the bit streams I decomposed, transformed, copied and synced amongst memory buffers during some nights. At that moment there was only Naim Jazz, as this is what I wanted to achieve. Later on I added support for multiple radio stations as well as different decoding scripts (16 bit/24 bit).

For me it’s still fun to see people across the globe using this. I never wanted to make money out of it, hence I also post all source code on a public GitHub on a regular basis. As I don’t earn a 1c€ on it, I don’t invest a 1c€ either. This is running on an Oracle Free Tier instance, both in Frankfurt (EU) and Phoenix (US) on an Ubuntu OS.

Kurt

7 Likes

You explain that very well, and I understand the delight that writing code can do, especially when it has such a positive effect. I used to write PowerShell scripts that would go around a network and fix multiple PC issues automatically. I loved seeing the improvement the following day, and the delight that it was fixing things 24x7. You must have that same feeling knowing people around the world are gaining extra benefit from their older devices, and putting smiles on faces.

2 Likes

Hi All,

A small update on the evolution of this tiny project.

Version 5.7.x is/was the most stable version based on the initial architecture (version is displayed as part of the streaming info). Actually, version 5.0 was the 1st version being able to support whatever hi-res radio station. As a Jazz lover, earlier versions were based on the initial idea to support just “Naim Jazz”, causing some limitations when taking it on a larger scale. Evolutions from 5.0 > 5.7 were mostly cosmetic. The core “sound engine” was still the same as from (more or less) day 1.

The initial architecture relies on reading chunks of data from the steam, and when a threshold of bytes is read (32 kB), sending it to the device. This is called “single buffering”, and works actually pretty good. Naim never confirmed the expected/desired chunk size, hence I’ve this as a configurable parameter. I tested with smaller and larger chunk sizes, but this goes beyond this thread. Drop me a mail if you want to know more.

This is fine, till the moment you come across the situation where you need new input from the stream (end of 32kB block), and the stream isn’t there at that exact same moment. This is rather seldom, but it happens… 3 options here:

  1. The stream comes back before the current stream buffer is played/ended. No issue, as the buffer get filled faster as the stream plays
  2. Option 1 fails, but the stream comes back before a drop from the device. Here you hear a hick-up
  3. Options 1 and 2 fail. In this case, the Naim mostly drops the connection causing a “stop”. Other devices (SONOS for example) still do a retry in this situation

In the version 6.x of FWP, I’ve implemented a better solution, known as “double buffering”. In this version the software “tries” to read 4x more (configurable) input, while still sending the same (32 kB, configurable) buffer to the streamer. So, this means FWP tries to read 128 kB of data while sending 32 kB to the streamer.

Simply said, in the current config: FPW sends 32 kB chunks to the Naim. The moment the Naim processes this, FWP tries to read 128 kB of data (4 x 32 kB) ahead. This should reduce interruptions when data is not there the moment the Naim expects it. It’s not 100% perfect. If the stream is not there when it’s needed, there’s little you can do about it, besides relying on the buffer and crossing fingers the connection is back before the buffer gets empty. However, there are also moments the stream provides more than you need. This data now gets buffered to rescue the moments the data is not there. Euh… You know what I mean? :slight_smile:

Enjoy it (as much I enjoyed it to program it) :slight_smile:

2 Likes

I’ve been running your RP FLAC for a few weeks on my Muso as background music during the work day and haven’t noticed any buffering or dropouts. Current version is 6.2.240821.

1 Like

As a reminder, you can find the hosted stations via http://129.146.133.23:9001/fwp/stations

When I find a new FLAC station, I add it to the list. Feel free to let me know if you’ve one not in the list today. When it’s not playing, it’s (most likely) not my fault. Some stations (XRADIO for example) are just not reliable.

There’re also a couple of MP3 conversions in the list. That’s for the outdoor speaker and when my wife listens to music when she cycling. :slight_smile:

1 Like

The only one that comes to mind is JB Radio 2. They had a great hires stream for a long time but it went silent some months back. It sounds like they’re getting things going again so it’s one to keep an eye on.

I just added JB Radio 2. Seems to work now. Enjoy!

image

2 Likes

Thanks! I’ll get that one added.

Good news for the lovers of JB Radio 2. As JB Radio 2 changes their URL from time to time, the station is often off-line. This morning, I found a new (undocumented) link, and updated FWP. So, no you can listen JB Radio 2 (again) in 16bit 48kHz. Enjoy!

It’s working here in the states. Thanks, Kurt.

1 Like

Kurt,
you are a genius, now my 272 has a new potential … I listen to IRadio a lot …
one thing I wanted to ask you, in the visualization of the station the artist and the title of the song does not appear as for the standard stations … it is a useful thing to remember down any interesting artists.

I found a JB Radio 2 flac stream on hi res audio and I can get it to work in my browser but it doesn’t respond when I add it to my playlist (M3U file). Weird, I’d like to get it in my playlist if I can.

Try this one? https://maggie.torontocast.com:8076/flac

that’s the one I’m using, doesn’t work in my playlist for some reason.

Sure you typed https and not http? Plain http doesn’t work here.

Yeah, I tried both ways, works fine in the browser and your station works too. Just not through the m3u list. Weird.

my current playlist.

Thanks :slight_smile:
Metadata in an OggFlac is a challenge as:

  1. Not all stations send metadata about the track. For example, Naim Jazz doesn’t, Radio Paradise does.
  2. I rely on FFmpeg to do the conversion from OggFlac to WAV. So, this is something handled by FFmpeg.
  3. WAV was never designed to support a rich set of metadata.

I’ll have a look into it.

thanks Kurt, is clear.

I can’t get the new JB Radio 2 stream to work through a playlist and I see others having problems getting it to work through their tuners but it still works through Kurt’s added station. Not sure what’s going on.