Open Bug 1434362 Opened 3 years ago Updated 11 months ago
Stereo upmix to 5
.1 not happening when using Web Audio configured for stereo output
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36 Steps to reproduce: user agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0 On a system with a surround sound setup: 1) Load https://jsbin.com/renawuveyo/edit?html,js,output and click play. 2) Load https://jsbin.com/qawocax/edit?html,js,output Actual results: The output from 1 is upmixed to 5.1. The output from 2 is only send from the front L and R speaker, and the bass is missing. See https://soundcloudcommunity.com/desktop-230066/since-today-2018-01-15-music-only-plays-in-one-speaker-7396612#post18022543 for more context Expected results: The output from 1 and 2 should be identical. In a 5.1 setup if 1 is upmixed to 5.1, then the second one should also be upmixed to 5.1. In the example we are explicitly setting the `channelCount` to 2 on the destination, so I think the OS should only be seeing 2 channels from the browser. I am wondering if firefox is actually filling everything but the first 2 channels with silence and sending that? The problem does not happen with the test pages in chrome. Here is the users configuration: https://gist.githubusercontent.com/tjenkinson/9150c8da4a5178305bc9e84f62e734ae/raw/af914a051c4ec13daa17e8374f1b8800baa853ed/DxDiag.txt
Sorry I just realised my examples are the wrong way around, and I can't see an edit button. 1 (web audio) is only output from front L and R 2 (standard audio element) is upmixed to 5.1
Thanks for the report. At first glance it doesn't seem unreasonable that setting the AudioDestinationNode.channelCount to 2 would result in stereo output instead of a surround upmix. But then I didn't realize we upmixed at all. Paul, which behaviour is correct?
Priority: -- → P3
This might also be related to https://bugzilla.mozilla.org/show_bug.cgi?id=1435598
Not up-mixing is the correct behaviour in both cases. Jean-Yves is currently overhauling our multichannel support, this should work "soon". Work is happening in bug 1431221.
Depends on: 1431221
Great! Does this mean that the standard audio element will also only output in front L and R? Or does this mean that Firefox will only send 2 channels, and this opens up the possibility for the OS/audio hardware to upmix? One concern is that if an upmix doesn't happen, a stereo track out of just front L and R without any subwoofer might be missing most of the low end, because surround speakers won't have the full range as 2 standard ones. Also with Chrome the user reported that the upmix does seem to happen for them. Is it intentional that Firefox is behaving differently (or maybe Chrome also outputs 2 channels and the OS is upmixng. I don't have surround speakers to test)?
(In reply to thomas_jenkinson from comment #5) > Great! > > Does this mean that the standard audio element will also only output in > front L and R? If we're talking about a stereo media, yes. > Or does this mean that Firefox will only send 2 channels, and this opens up > the possibility for the OS/audio hardware to upmix? As always, it depends. Say you're playing a stereo media (say a music track). A user that has, say, a 2.1 kit can have any combination of: - Full range speakers / Speakers with only medium and tweeter - For full range speakers, crossover enabled or disabled (to cut the low end, to leave some room for the subwoofer) - Exposing 2.1 or 2.0 (with the sub automatically playing downmixed, low-passed audio when it receives a stereo stream) Firefox cannot determine what to do in most cases, so I think we'll just send stereo (again, we're playing a stereo track here). The user will have to have its software and hardware properly configured. To summarize, it's unlikely we'll do the downmix/lowpass ourself. > One concern is that if an upmix doesn't happen, a stereo track out of just > front L and R without any subwoofer might be missing most of the low end, > because surround speakers won't have the full range as 2 standard ones. My take on that is that this is on the user. > Also with Chrome the user reported that the upmix does seem to happen for > them. Is it intentional that Firefox is behaving differently (or maybe > Chrome also outputs 2 channels and the OS is upmixng. I don't have surround > speakers to test)? I don't think Chrome does anything special here. Firefox just has a bug. All this requires a bit more testing on our end, I'll get some hardware and report back.
Great thanks. I agree that the browser shouldn't do upmixing by default, and just pass through the channels it has. If the audio context destination `channelCount` was set to 6, then I'd expect firefox to be sending 6 channels with 4 silent. This would be different to `channelCount` being 2, where it would only send 2 channels (and then maybe the OS/audio hardware would upmix). Looking forward to see if this fixes the problem, or at least makes the output of playing a stereo track with an audio element vs audio element through web audio consistent.
Hello, I am the user Thomas is talking about. I think it's important to clarify a few things here. I am a Windows 10 user with a Creative Sound Blaster X-Fi Xtreme Audio PCI Express 7.1 Sound Card and Creative 7.1 speaker system. It's an older card, but it does have Windows 10 drivers. The card is set to "stereo surround" in the 3D expand section of the Creative control panel. The Windows OS "spatial sound" option is not available with this card, and is greyed out. Chrome does NOT upmix any media sources, nor does Opera. Any media source, Soundcloud, Mixcloud, Youtube, etc. plays in 2.something sound, which is to say that the subwoofer outputs some bass, but it is very weak and thin sounding. Chrome sounds really bad, so Firefox has always been my browser of choice for streaming media. Firefox does upmix most media sources into glorious 7.1 surround stereo with full bass. That is, all except Soundcloud. Mixcloud, Youtube, etc. all play perfectly fine. However, a recent change to Soundcloud has it playing just as it does in Chrome, in flimsy 2.1 sound. Microsoft Edge behaves exactly the same way as Firefox and most media sources upmix perfectly, but unfortunately not Soundcloud. All locally played media, including files downloaded from Soundcloud, play in 7.1 through media players like AIMP. So, as far as I am concerned, Firefox is generally working well for upmixing most media sources, just not Soundcloud.
For me nothing is upmixed in FF 63. Which is a pitty, because AMD drivers (most users use their HDMI Audio for computer sound) don't offer an upmix function. In addition, I can't use my receiver (because it already gets 5.1 sound from the computer, even if 4 of them are quiet). I guess for most users, there's currently neither a SW nor a HW solution to upmix. That's why almost all audio and video players offer some upmix filters. Is there an option in FF to enforce upmix of stereo sources? In https://bugzilla.mozilla.org/show_bug.cgi?id=1432779 it's mentioned that the same config as FFMPEG is used. Can I somehow install FFMPEG and configure it to upmix? Would be really cool to enjoy youtube & spotify in surround. BTW: I know there are around 0.5% audiophiles who use 10000€ speakers who propably want to enjoy stereo sources in stereo.
Don't know what changed, but after Firefox updated itself today the sound on Soundcloud is back to being upmixed to 7.1 and sounds amazing.
Unfortunately this is because we disabled web audio temporarily in Firefox 65 due to https://bugzilla.mozilla.org/show_bug.cgi?id=1515099 I think this bug might still exist with web audio.
You need to log in before you can comment on or make changes to this bug.