mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-10-02 23:55:22 -04:00
3659252a88
The sbc/portmaster launcher exports POKEPORT_AUDIO_RATE=22050 and docs/linux-arm-sbc.md describes it as halving synthesis CPU on Cortex-A53 handhelds, but nothing in the engine read it: ChipSynth always rendered at 44100 Hz, and snapTicks baked that rate in as the integer rational 1470/512 (so once the rate does change, music plays at half tempo/pitch unless snapTicks follows). Read the env var at module load (validated to 8000-48000, 44100 fallback) and make snapTicks rate-aware. At 44100 the new form is arithmetically identical to the old one ((ticks*44100 + 7680)/15360 == (ticks*1470 + 256)/512), so desktop behavior is unchanged. Tested on an RG351MP (RK3326, dArkOS): correct music tempo and pitch at 22050 Hz, halved synthesis work on the audio worker.