FS#52183 - [firefox] Jack support is somewhat cumbersome

Attached to Project: Arch Linux
Opened by Adriano Moura (MaMuS) - Saturday, 17 December 2016, 00:56 GMT
Last edited by Balló György (City-busz) - Thursday, 15 June 2023, 11:39 GMT
Task Type General Gripe
Category Packages: Extra
Status Closed
Assigned To Jan Alexander Steffens (heftig)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

The new firefox package (50.1) has jack support compiled in. This is a nice feature but it's interfering with my setup since it bypasses my jack setup and connects directly to the system ports by default. There are no options to change this behavior in Firefox. (many jack clients allow you to disable default connections)

I can use qjackctl patchbay to match the firefox client and route the connection to the proper port, and also activate exclusive mode so that it disconnects firefox from the system ports, but It still takes about half a second for the rule to take effect each time firefox creates the client.

Firefox also adds new ports to the client for each new concurrent audio stream, complicating the matching rules and adding more sudden jumps in volume (caused by outputting directly trough the system ports)

I don't know how many people depend on such a feature since normally, when using JACK, you would route firefox (and any other normal app) audio's from pulseaudio to jack.

It might be best to leave this feature disabled until they bake in more options or have better defaults.
This task depends upon

Closed by  Balló György (City-busz)
Thursday, 15 June 2023, 11:39 GMT
Reason for closing:  No response
Additional comments about closing:  very old report
Comment by Adriano Moura (MaMuS) - Saturday, 17 December 2016, 00:59 GMT
I just realized it also bypasses pulseaudio volume control...
Comment by Jan Alexander Steffens (heftig) - Friday, 23 December 2016, 16:11 GMT
Disabled in trunk; this will go into the next release.
Comment by Adriano Moura (MaMuS) - Tuesday, 03 January 2017, 23:16 GMT
Thanks!
Comment by Hanspeter Portner (ventosus) - Sunday, 15 January 2017, 09:10 GMT
A lot of people have waited since years for native firefox JACK support.

As the problem seems to be just automatic connection to system ports being annoying to the bug reporter, why don't we just disable that, instead of the whole backend?

Patch attached.

P.s. there's no such thing as 'normally people do this and that on GNU/Linux', e.g. many of the audio crowd keep their systems free of pulseaudio and many will be happy with automatic connection to system ports...
Comment by Hanspeter Portner (ventosus) - Sunday, 15 January 2017, 13:41 GMT
@MaMuS, JACK backend takes precedence over pulse's, so firefox directly outputs through JACK, not through pulse, that's why you have no control on its volume through pulse.

If this is a problem for people running pulse + JACK, we could also switch precedence to pulse.

Patch attached.
Comment by Hanspeter Portner (ventosus) - Sunday, 15 January 2017, 14:32 GMT
@MaMuS, JACK backend takes precedence over pulse's, so firefox directly outputs through JACK, not through pulse, that's why you have no control on its volume through pulse.

If this is a problem for people running pulse + JACK, we could also switch precedence to pulse.

Patch attached.
Comment by Jimi Bove (Jimi-James) - Monday, 16 January 2017, 10:12 GMT
Can we incorporate that pulse-before-jack patch into the package itself for its next release? Sorry if I was supposed to know it was already going in--newbie to Arch's bug report system here.

I can't imagine that anyone who's running pulse + JACK would ever want Firefox to use JACK. If you use JACK and yet love pulse so much that you also keep pulse running, that means JACK is probably meant for heavy-duty sound operations that may need to run in realtime, like a DAW. Firefox is not a DAW. Also, I need to have volume controls for whatever sound comes out of my browser besides my master speaker volume. Now I have to choose between not updating Firefox until this gets sorted out, or recompiling every time a new version comes out.
Comment by Adriano Moura (MaMuS) - Monday, 16 January 2017, 23:53 GMT
I'm fine with both patches ,but as I said, it should be mozilla's job to provide better defaults (or at least some configuration options hidden deep in about:config)
Comment by Jimi Bove (Jimi-James) - Tuesday, 17 January 2017, 00:37 GMT
I just filed a bug about that if anyone wants to weigh in on it: https://bugzilla.mozilla.org/show_bug.cgi?id=1331526
Comment by Hanspeter Portner (ventosus) - Tuesday, 17 January 2017, 08:13 GMT
@Jimi-James, Firefox audio library is developed as a separate project [1] and just pulled in from time to time into the firefox source tree.

Maybe we should file issues there, too?

