wwmm / easyeffects

Limiter, compressor, convolver, equalizer and auto volume and many other plugins for PipeWire applications
GNU General Public License v3.0
6.12k stars 264 forks source link

mutichannel (routing)? #1126

Open capoei opened 2 years ago

capoei commented 2 years ago

Is there any way to add multi-channel mangement/routing? just as an example my use case (which would also require the adition of the possibility of a other instance of the convolver): stereo signal > room correction convolution > crossovers via convolution resulting in 4 channels > routing of channels to my audio interface outputs

wwmm commented 2 years ago

Is there any way to add multi-channel mangement/routing?

Unfortunately not. There are other open issues asking for similar multichannel features too. But integrating them in an application that evolved around stereo audio processing is really hard. From the user interface to our presets system and effects pipeline the amount of changes required to handle multichannel features properly is huge. And to make things harder I do not have a surround system. My speakers are a stereo 2.0 from Edifier. They are good but not suitable to actually develop multichannel features.

As what you ask seems to require that only the output node actually need to have more than 2 outputs it may be a little more doable than what other people are asking. Let's keep this issue open for now.

which would also require the adition of the possibility of a other instance of the convolver

Like most of the plugins we use our convolver only has 2 input/output ports. A new plugin capable of outputting more than 2 channels while having 2 input channels would be required. And it would probably have to be the last plugin in the pipeline.

capoei commented 2 years ago

so there is no wa to include a "split" plugin that splits the plugin chain into 2 or more (stereo ones)? also when I talked about another instance, it is atm not possible even in the stereo chain. I can't put one convolver after another. and yes, the crossover would be the last in the chain anyways. so mayby it is posssible to make a "output plugin" where you could put other plugins in paralel?

capoei commented 2 years ago

the "output plugin" could have a split feature, where on every split you get 2 new outputs with the stereo inputs. that way the 5.1 guys could make 4 chains and control front/back/center/LFE independently on the output

wwmm commented 2 years ago

so there is no wa to include a "split" plugin that splits the plugin chain into 2 or more (stereo ones)?

Not inside EasyEffects. But I think it can be done if you create a PipeWire loopback device and set it as your default output. Or if you select it as EasyEffects output in our device selection menu. Loopback devices should be able to do something close to what you want. Take a look at https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1447#note_1006488

capoei commented 2 years ago

is it maybe possible to extend the output section in the pipewire tab so that we can select a running aplication as output device?

wwmm commented 2 years ago

is it maybe possible to extend the output section in the pipewire tab so that we can select a running aplication as output device?

It depends on what kind of application you are thinking about. Usually the target application is the one that should be exporting a standard output device that would be naturally visible in our device selection menu.

capoei commented 2 years ago

jack standalone apps like the LSP ones. they wont show up. but I guess I have to create a sink for this to work and it will show up in EE

Em dom., 5 de set. de 2021 às 10:50, Wellington Wallace < @.***> escreveu:

is it maybe possible to extend the output section in the pipewire tab so that we can select a running aplication as output device?

It depends on what kind of application you are thinking about. Usually the target application is the one that should be exporting a standard output device that would be naturally visible in our device selection menu.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wwmm/easyeffects/issues/1126#issuecomment-913158333, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFLJROG5YAIRDZ7QDPKH3P3UANYQ5ANCNFSM5DIZZDCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

capoei commented 2 years ago

ok. pw-link is what I need. never mind

Em dom., 5 de set. de 2021 às 11:18, Fábio Wolarski @.***> escreveu:

jack standalone apps like the LSP ones. they wont show up. but I guess I have to create a sink for this to work and it will show up in EE

Em dom., 5 de set. de 2021 às 10:50, Wellington Wallace < @.***> escreveu:

is it maybe possible to extend the output section in the pipewire tab so that we can select a running aplication as output device?

It depends on what kind of application you are thinking about. Usually the target application is the one that should be exporting a standard output device that would be naturally visible in our device selection menu.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wwmm/easyeffects/issues/1126#issuecomment-913158333, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFLJROG5YAIRDZ7QDPKH3P3UANYQ5ANCNFSM5DIZZDCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

capoei commented 2 years ago

still, using pw-link I probably can't avoid EE to connect to the fiscal device, too?

Em dom., 5 de set. de 2021 às 11:26, Fábio Wolarski @.***> escreveu:

