Frequently Asked Questions

  1. How does Polypaudio compare with ESOUND/aRts/NAS?

    Polypaudio is sound daemon similar to ESOUND and NAS, but much more powerful. aRts is a realtime-synthesizer-cum-sound-server, i.e. it does much more than Polypaudio. However, I believe that Polypaudio does what it does much better than any other free sound server.

  2. What about ESOUND compatibility?

    Polypaudio is a drop in replacement for ESOUND. That means: you can load a esound compatibility module which implements an ESOUND compatible protocol which allows you to use most of the classic ESOUND compatible programs (including the command line programs like esdcat).

  3. Is Polypaudio a GNOME program?

    No, Polypaudio has no dependency on GNOME/GTK/GLIB. All it requires is a UNIX-like operating system and very few dependency libraries. However, the accompanying GUI tools are writen with gtkmm, i.e. require both GLIB and GTK.

  4. Can I integrate Polypaudio in my GLIB/GTK/GNOME application?

    Yes! Polypaudio comes with a GLIB main loop adapter. You can embed both the client library and the daemon (!) into your GLIB based application.

  5. Can I integrate Polypaudio in my Qt/KDE application?

    Yes! Polypaudio uses a main loop abstraction layer that allows you to integrate Polypaudio in any program that supports main loops. Unfortunately there is no adapter for Qt publicly available yet.

  6. I want to write a new driver for Polypaudio, are there any docs?

    Currently, only the client API is documented with doxygen. Read the source and base your work on a simple module like module-pipe-sink.

  7. What about compatibility with NAS?

    Is not available (yet?). It is doable, but noone has implemented it yet.

  8. What about compatibility with aRts?

    Is not available. Since aRts is as synthesizer application you'd have to reimplement very much code for Polypaudio. It should be easy to implement limited support for libartsc based applications. Noone has done this yet. It is probably a better idea to run arts on top of Polypaudio (through a polypaudio driver for aRts, which nobody has written yet). Another solution would be to embed Polypaudio in the aRts process.

  9. I often hear noises when playing back with Polypaudio, what can I do?

    There are to possible solutions: run polypaudio with argument --high-priority=1 and make yourself member of the group realtime, or increase the fragment sizes of the audio drivers. The former will allow Polypaudio to activate SCHED_FIFO high priority scheduling (root rights are dropped immediately after this) Keep in mind that this is a potential security hole!

  10. The polypaudio executable is installed SUID root by default. Why this? Isn't this a potential security hole?

    Polypaudio activates SCHED_FIFO scheduling if the user passes --high-priority=1. This will only succeed when executed as root, therefore the binary is marked SUID root by default. Yes, this is a potential security hole. However, polypaudio tries its best to minimize the security threat: immediately after startup polypaudio drops all capabilities except CAP_SYS_NICE (At least on systems that support it, like Linux; see man 7 capabilities for more information). If the calling user is not a member of the group realtime (which is required to have a GID < 1000), root rights are dropped immediately. This means, you can install polypaudio SUID root, but only a subset of your users (the members of the group realtime) may make use of realtime scheduling. Keep in mind that these users might load their own binary modules into the polypaudio daemon which may freeze the machine. The daemon has a minimal protection against CPU hogging (the daemon is killed after hogging more than 70% CPU for 5 seconds), but this may be circumvented easily by evildoers.

  11. I want to run polypaudio only when it is needed, how do I do this?

    Set autospawn = yes in client.conf. That configuration file may be found either in /etc/polypaudio/ or in ~/.polypaudio/.

  12. How do I list all polypaudio modules installed?

    polypaudio --dump-modules

    Add -v for terse usage instructions.

  13. How do I use polypaudio over the network?

    Just set $POLYP_SERVER to the host name of the polypaudio server.

  14. Is polypaudio capable of providing synchronized audio playback over the network for movie players like mplayer?

    Yes! Unless your network is congested in some way (i.e. transfer latencies vary strongly) it works perfectly. Drop me an email for experimental patches for MPlayer.

  15. What environment variables does polypaudio care about?

    The client honors: POLYP_SINK (default sink to connect to), POLYP_SOURCE (default source to connect to), POLYP_SERVER (default server to connect to, like ESPEAKER), POLYP_BINARY (the binary to start when autospawning a daemon), POLYP_CLIENTCONFIG (path to the client configuration file).

    The daemon honors: POLYP_SCRIPT (default CLI script file run after startup), POLYP_CONFIG (default daemon configuration file), POLYP_DLPATH (colon separated list of paths where to look for modules)

  16. I saw that SIGUSR2 provokes loading of the module module-cli-protocol-unix. But how do I make use of that?

    A brilliant guy named Lennart Poettering once wrote a nifty tool for that purpose: bidilink. To connect to a running polypaudio daemon try using the following commands:

    killall -USR2 polypaudio
    bidilink unix-client:/tmp/polypaudio/cli

    BTW: Someone should package that great tool for Debian!

    New: There's now a tool pacmd that automates sending SIGUSR2 to the daemon and running a bidilink like tool for you.

  17. How do the polypaudio libraries decide where to connect to?

    The following rule applies:

    1. If the the application using the library specifies a server to connect to it is used. If the connection fails, the library fails too.
    2. If the environment variable POLYP_SERVER is defined the library connects to that server. If the connection fails, the library fails too.
    3. If $DISPLAY is set, the library tries to connect to that server and looks for the root window property POYLP_SERVER for the host to connect to. If POLYP_COOKIE is set it is used as authentication cookie.
    4. If the client configuration file (~/.polypaudio/client.conf or /etc/polypaudio/client.conf) sets the server address, the library connects to that server. If the connection fails, the library fails too.
    5. The library tries to connect to the default local UNIX socket for polypaudio servers. If the connection fails, it proceeds with the next item.
    6. The library tries to connect to the default local TCP socket for polypaudio servers. If the connection fails, it proceeds with the next item.
    7. If $DISPLAY is set, the library tries to connect to the default TCP port of that host. If the connection fails, it proceeds with the next item.
    8. The connection fails.
  18. Why the heck does libpolyp link against libX11?

    The Polypaudio client libraries look for some X11 root window properties for the credentials of the Polypaudio server to access. You may compile Polypaudio without X11 for disabling this.


Lennart Poettering <@PACKAGE_BUGREPORT@>, September 2004
$Id$