ZRAM swap alternative

I’ve noticed that the buster image seems to have 100MiB swap enabled on /var/swap. I’m currently testing ZRAM from here https://www.novaspirit.com/2016/12/24/increasing-ram-raspberry-pi/

on my 1GiB pi4 it gives me an effective extra 1GiB ram. I’ve been testing with my usual snapshots and the computational overhead hasn’t had much effect.

Unfortunately it’s still not enough to load the Ivy Audio Piano in 162.

Does anyone know of a SFZ file that linuxsampler struggles to load in 1GiB that might load in 2?

Buy 2gb version, and problem will be solved immediately :slight_smile:

1 Like

Ha, which only works up to 4GiB. At some point it may becomes useful as there may be a soundfont that needs 5GiB. As it is, apart from the Ivy soundfont pretty much everything else fits in 1GB.

Well I see absolutely no point in NOT enabling zram on any linux kernel (especially on SSD systems), besides the potential processing power overhead… I mean, Android phones are all making use of it, so it’s gotta be worth the tradeoff.
That said, it’s not a magic bullet. It’s compression. I’m not entirely sure, but aren’t soundfonts usually in a format that’s already compressed? Lz4ing a compressed media format will make it larger, not smaller. (It has to do with advanced mathematical concepts like entropy, read up at https://en.wikipedia.org/wiki/Information_theory if interested.) You won’t be loading 5G of soundfonts into a 4G rPi with this.

1 Like

Not the raw wav ones :slight_smile:

edit: Although the Ivy one I suggested is flac so it’s a moot point.

How long would audio samples in a 5gB SF-2 be? Who would have time to hear them? :wink:

I rather think we’re talking about a set of samples rather than one. SFZ and SF2 use multiple samples at different pitches and different velocities.

It could be useful for really big FluidSynth (SF2) soundfonts. Linuxsampler implements a on-the-fly-read-from-disk algorithm, so you can use soundfonts much larger than your RAM. Obviously, you need a good SD.

For the rest of engines, i don’t see any benefit and CPU power is too precious for wasting it on compression when not really needed.

Anyway, a checkbox in the webconf is harmless :wink:


1 Like