Opened 10 months ago

Last modified 11 days 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 (14)

comment:1 Changed 10 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 10 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 10 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 10 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 10 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 10 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 10 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 10 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 9 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 9 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 9 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.

comment:12 in reply to:  11 Changed 4 months ago by arkadiy

Replying to 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.

The same problem on Debian bullseye/sid. Copying the files does no favor.

comment:13 Changed 2 weeks ago by pili

#32583 is a duplicate.

Anyone following this ticket may want to check out (comment:6:ticket:32583)

comment:14 Changed 11 days ago by strix

In Slackware 14.2 stable (which runs pulseaudio 9.0), the default install of Tor Browser 9.0.1 (from tor-browser SBo, which uses the pre-built package from dist.torproject.org) will crash the pulseaudio user daemon. Usually, the user will need to kill the daemon after closing Tor Browser so a functioning daemon can be spawned for other applications.

The fix in Slackware 14.2 is nearly identical to what the submitter of this ticket suggested for CentOS 6:

$ cp -pf $HOME/.esd_auth $HOME/.tor-browser/INSTALL/Browser
$ cp -pfr $HOME/.config/pulse/ $HOME/.tor-browser/INSTALL/Browser

(The cookie file is copied with the pulse directory.)

Note: See TracTickets for help on using tickets.