dirkwhoffmann / vAmiga

vAmiga is a user-friendly Amiga 500, 1000, 2000 emulator for macOS

Home Page:https://dirkwhoffmann.github.io/vAmiga

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Accelerate the audio backend if no sound is playing

dirkwhoffmann opened this issue · comments

Idea: The following condition should reliably detect whether sound is playing:

no_sound =
paula.muxer.sampler[0].count() == 1 &&
paula.muxer.sampler[1].count() == 1 &&
paula.muxer.sampler[2].count() == 1 &&
paula.muxer.sampler[3].count() == 1

Proposal:

  1. If no sound is playing, skip the sample synthesis part and prolong the sample buffer with the last written value (don't write zeroes!).

  2. Do the same in warp mode. In this case, filling in zeroes is OK as the volume gets faded to 0 when warp mode activates.

The audio fast path works as expected. However, the speed gain is minimal. The emulator only runs about 0.5 MHz faster in warp mode on the MacBook Pro (Kick 1.3, hand&disk symbol showing).