From ccd7fa8bd0f519d8ad05187c616dd7faa621e316 Mon Sep 17 00:00:00 2001 From: Paul Dino Jones Date: Tue, 11 Jun 2024 14:29:09 +0000 Subject: [PATCH] Fix some issues with pulseaudio not stopping properly. --- src/monocoque/devices/sounddevice.c | 3 ++- src/monocoque/monocoque.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/monocoque/devices/sounddevice.c b/src/monocoque/devices/sounddevice.c index 607623a..a00c39b 100644 --- a/src/monocoque/devices/sounddevice.c +++ b/src/monocoque/devices/sounddevice.c @@ -101,7 +101,8 @@ int sounddev_free(SimDevice* this) { SoundDevice* sounddevice = (void *) this->derived; - usb_generic_shaker_free(sounddevice); + //figure out why this is causing problems + //usb_generic_shaker_free(sounddevice); free(sounddevice); diff --git a/src/monocoque/monocoque.c b/src/monocoque/monocoque.c index 087ae5a..6735cb0 100644 --- a/src/monocoque/monocoque.c +++ b/src/monocoque/monocoque.c @@ -212,6 +212,7 @@ int main(int argc, char** argv) setupsound(); SimDevice* devices = malloc(numdevices * sizeof(SimDevice)); int initdevices = devinit(devices, configureddevices, ds, ms); + bool pulseaudio = false; if (p->program_action == A_PLAY) { @@ -223,6 +224,7 @@ int main(int argc, char** argv) //} #ifdef USE_PULSEAUDIO pa_threaded_mainloop_unlock(mainloop); + pulseaudio = true; #endif error = looper(devices, initdevices, p); @@ -241,6 +243,7 @@ int main(int argc, char** argv) #ifdef USE_PULSEAUDIO pa_threaded_mainloop_unlock(mainloop); + pulseaudio = true; #endif error = tester(devices, initdevices); @@ -262,6 +265,10 @@ int main(int argc, char** argv) devices[x].free(&devices[x]); } } + if(pulseaudio == true) + { + freesound(); + } i = 0; // improve the api around the config helper