Closed Bug 1422073 Opened 7 years ago Closed 7 years ago

no audio unless pulseaudio is already running

Categories

(Core :: Audio/Video: cubeb, defect, P3)

58 Branch
Unspecified
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1435523

People

(Reporter: felix-mozilla, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0 Build ID: 20171127101135 Steps to reproduce: Run pulseaudio in a shell, start Firefox, go to Youtube, get audio. Exit Firefox, kill the pulseaudio, start a new Firefox, go to Youtube, get no audio. Actual results: I get audio if I started the pulseaudio daemon myself. No audio otherwise. Expected results: If the pulseaudio daemon is not running, the pulseaudio library is supposed to fork one off. I'm guessing that that fails because of the sandboxing code. I have no proof for this but that seems like the most obvious explanation for me ATM.
Component: Untriaged → Audio/Video: Playback
OS: Unspecified → Linux
Product: Firefox → Core
To see if it is sandboxing related, try running: $ MOZ_DISABLE_CONTENT_SANDBOX=1 firefox If it is a sandboxing issue then it should be fixed in Firefox 59, which supports remote audio. Failing that, take a look at client.conf https://wiki.archlinux.org/index.php/PulseAudio#client.conf
I am also experiencing the same issue $ lsb_release -a Distributor ID: Ubuntu Description: Ubuntu 17.04 Release: 17.04 Codename: zesty Browser always shows `You may need to install the required PulseAudio software` Lets try to install pulseaudio ``` sudo apt-get install pulseaudio [sudo] password for hari: Reading package lists... Done Building dependency tree Reading state information... Done pulseaudio is already the newest version (1:10.0-1ubuntu2). 0 upgraded, 0 newly installed, 0 to remove and 288 not upgraded. ``` Sometimes the audio is working, sometimes it is not. Not sure how I can help to reproduce the issue.
This is what I see by command pulseaudio -v I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted I: [pulseaudio] core-util.c: Successfully gained nice level -11. I: [pulseaudio] main.c: This is PulseAudio 10.0 I: [pulseaudio] main.c: Page size is 4096 bytes I: [pulseaudio] main.c: Machine ID is 2c28f98a8c4e43c0aeed1d8208768ccf. I: [pulseaudio] main.c: Session ID is c2. I: [pulseaudio] main.c: Using runtime directory /run/user/1000/pulse. I: [pulseaudio] main.c: Using state directory /home/hari/.config/pulse. I: [pulseaudio] main.c: Using modules directory /usr/lib/pulse-10.0/modules. I: [pulseaudio] main.c: Running in system mode: no E: [pulseaudio] pid.c: Daemon already running. E: [pulseaudio] main.c: pa_pid_file_create() failed.
Component: Audio/Video: Playback → Audio/Video: cubeb
I noticed one thing which is interesting. When loading the url https://www.youtube.com/watch?v=X6uZd1jP_ZM on the browser the audio is not played and the message `You may need to install the required PulseAudio software` is shown. But when I post to facebook and playing from there the audio is there. What exactly is the root cause of this bug ? Anyone have hints to fix this ? Thank you.
I noticed how this automatically fixes things. 1. Close firefox 2. Open chromium browser and played the youtube video. 3. Close chromium browser 4. Open firefox and browse youtube NB : I hope you already have pulseaudio installed and the only problem exists due to firefox unable to start pulseaudio ( I believe ). This probably will be related to some permission issues which I don't know how to fix for the current time.
Possible reason is downloaded firefox from https://www.mozilla.org/en-US/firefox/ and unzipped to home folder. So the permission for starting pulseaudio may not be there. Chromium is installed via apt-get. May be using the version of firefox provided by the distro will not be having trouble.
Having similar issues, can work this around by just running pavucontrol. Running firefox in CLI gives this when no sound: fork() : Operation not permitted [Child 1962, MediaPlayback #1] WARNING: 7f42d6920640 Can't get cubeb context!: file /builddir/build/BUILD/firefox-58.0.1/dom/media/AudioStream.cpp, line 358 [Child 1962, MediaPlayback #1] WARNING: Decoder=7f42c7396200 [OnMediaSinkAudioError]: file /builddir/build/BUILD/firefox-58.0.1/dom/media/MediaDecoderStateMachine.cpp, line 3642
See Also: → 1435523
Solved it by starting pulseaudio from my i3 config at startup.
(In reply to Grégoire Paris from comment #8) > Solved it by starting pulseaudio from my i3 config at startup. That was the right answer. For those looking for the command this was what I added on the ~/.config/i3/config file . exec /usr/bin/pulseaudio --start --log-target=syslog
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE

I dont know how this can be marked as "Resolved"

Clearly firefox is dependent on a specific state of Pulseaudio in order to feed sound to pulseaudio. It cannot be Pulseaudio at error as both Chrome and BRAVE browasers have no such problems with pulseaudio.
Chrome and Brave works with pulseaudio from any state of pulseaudio.
Firefox on the other hand is the odd one out demanding some mysterious dependndency that Pulseaudio MUST be started before arts else you have no sound.

This BUG in firefox has been driving me nuts and still does and is clearly unresolved.

Just pushing forward the solution that Pulseaudio must always be started before Firefoox is not a solution as you can verify yourself that Both Brave and Chrome doesnt need this silly requirement.

There is obviously at minimum an inadiquaicy with firefox dealing with Pulseaudio as the other mentioned browsers dont have this problem.

To add this still happens on Firefox 69.0 which is very recent.
System:
NAME="MX"
VERSION="18 (Continuum)"
ID="mx"
VERSION_ID="18"
PRETTY_NAME="MX 18 (Continuum)"
ANSI_COLOR="0;34"
HOME_URL="https://mxlinux.org"
BUG_REPORT_URL="https://mxlinux.org"
PRETTY_NAME="MX 18.3 Continuum"
DISTRIB_ID=MX
DISTRIB_RELEASE=18.3
DISTRIB_CODENAME=Continuum
DISTRIB_DESCRIPTION="MX 18.3 Continuum"
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=debian

You need to log in before you can comment on or make changes to this bug.