Skip to content

audiomem mac ​

Keeps the memory rekordbox's audio works with in RAM, so playback doesn't click when the Mac runs short of memory.

Platformmac macOS only
GroupBrowsing and playing
Switchaudiomem=0 turns it off (restart rekordbox)

Why ​

rekordbox's audio runs in blocks of 128 samples: 2.9 ms each (at its default buffer size). A block that isn't ready in time is silence: a gap of 2.9 ms or more on every deck.

When other apps fill the memory, macOS compresses and swaps out what wasn't used for a few seconds, and rekordbox's audio then has to wait for it to come back: 1 to 10 ms for a page, a missed block. Measured on a 16 GB Mac with 6 to 8 GB in swap: 9 to 23 gaps a minute with one deck just playing, and more right after a deck load, which allocates and clears several hundred MB at once. Plain rekordbox has the same gaps. What the audio was waiting for:

  • rekordbox's FX history buffers (nine in ten gaps): 214 buffers of 3 MB that rekordbox writes all the time, whether an FX is on or not.
  • The playing deck's own audio: decoded into memory at the load, read minutes later.
  • Rarely used parts of rekordbox's program, now and then.

What it does ​

PartOptionWhat it does
FX buffersaudiomem_fxPins every FX history buffer that is being written (about 650 MB that rekordbox writes all the time anyway), so macOS can't take it away.
Deck audioaudiomem_decksFour times a second, brings back what the next audiomem_ahead seconds (20) of every loaded deck need; 4 s on a deck that isn't playing, so pressing play is clean too.
Programaudiomem_codeKeeps rekordbox's own code and data (90 MB) in memory.
Deck loadsaudiomem_lazyrekordbox clears the new track's buffers on the main thread at a load, freezing the window for 0.1 to 0.3 s. With this they come from the system already empty, and each page is first touched when its audio is written, off the main thread: about 0.04 s instead of 0.12 s per load.

Measured with 3 GB of other memory in use on top:

Gaps per minute, one deck playingGaps per deck loadLongest audio block
Every mod off321037 ms
All mods, audiomem off301421 ms
All mods, audiomem on (two runs)6 and 01 and 0.19 and 4 ms

When the log warns ​

When the log says audiomem: N GB of swap in use, close other apps before a set. A larger buffer size in rekordbox's audio settings (256 or 512 instead of 128) gives more margin too: four in five of the waits are shorter than 5.8 ms. The log also says, once a minute while it happens, how much deck audio had to be brought back.

What it can't do ​

  • A jump further than the 20 s ahead (a hot cue, needle search) can still meet audio that was swapped out.
  • Small, rarely used objects all over rekordbox's memory can still be away when needed.

Options ​

OptionDefaultWhat it does
audiomem10 switches the mod off (restart).
audiomem_ahead20Seconds of audio kept ready ahead of a playing deck.
audiomem_fx10 switches the FX buffer part off (restart).
audiomem_decks10 switches the deck audio part off (restart).
audiomem_code10 switches the program part off (restart).
audiomem_lazy10 switches the deck-load part off (restart).

Windows ​

macOS only for now. On Windows no dropout was found in any run, plain or with the mods: 42 recorded deck loads next to a playing deck. Windows' shared audio there has a 10 ms period, which absorbs a 5 ms hold-up.

Performance and dropouts · Loading a track · betterfx

platendoos is an unofficial hobby project, not made by or affiliated with AlphaTheta / Pioneer DJ or Spotify. Licensed under CC BY-NC-SA 4.0.