Re: [linux-audio-dev] Daemon mode

From: Lars Luthman <lars.luthman@email-addr-hidden>
Date: Sat Dec 16 2006 - 16:00:14 EET

On Sat, 2006-12-16 at 20:48 +0700, Patrick Shirkey wrote:
> Thanks for the pointer Lars.
>
> However I'm using c so this code doesn't work. I have modified it like so:
>
> int run = TRUE;
>
> while (run)
> sleep(10000);
>
> but that just gives a segv. It runs for about a second then gives up.
>
> I'm also looking at the code for jackd and have spotted this function:
>
> sigwait (&signals, &sig);
>
>
> so I added some new bits and pieces like so:
>
> static sigset_t signals;
>
> int main(int argc, char *argv[])
> {
>
> int run;
> int sig;
> sigset_t allsignals;
>
> sigemptyset (&signals);
> sigaddset(&signals, SIGHUP);
> sigaddset(&signals, SIGINT);
> sigaddset(&signals, SIGQUIT);
> sigaddset(&signals, SIGPIPE);
> sigaddset(&signals, SIGTERM);
> sigfillset (&allsignals);
>
>
> process_init();
>
> run = TRUE;
>
> while (run)
> sigwait (&signals, &sig);
>
> return 0;
>
> }
>
>
> but that also returns segv at sigwait(). If I put a printf after sigwait
> it doesn't print. Before is ok.

That code compiles and runs fine here (after adding #include <signal.h>
and commenting out process_init()). The problem is probably somewhere
else in your code. I'd try running it in valgrind to spot any memory
bugs (with JACK in softmode and using the dummy driver).

-- 
Lars Luthman - please encrypt any email sent to me if possible
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x04C77E2E
Fingerprint: FCA7 C790 19B9 322D EB7A E1B3 4371 4650 04C7 7E2E

Received on Sat Dec 16 16:15:04 2006

This archive was generated by hypermail 2.1.8 : Sat Dec 16 2006 - 16:15:04 EET