ShanonPearce / ASH-Listening-Set

A dataset of filters for headphone correction and binaural synthesis of spatial audio systems on headphones
Other
58 stars 2 forks source link

Linux support #6

Closed fiftydinar closed 8 months ago

fiftydinar commented 10 months ago

EasyEffects with PipeWire made Linux more audio capable & easy to use than ever before. But not for virtual headphone surround yet. Although, virtual surround support is possible with Pipewire, it is finnicky to set & implement.

In the future, wiki implementation would be nice to address easy & user-friendly Linux support.

ShanonPearce commented 10 months ago

Thanks for bringing PipeWire and EasyEffects to my attention, I was unsure about Linux implementation. I will update the wiki after doing some testing in Linux.

fiftydinar commented 10 months ago

The current issue is that EasyEffects natively only supports stereo configurations: https://github.com/wwmm/easyeffects/issues/1126 https://github.com/wwmm/easyeffects/issues/1312

So I think that only stereo speaker room simulation is possible currently.

There is some workaround for upmixing to multichannel If I see correctly: https://github.com/wwmm/easyeffects/issues/1126#issuecomment-1147748628

But I don't have the configuration to test it.

JamesDSP for Linux has the same issue too: https://github.com/Audio4Linux/JDSP4Linux/issues/73

fiftydinar commented 10 months ago

I got this working!

Here are the steps to use ASH-Listening-Set on Linux:

  1. Download & extract HeSuVi pack of ASH-Listening-Set
  2. Install EasyEffects (Avaliable for most distros. Recommendation is to install flatpak version of it from FlatHub for better compatibility)
  3. Open EasyEffects, open hamburger menu & in "Preferences" toggle on "Launch Service at System Startup" toggle off "Shutdown on Window Closing"
  4. In "Output - Effects" tab, on left pane, click "Add Effect" than "Equalizer".
  5. In "Import Preset", click "GraphicEQ". Apply HpCF for your headphone from "eq/_ASH_HpCFs" folder 5a. If you are going to use other EQ & don't like the default Diffuse Field target HpCF, than apply "Room_Target_Inverse.txt" from "eq/_ASH_Additional_Filters" folder & than apply your own EQ (either through Convolver, APO or GraphicEQ, depending on what you have)
  6. Save the preset & name it however you like.
  7. Click "Pipewire" tab, on left pane, click "Presets Autoloading" & here add the autoload preset matching your headphone.
  8. For Room Simulation wav file, follow this video, with correction that you should use ASH-Listening-Set wav from "hrir" folder: https://www.youtube.com/watch?v=Dc4lSt_-_uw
  9. Once you reboot after all those changes, go to EasyEffects, "Output-Players", than exclude "effect_output.virtual-surround-7.1-hesuvi"
  10. Save preset once again.

Enjoy working virtual surround.

So it goes like this: Stereo - EasyEffects - Surround 7.1 upmix

The only caveat can be increased CPU usage, but I don't have a low-end hardware to test for serious issues. Another caveat is that HRIR preset changing is not possible to do quickly & you have to reboot for changes iirc.

ShanonPearce commented 10 months ago

Thanks for providing the above steps. I tried out EasyEffects on my linux installation and reached step 5, however I'm a bit unsure of the compatibility with the HpCFs. I imported one of the HpCF graphic EQ filters but it doesn't look like all of the frequency bands are loaded in. It seems like it is limited to 32 bands. I also tried using convolution with a HPCF wav file but it only accepts stereo IRs. If this is the case I might need to provide the HpCFs in an alternative format but Ill also do some more testing to confirm.

fiftydinar commented 10 months ago

Thanks for providing the above steps. I tried out EasyEffects on my linux installation and reached step 5, however I'm a bit unsure of the compatibility with the HpCFs. I imported one of the HpCF graphic EQ filters but it doesn't look like all of the frequency bands are loaded in. It seems like it is limited to 32 bands. I also tried using convolution with a HPCF wav file but it only accepts stereo IRs. If this is the case I might need to provide the HpCFs in an alternative format but Ill also do some more testing to confirm.

Oh, I didn't know that Graphic EQ had more than 32 bands. In that case, you can just load another "Equalizer" effect with "Graphic EQ" option & you gain +32 more bands.

Everything else you said is correct.

ShanonPearce commented 10 months ago

I did manage to get the headphone correction step working by converting the mono IRs to stereo and loading them into convolvers within easyeffects. I will have to add stereo versions of the HpCFs to make that step easier for anyone using easyeffects.

I also got the virtual surround working as per the steps provided. There was some popping but that was likely due to me running linux on a virtual machine with limited resources, so CPU usage is probably not a big issue in reality. I think one thing that would be nice is a more convenient way to change between HRIRs/BRIRs so Ill do a bit of digging there.

ShanonPearce commented 10 months ago

I have added steps into the wiki for pipewire / easy effects configuration. Hopefully the steps can be replicated without issues on other user's machines.

fiftydinar commented 10 months ago

I have added steps into the wiki for pipewire / easy effects configuration. Hopefully the steps can be replicated without issues on other user's machines.

Thanks! I read everything & I find it very good.

The only addition needed, is the last step of saving the preset again, when excluding "effect_output.virtual-surround-7.1-hesuvi". That's because disabling & excluding apps from the audio stream is tied to the preset.

I asked myself before "Why is app excluding not saving" & I found the github issue where developer indicated that you should save the preset after doing that. UI department there needs improvement for sure.

fiftydinar commented 8 months ago

Closing this issue, as ASH Listening Set gained Linux support.