tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Pulseaudio



Hi,
  does anyone have pulseaudio working on NetBSD6.x (or any other NetBSD)?

If I run "pulseaudio --start --daemonize=no" then run "paplay soundfile" 
then I successfully get sound out of my machine but if I run
"pulseaudio --start --daemonize=yes"  (or just "pulseaudio --start" which 
is the same) then it gets stuck in the daemonize code and goes no 
further.

pulseaudio-2.1/src/daemon/main.c has this bit of code:

    if (conf->daemonize) {
#ifdef HAVE_FORK
        pid_t child;
#endif

        if (pa_stdio_acquire() < 0) {
            pa_log(_("Failed to acquire stdio."));
            goto finish;
        }

#ifdef HAVE_FORK
        if (pipe(daemon_pipe) < 0) {
            pa_log(_("pipe() failed: %s"), pa_cstrerror(errno));
            goto finish;
        }

        if ((child = fork()) < 0) {
            pa_log(_("fork() failed: %s"), pa_cstrerror(errno));
            pa_close_pipe(daemon_pipe);
            goto finish;
        }

        if (child != 0) {
            ssize_t n;
            /* Father */

            pa_assert_se(pa_close(daemon_pipe[1]) == 0);
            daemon_pipe[1] = -1;

            if ((n = pa_loop_read(daemon_pipe[0], &retval, 
sizeof(retval), NULL)) != sizeof(retval)) {

                if (n < 0)
                    pa_log(_("read() failed: %s"), pa_cstrerror(errno));

                retval = 1;
            }

            if (retval)
                pa_log(_("Daemon startup failed."));
            else
                pa_log_info(_("Daemon startup successful."));

            goto finish;
        }

        if (autospawn_fd >= 0) {
            /* The lock file is unlocked from the parent, so we need
             * to close it in the child */

            pa_autospawn_lock_release();
            pa_autospawn_lock_done(TRUE);

            autospawn_locked = FALSE;
            autospawn_fd = -1;
        }

        pa_assert_se(pa_close(daemon_pipe[0]) == 0);
        daemon_pipe[0] = -1;
#endif


As far as I can tell, after the fork the parent gets to the
pa_loop_read() but no further and the child gets to the 
pa_autospawn_lock_done(TRUE) but no further but I get lost in here with 
whats supposed to be happening with various pipe's and threads.

Any ideas?

cheers
mark


Home | Main Index | Thread Index | Old Index