Files
RetroArch/samples/audio/menu_callback_feed/Makefile
LibretroAdmin b28b8a4b9f audio: menu silence behind a callback core writes only what fits
A core with an audio callback runs behind the threaded wrapper, which
keeps the device blocking whatever the menu asks. At Menu Frame Rate
'Display Rate' the menu feeds silence by the clock, so it now writes
only what the device takes without waiting, keeping half its buffer,
and does not make up time the device could not take. The recording
still receives every frame. The menu runs at the display's rate behind
such cores again.

samples/audio/menu_callback_feed holds the feed against a device that
counts every write that would have blocked.

Fixes #19971
2026-11-01 22:33:01 +01:00

94 lines
3.0 KiB
Makefile

# The menu's silence feed at 'Display Rate' behind a callback core: the
# threaded wrapper keeps the device blocking, so the feed must write only
# what the device takes now. On the shipping audio/audio_driver.c.
include ../../sample_objdir.mk
compiler := gcc
TARGET := menu_callback_feed_test
CORE_DIR = ../../..
LIBRETRO_COMM_DIR = $(CORE_DIR)/libretro-common
INCDIRS := -I$(LIBRETRO_COMM_DIR)/include -I$(CORE_DIR) \
-I$(CORE_DIR)/deps -I$(CORE_DIR)/deps/stb
CC := $(compiler)
flags += -std=gnu99 -g1
SOURCES_C := \
menu_callback_feed_test.c \
../../../audio/audio_upmix.c \
../../../audio/audio_stretch.c \
../../../audio/audio_pipeline_stretch.c \
../../../audio/audio_speed_lpf.c \
../../../audio/audio_binaural.c \
stubs_retroarch.c \
$(LIBRETRO_COMM_DIR)/lists/string_list.c \
$(LIBRETRO_COMM_DIR)/lists/dir_list.c \
$(LIBRETRO_COMM_DIR)/file/file_path.c \
$(LIBRETRO_COMM_DIR)/file/retro_dirent.c \
$(LIBRETRO_COMM_DIR)/streams/file_stream.c \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c \
$(LIBRETRO_COMM_DIR)/rthreads/rthreads.c \
$(LIBRETRO_COMM_DIR)/rthreads/retro_eventcount.c \
$(LIBRETRO_COMM_DIR)/queues/retro_spsc.c \
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
$(LIBRETRO_COMM_DIR)/memmap/memalign.c \
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
$(LIBRETRO_COMM_DIR)/string/rstrtod.c \
$(LIBRETRO_COMM_DIR)/time/rtime.c \
$(LIBRETRO_COMM_DIR)/file/file_path_io.c \
$(LIBRETRO_COMM_DIR)/file/config_file.c \
$(LIBRETRO_COMM_DIR)/file/config_file_userdata.c \
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.c \
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strldup.c \
$(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c
CFLAGS += -Wall $(INCDIRS)
CFLAGS += -DRARCH_INTERNAL -DHAVE_THREADS -DHAVE_AUDIOMIXER -DHAVE_MENU \
-DHAVE_CONFIGFILE -D_GNU_SOURCE
LDFLAGS += -lm -lpthread
ifneq ($(SAN),)
SANITIZER := $(SAN)
endif
ifneq ($(SANITIZER),)
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer -g1 $(CFLAGS)
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
endif
OBJS := $(call sample_objs,$(SOURCES_C:.c=.o))
all: $(TARGET)
menu_callback_feed_test.o: ../../../audio/audio_driver.c
stubs_retroarch.o: ../pipeline_clocked/stubs_retroarch.c
%.o: %.c
$(CC) $(INCDIRS) $(CFLAGS) $(flags) -c -o$@ $<
$(SAMPLE_OBJDIR)/%.o: $$(call sample_src,$$*).c
@mkdir -p $(@D)
$(CC) $(INCDIRS) $(CFLAGS) $(flags) -c -o$@ $<
$(TARGET): $(OBJS)
$(CC) -o$@ $(OBJS) $(LDFLAGS)
check: $(TARGET)
./$(TARGET)
clean:
rm -rf $(SAMPLE_OBJDIR)
rm -f $(OBJS)
rm -f $(TARGET)
.PHONY: clean all check