Opened 6 months ago

Last modified 4 months ago

#29360 needs_information defect

Tor-Browser Linux: no audio playback (pulseaudio) on CentOS 6

Reported by: tries Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Symptoms:
Audio (via pulseaudio) not working.
Starting tor-browser in verbose mode gives the following output when Tor-Browser tries to start playing audio:

[Child 25922, MediaPlayback #1] WARNING: 7f711d9bf880 OpenCubeb() failed to init cubeb: file /var/tmp/build/firefox-7393f1ffd512/dom/media/AudioStream.cpp, line 375
[Child 25922, MediaPlayback #1] WARNING: Decoder=7f711d9b4600 [OnMediaSinkAudioError]: file /var/tmp/build/firefox-7393f1ffd512/dom/media/MediaDecoderStateMachine.cpp, line 3385
[Child 25922, MediaPlayback #1] WARNING: Decoder=7f711d9b4600 Decode error: NS_ERROR_DOM_MEDIA_MEDIASINK_ERR (0x806e000b) - OnMediaSinkAudioError: file /var/tmp/build/firefox-7393f1ffd512/dom/media/MediaDecoderStateMachine.cpp, line 3118

What I have figured out so far:

  • Tor-Browser maintains its own HOME directory, which is set in .../Browser/start-tor-browser and points to .../Browser/
  • When accessing (or trying to) pulseaudio, Tor-Browser uses the pulseaudio files (.pulse/ and .pulse-cookie) as well as the .esd_auth from this fake HOME.

In my case, Tor-Browser was not able talk with the already running pulseaudio daemon - very likely due to a mismatch in the auth cookie (did not verify this). After manually removing these files and directory and copying them from the real users HOME, audio playback did work again.

My temporary fix is to remove and copy above mentioned files before starting tor-browser:

# fix up pulseaudio stuff...
rm ${INSTALLDIR}/Browser/.esd_auth
rm ${INSTALLDIR}/Browser/.pulse-cookie
rm ${INSTALLDIR}/Browser/.pulse/*
rmdir ${INSTALLDIR}/Browser/.pulse

cp -p $HOME/.esd_auth ${INSTALLDIR}/Browser/.esd_auth
cp -p $HOME/.pulse-cookie ${INSTALLDIR}/Browser/.pulse-cookie
cp -pr $HOME/.pulse ${INSTALLDIR}/Browser/

If there is no specific reason (privacy, information leak, ...) not to do so, tor-browser startup should make sure that those files in the fake HOME contain correct data to allow communication with pulseaudio.

Child Tickets

Change History (11)

comment:1 Changed 6 months ago by gk

Status: newneeds_information

Thanks for the detailed bug report. I wonder why you are the only one reporting this. Which Linux flavor is that? And which Tor Browser version? Where did you get your Tor Browser from?

comment:2 Changed 6 months ago by tries

Sry, should have included info about versions.

OS: CentOS 6.10, 64bit
Tor Browser: 8.0.5 (has been kept up-to-date via the integrated update feature)
Download was from www.torproject.org.

As the content of mentioned pulseaudio files seems mostly static, once audio is working it will be working. I had audio working before with this exact Tor-Browser installation, but it stopped after fiddling around with some pulseaudio stuff on my system.

I will try if I can reproduce this situation.

comment:3 Changed 6 months ago by tries

One way to reproduce this (existing installation where audio is working):

  • in the Tor-Browser installation filder (.../Browser/) remove the pulsaudio related files & directories

rm -rf .pulse-cookie .pulse .esd_auth

  • start some other application that plays audio (and starts an pulseaudiod instance), e.g. xmms
  • ensure that audio is played OK
  • start tor-browser
  • go to some URL that plays some audio content (e.g. /www.audiocheck.net)
  • tor-browser tries to launch an pulseaudio instance (which fails as there is already a running instance) and recreates the above removed files.
  • the above described error is triggered (warnings about "OpenCubeb() failed to init", etc)
  • from now on, audio will always fail to play.

After copying the above files from the real users HOME to .../Browser/ and restarting tor-browser, audio playback is working again.

I also tried this with a fresh install:

  • download tor-browser-linux64-8.0.5_en-US.tar.xz
  • untar
  • start tor-browser

Results in no audio. Which makes sense and confirms my findings above (as the tar archive contains no pulseaudio config files).

So the question actually should be: why did it work at all before? Might be something CentOS / pulseaudio version specific?

comment:4 in reply to:  2 Changed 6 months ago by gk

Replying to tries:

As the content of mentioned pulseaudio files seems mostly static, once audio is working it will be working. I had audio working before with this exact Tor-Browser installation, but it stopped after fiddling around with some pulseaudio stuff on my system.

Does this mean audio in Tor Browser worked out-of-the box previously on that system but does not do so since you played around with pulseaudio on your system/or got a pulseaudio update?

comment:5 Changed 6 months ago by tries

It means:

  • It did initially work out of the box, but the initial installation was quite some time ago with an older version of tor-browser.
  • Since then, I did online updates (keeping the content of the fake HOME)
  • fresh installation of the current tor-browser fails to produce audio (until I copy those pulseaudio files)

So I would have to go back in time and figure out what ancient version of tor browser was still OK. Unfortunately, the official download location does not provide old installation packages - is there an archive somewhere? Then I would take the time and check with old versions.

comment:6 in reply to:  5 Changed 5 months ago by gk

Replying to tries:

It means:

  • It did initially work out of the box, but the initial installation was quite some time ago with an older version of tor-browser.
  • Since then, I did online updates (keeping the content of the fake HOME)
  • fresh installation of the current tor-browser fails to produce audio (until I copy those pulseaudio files)

So I would have to go back in time and figure out what ancient version of tor browser was still OK. Unfortunately, the official download location does not provide old installation packages - is there an archive somewhere? Then I would take the time and check with old versions.

Thanks! https://archive.torproject.org/tor-package-archive/torbrowser/ has all older releases. I guess a good starting point for testing could be 7.5.6.

That said on my Linux box sound is fine without having all the hidden pulseaudio related folders in my Browser directory. So, hrm...

comment:7 Changed 5 months ago by tries

The presense/requirement of the .pulse directory seems to depend on the pulseaudio version.

  • CentOS 6 with pulseaudio 0.9.21 does have these directories
  • CentOS 7 with pulseaudio 10.0 does NOT have them (there, things are located in $HOME/.config/pulse/

However, audio with tor-browser on CentOS 7 works fine, even without any links/copies of pulseadio related files. I tested 6.0, 7.5, 7.0, 7.5 and current 8.0 versions of tor-browser - my audio issue with CentOS 6 exists with all these versions (clean install of tor-browser).

I have to admit, currently I have no idea why my audio did work at all before...
But my best guess to get around this would be to place a symlink to the .pulse directory in the real home directory - if this directory should exists in the users $HOME (similar to what has been done in #9353).

comment:8 Changed 5 months ago by gk

Status: needs_informationnew
Summary: Tor-Browser Linux: no audio playback (pulseaudio)Tor-Browser Linux: no audio playback (pulseaudio) on CentOS 6

comment:9 Changed 4 months ago by dodonnell

I'm also inflicted with this error. My on a Parrot GNU/Linux 4.5, with Tor Browser 8.0.7, and pulseaudio 12.2. I tried copying the folder ~/.config/pulse to Tor's respective fake home folder as it wasn't there originally. Still, it had no effect.

comment:10 in reply to:  9 ; Changed 4 months ago by gk

Status: newneeds_information

Replying to dodonnell:

I'm also inflicted with this error. My on a Parrot GNU/Linux 4.5, with Tor Browser 8.0.7, and pulseaudio 12.2. I tried copying the folder ~/.config/pulse to Tor's respective fake home folder as it wasn't there originally. Still, it had no effect.

I wonder whether that's actually the same bug as the OP had. Have you tried the steps in comment:7 to work around your problem?

comment:11 in reply to:  10 Changed 4 months ago by dodonnell

But my best guess to get around this would be to place a symlink to the .pulse directory in the real home directory - if this directory should exists in the users $HOME (similar to what has been done in #9353).

I did this. But instead of symlinking the files, I copied them. As I sandbox the Tor browser process.

Note: See TracTickets for help on using tickets.