ok. pw-link is what I need. never mind

Em dom., 5 de set. de 2021 às 11:18, Fábio Wolarski < @.***> escreveu:

jack standalone apps like the LSP ones. they wont show up. but I guess I have to create a sink for this to work and it will show up in EE

Em dom., 5 de set. de 2021 às 10:50, Wellington Wallace < @.***> escreveu:

is it maybe possible to extend the output section in the pipewire tab so that we can select a running aplication as output device?

It depends on what kind of application you are thinking about. Usually the target application is the one that should be exporting a standard output device that would be naturally visible in our device selection menu.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wwmm/easyeffects/issues/1126#issuecomment-913158333, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFLJROG5YAIRDZ7QDPKH3P3UANYQ5ANCNFSM5DIZZDCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

capoei commented 2 years ago

ok. I use pactl to create a selectable device in EE and manage the conections with pw-link.

wwmm commented 2 years ago

ok. I use pactl to create a selectable device in EE and manage the conections with pw-link.

In these cases where a very specific solution is needed this is probably the better option. It will give you more flexibility.

Digitalone1 commented 2 years ago

@capoei which distribution are you using? Could you install easyeffects-git from AUR or compile from source to test the upmixing feature that I'd like to integrate in the application (only for the stream coming from the output pipeline)?

capoei commented 2 years ago

I understand the limitations, but I think it is possible to dream of an all-in-on DSP solution like equalizer-APO is for Windows. Now, obviously Pipepire is still in heavy development and I am thankful EE exists already at this early stage.

Em dom., 5 de set. de 2021 às 12:30, Wellington Wallace < @.***> escreveu:

ok. I use pactl to create a selectable device in EE and manage the conections with pw-link.

In these cases where a very specific solution is needed this is probably the better option. It will give you more flexibility.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wwmm/easyeffects/issues/1126#issuecomment-913176014, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFLJROAUGJFGIYP56MMKZILUAOELHANCNFSM5DIZZDCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

capoei commented 2 years ago

@capoei which distribution are you using? Could you install easyeffects-git from AUR or compile from source to test the upmixing feature that I'd like to integrate in the application (only for the stream coming from the output pipeline)?

just installed easyeffects-git-6.1.0.r30 from AUR. couldn't find said feature. is it suposed to appear in the plugin list?

Digitalone1 commented 2 years ago

just installed easyeffects-git-6.1.0.r30 from AUR. couldn't find said feature. is it suposed to appear in the plugin list?

No, I will add it in the next days.

I will notice you when it's ready.

capoei commented 2 years ago

ok

Digitalone1 commented 2 years ago

@capoei unfortunately the solution I implemented a month ago it's not working anymore.

Until Pipewire does not introduce an easy and transparent way to do channel remapping, or @wwmm to find some better solution, this issue won't be resolved.

@capoei I recommend you to return to stable easyeffects from Arch upstream repository.

capoei commented 2 years ago

gotcha

capoei commented 2 years ago

this filter chain stuff is not usefull? https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Filter-Chain#virtual-surround

wwmm commented 2 years ago

this filter chain stuff is not usefull?

The filter chain is designed for people that want to set a few filters editing a few configuration files. It is not convenient for use in third party tools. Setting parameters for it on the fly or getting input and output levels will probably be a pain. Assuming it is even possible.

Digitalone1 commented 2 years ago

Indeed this should be done by Pipewire in a transparent way, as it is done with resampling.

Digitalone1 commented 2 years ago

@capoei if you can test, make a PKGBUILD text file with the following content: https://pastebin.com/ANi6e62u

And install with

makepkg -sri

Open dconf, locate

/com/github/wwmm/easyeffects/loopback-mode

and set it TRUE. Close easyeffects from terminal:

easyeffects -q

Restart it and play something. Let me know if the channel remapping is working.

capoei commented 2 years ago

Screenshot_20210927_145736

JohnyPeaN commented 2 years ago

Hi @Digitalone1, could the loopback test fork be brought up to date with master or even merged? I'm using that fork for a while and it is usable. Its at least better solution than no solution.

Digitalone1 commented 2 years ago

@JohnyPeaN Can you link it here? I made it months ago, don't even remember it.

Digitalone1 commented 2 years ago

