You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
AudioFlinger: re-add viper optimizations
These make a notable difference when playing audio on ESP32. Without them, each UI action causes a stutter, so it's not fun to listen to audio while doing anything on the device. With them, most UI actions don't cause a stutter. Long maxed out CPU runs and storage access still do, though.
This commit is contained in:
@@ -101,12 +101,23 @@ if [ "$target" == "esp32" ]; then
|
||||
elif [ "$target" == "unix" -o "$target" == "macOS" ]; then
|
||||
manifest=$(readlink -f "$codebasedir"/manifests/manifest.py)
|
||||
frozenmanifest="FROZEN_MANIFEST=$manifest"
|
||||
|
||||
# Comment out @micropython.viper decorator for Unix/macOS builds
|
||||
# (cross-compiler doesn't support Viper native code emitter)
|
||||
echo "Temporarily commenting out @micropython.viper decorator for Unix/macOS build..."
|
||||
stream_wav_file="$codebasedir"/internal_filesystem/lib/mpos/audio/stream_wav.py
|
||||
sed -i 's/^@micropython\.viper$/#@micropython.viper/' "$stream_wav_file"
|
||||
|
||||
# LV_CFLAGS are passed to USER_C_MODULES
|
||||
# STRIP= makes it so that debug symbols are kept
|
||||
pushd "$codebasedir"/lvgl_micropython/
|
||||
# USER_C_MODULE doesn't seem to work properly so there are symlinks in lvgl_micropython/extmod/
|
||||
python3 make.py "$target" LV_CFLAGS="-g -O0 -ggdb -ljpeg" STRIP= DISPLAY=sdl_display INDEV=sdl_pointer INDEV=sdl_keyboard "$frozenmanifest"
|
||||
popd
|
||||
|
||||
# Restore @micropython.viper decorator after build
|
||||
echo "Restoring @micropython.viper decorator..."
|
||||
sed -i 's/^#@micropython\.viper$/@micropython.viper/' "$stream_wav_file"
|
||||
else
|
||||
echo "invalid target $target"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user