
Systems programming in pulseaudio: untagged unions, fs races, edge cases, and docs - straylark
https://gist.github.com/straylark/25d041c071707b151f7e74acd6bbb599
======
JdeBP
Part of what this fights against is the daemonization fallacy. At
initialization, before it even looks at its command-line arguments, the
program closes almost all of its open file descriptors. Then it tries to use
the /dev/fd/N name passed in as an argument by the shell's process
substitution, which is of course now closed.

The waiting and killing in the shell script is fighting the daemonization
fallacy, too. Luckily, _that_ part of the program can be turned off with
--daemonize=no. Even the pulseaudio people themselves do this.

* [https://github.com/pulseaudio/pulseaudio/blob/24928d6b6fa1cd...](https://github.com/pulseaudio/pulseaudio/blob/24928d6b6fa1cde3312bcf63e4e14d7003aadc69/src/daemon/systemd/user/pulseaudio.service.in#L22)

------
bluesnowmonkey
Not my submission, but why remove "bad" from the title? We're not allowed to
express a negative sentiment anymore? Don't want to hurt someone's feelings?

It's a confusing title in this form. Sounds like it will be a lesson in how to
do systems programming, but it's really a complaint about a bad experience
with some systems programming. Let the title say what the thing is.

------
snaky
PulseAudio emulation for ALSA -
[https://github.com/i-rinat/apulse](https://github.com/i-rinat/apulse)

------
tinus_hn
You can buy USB sound ‘cards’ for less than a dollar. I find the premise of
this article kind of unconvincing.