@JohnyPeaN are you using #1171? As far as I remember, it was working to me, but then Pipewire upgraded and I was not able to get it working anymore. Is it working to you?

JohnyPeaN commented 2 years ago

This one. https://github.com/Digitalone1/easyeffects/tree/loopback Its version 6.1.2 so those commits are quite off and don't apply.

JohnyPeaN commented 2 years ago

@JohnyPeaN are you using #1171? As far as I remember, it was working to me, but then Pipewire upgraded and I was not able to get it working anymore. Is it working to you?

Yes, seems to be the same. Working here on newest pipewire (0.3.51).

Digitalone1 commented 2 years ago

Are you sure this is working? I tested the loopback at that time on my stereo stream and I got no output. Which distribution are you using?

Digitalone1 commented 2 years ago

@JohnyPeaN are you using #1171? As far as I remember, it was working to me, but then Pipewire upgraded and I was not able to get it working anymore. Is it working to you?

Yes, seems to be the same. Working here on newest pipewire (0.3.51).

Which distribution?

Anyway I'd like to try. I don't assure it will be merged, but at least I can try to make it work.

JohnyPeaN commented 2 years ago

Garuda. Yes I'm using crystalizer plugin on stereo source - mediaplayer, it applies the effect and plays on 5.1 output filling all channells and LFE just like without it. I hear the change when toggling the effect.

Have these settings different from default in pipewire-client.conf:

channelmix.mix-lfe = true channelmix.upmix = true channelmix.lfe-cutoff = 240 channelmix.fc-cutoff = 6000 channelmix.rear-delay = 12.0 channelmix.stereo-widen = 0.1

JohnyPeaN commented 2 years ago

@JohnyPeaN are you using #1171? As far as I remember, it was working to me, but then Pipewire upgraded and I was not able to get it working anymore. Is it working to you?

Yes, seems to be the same. Working here on newest pipewire (0.3.51).

Which distribution?

Anyway I'd like to try. I don't assure it will be merged, but at least I can try to make it work.

Thanks, that would be great. If it has to be enabled by user, hopefully shouldn't break for others. If you need testing, let me know.

Digitalone1 commented 2 years ago

So you see an EasyEffects Channel Remapping Loopback stream in pavucontrol all the time?

JohnyPeaN commented 2 years ago

Yes. This is the graph: https://imgur.com/a/oaZ8gmT

JohnyPeaN commented 2 years ago

So you see an EasyEffects Channel Remapping Loopback stream in pavucontrol all the time?

Sorry EasyEffects Channel Remapping Loopback is visible in graph, not in pavucontrol. In pavucontrol only EasyEffects Sink and EasyEffects Loopback Sink are added as outputs: https://imgur.com/a/1tdlHtf

Digitalone1 commented 2 years ago

Do you see also something by Easyeffects in the first tab (Players) of pavucontrol?

Anyway I could try it out in the next week.

JohnyPeaN commented 2 years ago

Yes, output from media application goes to EasyEffects Sink. The path from EasyEffects Loopback Sink to sound card isn't visible on first tab in pavucontrol.

Screenshot_Volume Control_1

Digitalone1 commented 2 years ago

Please change the combobox in the bottom bar to All Streams, you should see also the loopback sink.

You should also be able to switch from EasyEffects Sink to the loopback sink in the combobox related to the application (do not do it anyway).

Because of the reasons above, we did not implement a loopback sink because that could lead to confusion in users.

Pipewire should provide an easy way for us to make the upmixing, but for now it seems not possible because we are forced to manually link the last filter to the chosen output device/sink.

A workaround for this issue could be showing the loopback sink into our output device list, so you can choose it and Pipewire will do the upmixing on it's own to the speakers.

Can you generate a lookback sink and check if it is selectable from the output device in the latest EasyEffects version?

Take a look here on how to set a lookback sink. You should manually link it to the speaker in helvum.

JohnyPeaN commented 2 years ago

Thanks, you are right. It is in hidden streams: Screenshot_Volume Control_2

Regarding the loopback in latest easyeffects is this what you meant?: Screenshot_EasyEffects_1 I created it with pw-loopback

Digitalone1 commented 2 years ago

Check if you can select it as output device in Pipewire tab.

Digitalone1 commented 2 years ago

But before exclude it from Applications list in EasyEffects, then link it to your speaker.

JohnyPeaN commented 2 years ago