[1] https://github.com/kinetiknz/cubeb
Comment by enterogen (enterogen) - Wednesday, 18 January 2017, 13:43 GMT
removing comment until further research.
Comment by marcus philpott (pha-qu) - Saturday, 18 February 2017, 22:49 GMT
For the record, temporarily being able to hear web content through jack with firefox was profoundly useful. Now after the recent update I've been deprived of this neat functionality. Now I'm back to constantly turning jack on/off depending on whether I want to hear webz content or what I'm doing in audio application. At least someone else isn't being annoyed by having to repatch audio routing in qjackctl. Could someone indicate or provide a link to a 'how-to' on re-enabling this feature.

Thanks jimi and Adriano but I'm with Hanspeter on this (A lot of people have waited since years for native firefox JACK support.)
Comment by Jimi Bove (Jimi-James) - Saturday, 18 February 2017, 23:01 GMT
According to the change that actually happened (https://github.com/kinetiknz/cubeb/pull/214), all that's happening now is Firefox is preferring PulseAudio over JACK. If you specifically want to use JACK, not PulseAudio, for something like Firefox around the same times you're using JACK for audio production, why do you have PulseAudio installed at all? If it's a speaker routing thing, I can help you use PulseAudio's JACK Source to route all PulseAudio sound through your speakers the same way JACK apps can, which is what I do. If you aren't running PulseAudio and simply have no sound in Firefox now, that's definitely another bug that this bug's fix wasn't meant to cause. You should file an issue about it at cubeb's GitHub.
Comment by marcus philpott (pha-qu) - Sunday, 19 February 2017, 17:46 GMT
Hi Jimi, thanks for info. The problem is solved by using pulse audio jack sink correctly. Oops ... Pulse is unfortunately a requisite for casual RnR e.g. steam among others. I will investigate ways of elliminating pulse, as I've done before, it would seem a jack only audio system is now quite possible. I mistakenly thought that starting jack killed pulse, obviously not. It would have been nice if jack had won the audio API/server war and become the de-facto linux audio server, it's so flexible when compared to the buggy rubbish that is pulse.
Comment by Turbo B (Turbo) - Saturday, 11 March 2017, 15:47 GMT
Hi,
Can you enable Jack in the next release please, i have done it for the current version (FF52) but it takes to long to built on my machine... :-). I have read the other comments and automatic connections are a blessing to me and i must admit that i have waited since years for native firefox JACK support (i was using a virtual sound card [snd-aloop] as an alternative solution).
Comment by Jimi Bove (Jimi-James) - Saturday, 11 March 2017, 18:05 GMT
Right before your comment is a whole conversation between marcus and myself that should've eliminated your need to make this comment. As I said before, JACK is still enabled (and even if it wasn't and you wanted that changed, you'd want to ask for that in the cubeb GitHub, not here). All that's changed now is Firefox is preferring Pulse over JACK. I'd suggest not running Pulse if you want to run Firefox with JACK support, or you can ask marcus how they accomplished what seems to be running JACK with Pulse and yet still getting Firefox to use JACK ("The problem is solved by using pulse audio jack sink correctly."). Meanwhile, Mozilla and cubeb do plan to eventually provide settings for this so that you can set it to only use JACK if you want.
Comment by Eli Schwartz (eschwartz) - Thursday, 03 August 2017, 17:56 GMT
Jimi, that's untrue. The Firefox PKGBUILD had jack removed from the makedepends and stopped passing "ac_add_options --enable-jack" in the mozconfig.

A better question is, has the cubeb change made it into Firefox yet after it was merged on cubeb's Github repo way back on Jan 20? Because the bugzilla ticket has no info beyond a notification of that cubeb PR.
If so, perhaps the Firefox package could re-enable JACK so it *is* actually available (for people not running Pulse).
Comment by Jimi Bove (Jimi-James) - Thursday, 03 August 2017, 18:42 GMT
Huh. Well, what do you know. I guess I was wrong to assume that anyone would've said anything about making that change in this bug report, and that cubeb's fix wouldn't have been merged pretty quickly.
Comment by Eli Schwartz (eschwartz) - Thursday, 03 August 2017, 19:25 GMT
You mean, like the way heftig said "Disabled in trunk; this will go into the next release"? The bugreport wasn't closed because it wasn't really "fixed", merely disabled.

As for cubeb, someone who either cares more about jack or knows more about Firefox's source will have to say if this change is now in Firefox. I'd hope so, since it has been rather a while...
Comment by Niklas Reppel (parkellipsen) - Sunday, 31 January 2021, 16:01 GMT
Sorry to dig out this old thread, but did anything discussed here make it into recent releases?

It's been discussed here to remove the auto-connection, which makes Firefox pretty useless to watch videos in Jack-only (no pulse) scenarios, as the video players have to be re-connected after every
pause, ad, etc., while running, as the players create a new client every time.

If it's a problem for people to have the auto-connection, I wonder if a flag could be used ?

Firefox 83 still connected to the system ports automatically.
Comment by Balló György (City-busz) - Thursday, 08 June 2023, 19:27 GMT
Is this still an issue?

Loading...