You are not logged in.

#1 2022-06-15 06:45:59

PranshuTG
Member
Registered: 2022-04-01
Posts: 84

How to keep a firefox stream alive when pausing the video

sorry guys, its hard to explain in text so i made a video
https://www.youtube.com/watch?v=IcjeQNcgnrA

heres my attempt at explaining:
on  firefox when play a video or audio, it gets its own audio stream. but my problem with that is i want some way for the audio settings to stay the same on the same tab or the whole window. and changing the defaults isnt an option.
when i close a video, the stream disappears from qpwgraph, and looses its settings, how is it possible to either retain the stream or the setttings?

Offline

#2 2022-06-15 15:12:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,659

Re: How to keep a firefox stream alive when pausing the video

Afaik you can't generally retain that without adjusting firefox source code, this would normaly not be necessary as an "already seen" stream should retain it's properties and configuration  but the problem with firefox is that it includes some media specific identifier in the sink it creates which leads to a "new" node from the perspective of the session manager which thus gets bent to default rules again. FWIW you likely won't have this issue with chromium, but something you might be able to test is use some filter rules to force an uniform sink name: https://gitlab.freedesktop.org/pipewire … ient#rules

Offline

#3 2022-06-16 11:28:40

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: How to keep a firefox stream alive when pausing the video

Theoretically, creating a persistent audio graph starting with a 'nullsink' node and letting wireplumber handle Firefox to connect to that node instead might work. I haven't worked all too much with wireplumber yet though to be of much help here. I personally switch 'default sinks' globally only (thus not app based).


sys2064

Offline

#4 2022-06-17 11:26:27

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,659

Re: How to keep a firefox stream alive when pausing the video

Afaik firefox does encode the title or something in the node it generates so from the perspective of wireplumber it will always be a "new" node (which should hence have the default routes applied) I do hope that adding filtering rules to force this helps, it is one of the main reasons I am not using firefox as my main browser as it so often has absolutely weird and nonsensical decisions about how it presents the audio device to the pulse/pipewire daemon.

Offline

#5 2022-06-17 11:33:45

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: How to keep a firefox stream alive when pausing the video

You might be able to configure module-stream restore, the firefox streams should all have should have

module-stream-restore.id = "sink-input-by-application-name:Firefox"

https://gitlab.freedesktop.org/pipewire … am-restore


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2022-06-17 17:44:42

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: How to keep a firefox stream alive when pausing the video

It works by setting following in ~/.local/state/wireplumber/restore-stream:

Output/Audio:application.name:Firefox:target=Nullsink

That's the same as setting 'Nullsink' (virtual device) as (application-specific) output in 'pavucontrol' (it creates the entry above).

It's not properly reflected into the pipewire-jack backend though. 'Carla' has visual issues (orphaned connections) but 'qpwgraph' shows it properly. Should be a pipewire issue.
Edit: I could fix it by deleting the 'restore-stream' file but its probably a much more complicated bug.

Last edited by Maniaxx (2022-06-17 19:32:08)


sys2064

Offline

Board footer

Powered by FluxBB