logoalt Hacker News

gman83today at 8:01 AM1 replyview on HN

What's the advantage of using cpal over something like libmpv?


Replies

tsirytoday at 8:14 AM

they're at different layers. libmpv is a full media player: demuxing, decoding (via FFmpeg), DSP, output. cpal is just a thin cross-platform PCM sink on top of CoreAudio/ALSA/WASAPI/etc.

Rockbox already brings its own decoders (20+ codecs), its own DSP chain (crossfeed, EQ, replaygain, gapless), and its own mixer. I just need the host OS to accept PCM frames. cpal is the minimal portable shim for that; pulling in libmpv would mean discarding Rockbox's audio pipeline and replacing it with FFmpeg's, which would basically defeat the point of building on Rockbox firmware.