In some circumstances*, this can lead to PulseAudio running out of file descriptors, entering a tight loop and spewing about ~1MB/s data into xinit.log. We should probably only reload both modules if both modules are actually unloaded. Each module consumes about ~10 file descriptors and PulseAudio limits itself to 256 file descriptors, so it's fairly easy to reach that limit. *: Issue 17983, or by "pactl unload-module" on loaded sink or source modules. Typical error messages in xinit.log: > E: [tunnel-source] module-tunnel-source-new.c: Stream failed: Entity killed > E: [tunnel-source] module-tunnel-source-new.c: Stream failed: Invalid argument [repeats ~20 times] > E: [tunnel-source] shm.c: shm_open() failed: Too many open files [repeats ~400 times] > W: [tunnel-source] authkey.c: Failed to open cookie file '/var/opt/thinlinc/sessions/user/33/pulse-cookie': Too many open files > W: [tunnel-source] authkey.c: Failed to load authentication key '/var/opt/thinlinc/sessions/user/33/pulse-cookie': Too many open files > W: [tunnel-source] client-conf.c: Failed to load cookie from /var/opt/thinlinc/sessions/user/33/pulse-cookie (configured with environment variable PULSE_COOKIE): Too many open files > W: [tunnel-source] authkey.c: Failed to open cookie file '/var/opt/thinlinc/sessions/user/33/pulse-cookie': Too many open files > W: [tunnel-source] authkey.c: Failed to load authentication key '/var/opt/thinlinc/sessions/user/33/pulse-cookie': Too many open files > W: [tunnel-source] client-conf.c: Failed to load cookie from /var/opt/thinlinc/sessions/user/33/pulse-cookie (configured by the application): Too many open files > W: [tunnel-source] authkey.c: Failed to open cookie file '/home/user/.config/pulse/cookie': Too many open files > W: [tunnel-source] authkey.c: Failed to load authentication key '/home/user/.config/pulse/cookie': Too many open files > W: [tunnel-source] authkey.c: Failed to open cookie file '/home/user/.config/pulse/cookie': Too many open files > W: [tunnel-source] authkey.c: Failed to load authentication key '/home/user/.config/pulse/cookie': Too many open files > E: [tunnel-source] client-conf.c: Failed to load cookie file from cookie: Too many open files
Verified using thinlinc build 4948. The new tunnel-autoconnect module behaves properly when a sink/source has been unloaded. An unloaded module will silently be loaded upon a reconnection to a session.