# Forking with SDL\_mixer

**URL:** <https://discourse.libsdl.org/t/forking-with-sdl-mixer/14284>\
**Category:** SDL Development\
**Created:** [February 7, 2007, 6:47am UTC](https://discourse.libsdl.org/t/forking-with-sdl-mixer/14284 "2007-02-07T06:47:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_Fink](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/steve_fink/32/648_2.png) [@Steve\_Fink](https://discourse.libsdl.org/u/Steve_Fink)\
**Post date:** [February 7, 2007, 6:47am UTC](https://discourse.libsdl.org/t/forking-with-sdl-mixer/14284/1 "2007-02-07T06:47:32Z")

</div>

I have an application that starts up SDL with audio and video  
(SDL\_INIT\_VIDEO | SDL\_INIT\_AUDIO). Much later, I want to fork off a process.  
That process does not need (or want) access to any of the audio or video  
stuff. In fact, I’d really like to have it shut down any connection it has  
to audio or video, so that it can’t hang on to a file descriptor or  
something and mess up anything else. (It’s basically meant to be a daemon  
process that inherits a lot of data from the parent, so doing an exec is a  
pain because I have to recover a lot of state.)

I tried doing an SDL\_QuitSubsystem(SDL\_INIT\_AUDIO) to accomplish this, at  
least for the audio portion, but that resulted in a hang on shutdown – I  
think the parent’s shutdown. The stack trace showed alsa waiting for audio  
to complete.

Is there a way to do this?
