Snakeoil Forums

Full Version: How to upgrade to low latency kernel on Pi OS(Debian bookworm)?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How to upgrade to low latency kernel on Pi OS(Debian bookworm) for snake oil?
There is no low latency kernel.  There may be a real time kernel coming in the next release.  

If you cannot wait, you can build one yourself following my process
https://www.snakeoil-os.net/forums/Threa...98#pid6998
(21-Jan-2024, 12:45 PM)clark8888 Wrote: [ -> ]How to upgrade to low latency kernel on Pi OS(Debian bookworm) for snake oil?

Even replaced with lowlatency or even real time kernel, the clock on Pi's motherboard (oscillator) is too lousy.  And there is not hpet in Pi.  Apart from the convenience, I'm afraid that Pi can't produce very good music quality.
(21-Jan-2024, 06:25 PM)hkphantomgtr Wrote: [ -> ]
(21-Jan-2024, 12:45 PM)clark8888 Wrote: [ -> ]How to upgrade to low latency kernel on Pi OS(Debian bookworm) for snake oil?

Even replaced with lowlatency or even real time kernel, the clock on Pi's motherboard (oscillator) is too lousy.  And there is not hpet in Pi.  Apart from the convenience, I'm afraid that Pi can't produce very good music quality.

asynchronous usb can use DAC's deluxe oscillator instead of Pi's poor one, don't worry

(21-Jan-2024, 03:57 PM)Snoopy8 Wrote: [ -> ]There is no low latency kernel.  There may be a real time kernel coming in the next release.  

If you cannot wait, you can build one yourself following my process
https://www.snakeoil-os.net/forums/Threa...98#pid6998

Thanks! If installing Ubuntu server on Pi, can "sudo apt install linux-lowlatency" work?
(22-Jan-2024, 07:51 AM)clark8888 Wrote: [ -> ]
(21-Jan-2024, 06:25 PM)hkphantomgtr Wrote: [ -> ]
(21-Jan-2024, 12:45 PM)clark8888 Wrote: [ -> ]How to upgrade to low latency kernel on Pi OS(Debian bookworm) for snake oil?

Even replaced with lowlatency or even real time kernel, the clock on Pi's motherboard (oscillator) is too lousy.  And there is not hpet in Pi.  Apart from the convenience, I'm afraid that Pi can't produce very good music quality.

asynchronous usb can use DAC's deluxe oscillator instead of Pi's poor one, don't worry

(21-Jan-2024, 03:57 PM)Snoopy8 Wrote: [ -> ]There is no low latency kernel.  There may be a real time kernel coming in the next release.  

If you cannot wait, you can build one yourself following my process
https://www.snakeoil-os.net/forums/Threa...98#pid6998

Thanks! If installing Ubuntu server on Pi, can "sudo apt install linux-lowlatency" work?

Maybe you need some more time and tests to see what I mean.  Moreover, there is no hpet, not even TSC clocksource in pi.  That also significantly affects the sound quality.  Unless you've already brought the Pi, just don't buy it for cas.

Btw, you can install lowlaterncy kernel, and even real time kernel in Ubuntu server.  But after reboot, only the stock kernel is used by pi.   If you've digged a bit more in recent post (Last December), you'll find another webmate found a way to get Pi to boot with these kernels by renaming them, yet I can't make it.  And in another web it provides a ready made real-time kernel Ubuntu Server 22.04LTS.  I've used it and mentioned in the same thread, too.
(21-Jan-2024, 06:25 PM)hkphantomgtr Wrote: [ -> ]Apart from the convenience, I'm afraid that Pi can't produce very good music quality.

That is a very bold claim!

It is not easy to tell the difference between my Pi4 (Mercury V2 Streamer) with a real time time kernel and my NUC with the Ubuntu real time kernel. Maybe the NUC is slightly ahead.  Both are using the same linear power supply, CPUset and convolution DSP.  

