Closed Bug 535615 Opened 15 years ago Closed 15 years ago

[OOPP][Linux] Flash plays sound to different sound cards when IPC is disabled vs. enabled

Categories

(Core Graveyard :: Plug-ins, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: dholbert, Unassigned)

References

()

Details

STEPS TO REPRODUCE:
 1. Turn on dom.ipc.plugins.enabled (and restart Firefox)
 2. Visit URL
 3. Listen.

EXPECTED RESULTS: Video should have sound.
ACTUAL RESULTS: There's no sound.

NOTE: If I clear dom.ipc.plugins.enabled, I get expected behavior.

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a1pre) Gecko/20091217 Minefield/3.7a1pre

I'm using:
Ubuntu 9.10 (up to date)
Shockwave Flash 10.0 r42 (from Ubuntu repositories)
Blocks: OOPP
Summary: No sound in YouTube, with with dom.ipc.plugins.enabled turned on → [OOPP][Linux] No sound in YouTube
I think this actually affects all flash sound.  I've tested these sites as well, with the same "no sound" result:
 http://homestarrunner.com/main1.html
 http://www.badgerbadgerbadger.com/
Summary: [OOPP][Linux] No sound in YouTube → [OOPP][Linux] No sound in Flash
Karl, do you know much about Gtk/ALSA sound?  Might there be something we're failing to initialize in mozilla-runtime that's causing this failure?

(My linux machine doesn't have a sound card, so this may have been broken "forever".)
Matthew knows more about sound than anyone else around here.
If it helps at all, libflash appears to be using ALSA through libasound:

$ strings libflashplayer.so 
[...]
?libasound.so
libasound.so.2
snd_pcm_open
snd_pcm_close
snd_pcm_start
snd_pcm_drop
snd_pcm_prepare
snd_pcm_resume
snd_pcm_wait
snd_pcm_hw_params_sizeof
snd_pcm_sw_params_sizeof
snd_pcm_status_sizeof
snd_pcm_info
snd_pcm_info_get_id
snd_pcm_info_get_name
snd_pcm_hw_params_any
snd_pcm_hw_params_set_access
snd_pcm_hw_params_set_format
snd_pcm_hw_params
snd_pcm_sw_params_current
snd_pcm_sw_params
snd_pcm_writei
snd_pcm_readi
snd_pcm_delay
snd_pcm_avail_update
snd_pcm_status_malloc
snd_pcm_status
snd_pcm_status_dump
snd_pcm_state
snd_strerror
snd_pcm_frames_to_bytes
snd_async_handler_get_pcm
snd_pcm_hw_params_set_channels
snd_pcm_hw_params_set_rate_near
snd_pcm_hw_params_set_buffer_time_near
snd_pcm_hw_params_get_buffer_size
snd_pcm_hw_params_set_period_time_near
snd_pcm_hw_params_get_period_size
snd_pcm_sw_params_set_start_threshold
snd_pcm_sw_params_set_stop_threshold
snd_pcm_sw_params_set_avail_min
snd_pcm_sw_params_set_xfer_align
snd_async_handler_get_callback_private
[...]

ldd doesn't list libasound as a dependency, so flash is probably dlopen()ing libasound.
Yeah, it uses ALSA as the sound API.  Depending on the configuration of the distribution, it might end up using the sound hardware directly or going through PulseAudio.  It may also depend on whether a "Flash support library" (e.g. flashplugin-nonfree-extrasound in Ubuntu) is installed, which can redirect sound to ESD or OSS.

In a default Ubuntu 9.10 install, ALSA is redirected to PulseAudio via libasound2-plugins, which includes an PulseAudio ALSA plugin backend.

It might be interesting to try removing PulseAudio (remove the libasound2-plugins package, and make note of what else is torn out so you can restore it all afterwards) temporarily to see if that changes the behaviour.

In a VirtualBox VM running a fresh install of Ubuntu 9.10, with Flash 10r42 from the Ubuntu repositories, sound works fine for me with in-process and out-of-process plugins.  (I initially wasted a bunch of time testing the same install with VMWare Fusion 3 before I realised that the sound hardware emulation is totally broken under VMWare, and Linux sound pretty much doesn't work at all in this configuration.)
This is actually WFM on my home machine (Ubuntu 9.10), using a set of speakers plugged into the sound card.

I'll investigate this a bit more tomorrow on my machine at the office (where I hit the bug this morning). I use a USB headset on that machine, which presents itself as a separate sound card.  It's possible that's contributing to the problem somehow.
Ok, so -- So when I got in to the office today, I could still reproduce this -- IPC disabled gave me sound, IPC enabled gave me no-sound, with my USB headphones.

Then, I plugged in some headphones to my soundcard's standard audio-out jack, and I got the reverse behavior -- audio came out of there when I had IPC *enabled*.  And no audio came out of there when I had IPC disabled (though it still came out of the USB headphones in that case).

I then checked my sound preferences, and it turned out that my internal soundcard was set as my audio-out device (despite the fact that non-IPC firefox, as well as the "Totem" media player, were playing audio on the USB headphones).

I tweaked that setting to make USB headphones the default output, and from then on, I've gotten expected & consistent behavior -- now Firefox+IPC, Firefox-IPC, & Totem all output to whichever audio output is set in my sound preferences.

Not sure how my machine got in the initial confused state, where Firefox + IPC appeared to be the only program respecting my system's sound preferences... I'm going to try rebooting, to see if that gets be back to that broken state.
Nope -- my sound preferences (with USB headset being default) lasted through the reboot, and both Totem and Firefox+IPC played audio to those headphones (and not to the internal soundcard).

So this is WFM, if only because I can't get back to the broken state. :)  Resolving for now, but I'll reopen if I ever hit this again.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
Summary: [OOPP][Linux] No sound in Flash → [OOPP][Linux] Flash plays sound to different sound cards when IPC is disabled vs. enabled
(In reply to comment #7)
> I then checked my sound preferences, and it turned out that my internal
> soundcard was set as my audio-out device (despite the fact that non-IPC
> firefox, as well as the "Totem" media player, were playing audio on the USB
> headphones).
> 

Matthew, should this be spun off into a generic Gecko bug?
That probably shouldn't be spun off until I (or someone) can figure out how to reproduce it again. :)  Per 4th paragraph in comment 7, I get expected behavior (everything playing to the correct sound card) ever since touching my sound preferences today.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.