Added loopback to Excluded Apps (disapeared from list), linked it to speakers with pavucontrol and it cannot be selected in easyeffects PipeWire tab as output. Doesn't show up in device list.

Digitalone1 commented 2 years ago

Okay, but is the lookback sink playing to your speakers?

You should be able to redirect it to your speakers through pavucontrol

The scheme should be like this in Helvum:

app output audio -> EasyEffects Sink -> various effects filters like compressor/equalizer -> output_level filter -> loopback sink

And

loopback output virtual device > multichannel speakers

You could redirect the output from loopback device to the speakers in pavucontrol (in playback tab). If everything works and Pipewire is configured properly, you should have the upmixing working.

Anyway, we should do some code refactoring to ignore loopback streams in EE app list and add loopback device in output devices list to be selectable.

JohnyPeaN commented 2 years ago

It works as you described with new easyeffects: Screenshot_20220414 Is this actually what loopback branch did?

All channels playing with effect applied. If I bypass the effect, the difference can be heard. If I disable and enable the stream (in EE) it breaks the graph and playback.

Disable: Screenshot_20220415

Reenable: Screenshot_20220416

I suppose this does make sense, since EE doesn't manage the loopback as output. Some times enable action cause the stream to get "suspended" and enable check imeediatelly dissapears. Connection graph is the same as in third picture but playback stops.

Digitalone1 commented 2 years ago

No, the loopback branch was an attempt to test a loopback device loaded by EasyEffects. But it's too hard to manage for us and it's highly error prone (it wasn't even working when I tested it many months ago).

Ideally Pipewire would offer us a way to link the output_level filter to the multichannel output device so that the upmixing is automatically done, but this is not possible. The only way this works is by linking streams to sinks. But it does not work linking filters to sinks: so we have to do it manually and no upmixing can be performed.

When the effects order changes or the enable checkbutton is toggled, EasyEffects remake all the connections, that's why you loose the upmixing and the "graph is broken".

To solve this issue some tasks have to be done:

The user still have to redirect the output lookback to the multichannel speaker, but at least it will work, even if effects are changed.

@wwmm Any hint on how to detect lookback devices? Have they a specific property? Should we show virtual devices in the output device list to let the user handle these kind of configurations (not the EasyEffects sink obviously)?

JohnyPeaN commented 2 years ago

Thanks for the explanation. If I understand correctly, with this solution, user would need to preconfigure loopback and EE would allow them to select it as output device. Then rebuilding connections would work correctly. That would be better than the situation we have. Before finding your loopback branch a while back I was actually trying the manual loopback way, but couldn't find a way to automatically connect EE output to the loopback and make it stick. I think user can create loopback device already connected to specific sink. I'm not sure how it goes for source, when nothing is specified it connects to preffered capture device.

Digitalone1 commented 2 years ago

Thanks for the explanation. If I understand correctly, with this solution, user would need to preconfigure loopback and EE would allow them to select it as output device. Then rebuilding connections would work correctly. That would be better than the situation we have.

Exactly. Keep using the loopback branch for now. Maybe in the next weeks I should be able to implement the fix mentioned above so you could use the master branch.

I think user can create loopback device already connected to specific sink. I'm not sure how it goes for source, when nothing is specified it connects to preffered capture device.

Yes, try to experiment with the commands listed here: https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Virtual-Devices#loopback

JohnyPeaN commented 2 years ago

Ok, will do both. Thanks.

wwmm commented 2 years ago

@wwmm Any hint on how to detect lookback devices?

As I do not use loopback devices I am not sure. But if we are lucky there is some tag telling it is a loopback. The thing is I am not sure it is a good idea to just ignore them. A long time ago in PulseEffects there were people with valid reasons to apply effects to loopback streams. I think it is useful when redirecting smartphone audio to the computer through a bluetooth connection. I would have to find the issue where this was discussed.

Should we show virtual devices in the output device list to let the user handle these kind of configurations (not the EasyEffects sink obviously)?

Virtual sources should already be visible. I am not sure about virtual sinks. But I think it is a good thing to do as long our own virtual sink is not shown in the process.

wwmm commented 2 years ago

I would have to find the issue where this was discussed.

I've found it https://github.com/wwmm/easyeffects/issues/567#issuecomment-529735799. Blocking loopback streams by default is not a good idea.