In my setup, the Pi 4 CAN produce very good music quality!
(22-Jan-2024, 12:55 PM)Snoopy8 Wrote: [ -> ]That is a very bold claim!

It is not easy to tell the difference between my Pi4 (Mercury V2 Streamer) with a real time time kernel and my NUC with the Ubuntu real time kernel. Maybe the NUC is slightly ahead.  Both are using the same linear power supply, CPUset and convolution DSP.  

In my setup, the Pi 4 CAN produce very good music quality!
I think your Mercury V2 is CM4 based? CM4 (and hopefully future CM5) based boards are slightly different. I'm thinking/hoping this player of yours has a crystal (usually encased in a metal can) on a board somewhere. Some even have 2..

You kind of need that to generate a regular tick so that the Pi can be slaved to it (Master clock). Without that, the tick will be generated by some chip or via software (there's also a tickless mode) I actually forgot which is better now. :/ Problem with using software to keep time is the time can "drift" when the CPU is busy. That drift back and forth is considered jitter and may "smear" audio, in the sense you seem to lose a tiny bit of that pin point precision (Just a guess as I can't really confirm this).

Pi on it's own do not have a crystal. But I'm almost certain you can provide a different (hopefully better) clocksource for the Pi (via one of the GPIO).. However I'm no longer in the DIY scene so havn't really keep myself up to that. It's just easier with CM4 as you plug the CM4 daughterboard onto some main board, which should have all the components required for a good audio system.

Pi unit on it's own will not be a high end player. But if using it for ambient background music for work, etc? it'll still be good.. It's like using BT wireless headphones, all those AptX and so on, they all sound terrible. But we still use wireless because it's convenient. Tongue
(26-Jan-2024, 10:25 AM)agent_kith Wrote: [ -> ]
(22-Jan-2024, 12:55 PM)Snoopy8 Wrote: [ -> ]That is a very bold claim!

It is not easy to tell the difference between my Pi4 (Mercury V2 Streamer) with a real time time kernel and my NUC with the Ubuntu real time kernel. Maybe the NUC is slightly ahead.  Both are using the same linear power supply, CPUset and convolution DSP.  

In my setup, the Pi 4 CAN produce very good music quality!
I think your Mercury V2 is CM4 based? CM4 (and hopefully future CM5) based boards are slightly different. I'm thinking/hoping this player of yours has a crystal (usually encased in a metal can) on a board somewhere. Some even have 2..

You kind of need that to generate a regular tick so that the Pi can be slaved to it (Master clock). Without that, the tick will be generated by some chip or via software (there's also a tickless mode) I actually forgot which is better now. :/ Problem with using software to keep time is the time can "drift" when the CPU is busy. That drift back and forth is considered jitter and may "smear" audio, in the sense you seem to lose a tiny bit of that pin point precision (Just a guess as I can't really confirm this).

Pi on it's own do not have a crystal. But I'm almost certain you can provide a different (hopefully better) clocksource for the Pi (via one of the GPIO).. However I'm no longer in the DIY scene so havn't really keep myself up to that. It's just easier with CM4 as you plug the CM4 daughterboard onto some main board, which should have all the components required for a good audio system.

Pi unit on it's own will not be a high end player. But if using it for ambient background music for work, etc? it'll still be good.. It's like using BT wireless headphones, all those AptX and so on, they all sound terrible. But we still use wireless because it's convenient. Tongue

I'm sure it's not the only board for the RPi that has this, but my Allo Digione Signature has its own clock, so it doesn't rely on the RPi's.
Plenty of add-on devices that slave the Pi to their clock..Allo, HiFiBerry et al.
Pi 4 and above have more than enough resources for good audio.
Though somehow a modest X86/amd64 device (NUC, Thin-client etc) have the better resolution for me.
I found this in web for more reference clocksource « Remi Bergsma's blog.  Of course that's totally out of my knowledge.
Pages: 1 2