@@ -23,10 +23,11 @@
2323, pango
2424
2525, audioSupport ? mediaSupport
26−, pulseaudioSupport ? audioSupport
26+, pulseaudioSupport ? false
2727, libpulseaudio
28+, apulse
2829
29−# Media support (implies pulseaudio support)
30+# Media support (implies audio support)
3031, mediaSupport ? false
3132, gstreamer
3233, gst-plugins-base
@@ -158,6 +159,11 @@ stdenv.mkDerivation rec {
158159 # and torLibPath for accuracy, but this is more convenient ...
159160 libPath=${libPath}:$TBB_IN_STORE:$TBB_IN_STORE/TorBrowser/Tor
160161
162+ # apulse uses a non-standard library path. For now special-case it.
163+ ${optionalString (audioSupport && !pulseaudioSupport) ''
164+ libPath=${apulse}/lib/apulse:$libPath
165+ ''}
166+
161167 # Fixup paths to pluggable transports.
162168 sed -i TorBrowser/Data/Tor/torrc-defaults \
163169 -e "s,./TorBrowser,$TBB_IN_STORE/TorBrowser,g"
@@ -218,6 +224,13 @@ stdenv.mkDerivation rec {
218224 // toggling the pref takes effect.
219225 lockPref("browser.tabs.remote.autostart.2", ${if disableContentSandbox then "false" else "true"});
220226
227+ // Allow sandbox access to sound devices if using ALSA directly
228+ ${if (audioSupport && !pulseaudioSupport) then ''
229+ pref("security.sandbox.content.write_path_whitelist", "/dev/snd/");
230+ '' else ''
231+ clearPref("security.sandbox.content.write_path_whitelist");
232+ ''}
233+
221234 ${optionalString (extraPrefs != "") ''
222235 ${extraPrefs}
223236 ''}
@@ -336,6 +349,8 @@ stdenv.mkDerivation rec {
336349 PULSE_SERVER="\''${PULSE_SERVER:-}" \
337350 PULSE_COOKIE="\''${PULSE_COOKIE:-}" \
338351 \
352+ APULSE_PLAYBACK_DEVICE="\''${APULSE_PLAYBACK_DEVICE:-plughw:0,0}" \
353+ \
339354 TOR_SKIP_LAUNCH="\''${TOR_SKIP_LAUNCH:-}" \
340355 TOR_CONTROL_PORT="\''${TOR_CONTROL_PORT:-}" \
341356 TOR_SOCKS_PORT="\''${TOR_SOCKS_PORT:-}" \