mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-24 18:45:38 -10:00
A driver audio_driver_stop() has stopped - the audio toggle, a window size/move, CoreAudio's interruption - drains nothing, so a blocking write to it never returns; a core that emits audio from retro_serialize() or retro_unload_game() past that point hangs the frontend there. The threaded commit already lets go on a stopped driver; the direct path's core entries now gate on the same flag, and a driver that comes up running is marked started at init. samples/audio/stopped_submit drives the int16, float and per-sample entries through a device that records its running state at each write, on the direct pipeline with audio sync on.
94 lines
3.0 KiB
Makefile
94 lines
3.0 KiB
Makefile
# Core audio submitted while the driver is stopped is dropped on the
|
|
# direct path, never written to a device nothing drains; it flows again
|
|
# after audio_driver_start(). On the shipping audio/audio_driver.c.
|
|
include ../../sample_objdir.mk
|
|
|
|
compiler := gcc
|
|
TARGET := stopped_submit_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 := \
|
|
stopped_submit_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)
|
|
|
|
stopped_submit_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
|