HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: wcs13 on 2020-09-12 00:32:03

Title: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-09-12 00:32:03
Hi everyone,

I forgot to say "simultaneously"  :D Here's the story :
My GF and I have two pairs of headphones (which we're gonna upgrade soon). We like to listen to them simultaneously and compare our impressions on music.
I'd like to EQ both headphones to get the most out of them, using sites like this one : https://www.reddit.com/r/oratory1990/wiki/index/list_of_presets
But of course if I add an EQ to foobar's DSP, that EQ will apply to both headphones, so it will only be ideal for one of them.

So what I'd like somehow would be foobar to output simultaneously on two different outputs (two USB ports I guess), each output having its own EQ preset. Something like this :
FOO --> EQ1 --> USB1 --> DAC1 --> Amp1 --> Headphone1
BAR --> EQ2 --> USB2 --> DAC2 --> Amp2 --> Headphone2

Doesn't sound very easy or even possible. But is there a way ?  :-\

The only thing I've thought would be having two separate instances of foobar, outputting to different USB ports. But that would not be useful at all, because we'd need to perform each song search twice, hit play twice, we couldn't have shortcuts for both instances I guess, etc..

Another solution could be having some external software that would be able to duplicate foobar's output, EQ it individually and output it on both USB ports. Something like this :
foobar --> External software --> output1 --> EQ1 --> USB1
..........................................................--> output2 --> EQ2 --> USB2

Maybe there are other solutions. I don't know.

Thanks in advance for your help.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: Daeron on 2020-09-12 03:28:32
You could potentially sync the songs using something like foo_upnp. Then use foobar on different PCs with their own EQ settings/outputs.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-09-12 09:43:00
Thanks Daeron. Although that would mean having two different PCs.
Here we're talking about listening in the same room, side by side, with only one PC.
Couldn't I sync the songs between two instances of foobar, on a sort of master/slave mode?
Then each instance would output to its own audio device, with its own EQ settings, and the problem would be solved!

Actually it's even more complicated. Instead of having two headphones I could have many (actually I have already more than two). But I would only play two at a time.
So I'd have n headphones, and n instances of foobar, each one with its own settings. And two DACs / headphone amps.
Among these instances, I would select any two at a time: instance A and instance B.
Instance A would output to DAC 1, and instance B would output to DAC 2.
This is what I'd like to achieve.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: Pollux88 on 2020-09-12 11:26:57
Just set up EQ in each of your DAC's control panel. If you're having problems duplicating output, there's software for that like Voicemeeter or AudioRouter. Voicemeeter got to have its own EQ too.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-09-12 13:37:28
Thanks @Pollux88 .

You are assuming that my DACs have a built-in EQ, but it's not the case (https://www.amazon.com/TOPPING-E30-Hi-Res-AK4493-Decoder/dp/B0868J7NRV) unfortunately.

Voicemeeter looks nice since its specs say "3 Inputs (2 physicals / 1 Virtual) and 3 Outputs (2 physicals / 1 Virtual)".
I would need 1 Input (Virtual) from foobar, and 2 Outputs (physical) to DACs.
Unfortunately, Voicemeeter's EQ is very basic (only 3 band).
I'm looking for a parametric EQ with about 10 bands, because that's what's needed for most of the headphone presets that I linked in my OP.

Voicemeeter Banana looks better, because it has a parametric EQ with 6 bands/cells. It's close to what I need : https://vb-audio.com/Voicemeeter/banana.htm

Any clues ? We're almost there ! :D
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: Rollin on 2020-09-12 13:46:52
foobar2000+ASIO4ALL+2 virtual sound cards+2 instances of VSTHost
or, if you can afford Convolver instead of EQ, it will be much simpler:
foobar2000+Matrix Mixer+Convolver+ASIO4ALL
Matrix Mixer copies 2 channels, so signal becomes 4-channel. Then Convolver with 4-channel impulse (with different EQ preliminarily applied to different channels) process this signal. Then ASIO4ALL outputs different channels to different devices using custom channel mapping.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-09-12 14:37:04
Hi Rollin, you're everywhere ! Saving the day again ! :D Thank you.

Actually I think the "simpler" solution would be Voicemeeter Banana, IF it had 10 bands. But it hasn't  :P  I have just emailed the developer, maybe he can add 4 more bands, who knows ?

Yes, I could use convolver instead of EQ, thanks to your excellent tutorial in that other topic. :) So that would mean :

But Audacity's EQ doesn't seem to be a PEQ (with Frequency, Gain, Q-Factor, etc.). And the aforementioned presets require a PEQ. Take this one for example (see attached pic). So if I had a classic 10-band PEQ for Audacity, I guess I could solve my issue. Any clues ?

FYI, if I had more than 2 headphones, that really would complicate things, because i would need to create many pulses. Example :
3 headphones => 3 pulses (pulse12, pulse13, pulse23) for any given frequency
4 headphones => 6 pulses (pulse12, pulse13, pulse14, pulse23, pulse 24, pulse 34) for any given frequency
And that quickly escalates by n! factor (5 headphones = 10 pulses, 6 headphones = 24 pulses...).

Then I guess I would need to create as many instances of foobar as required (because that would be easier than switching pulses). For instance foobar12, foobar13, foobar23. And launch the right instance depending on the used headphones. Am I right, or is there a simpler solution ?
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: Rollin on 2020-09-12 14:50:57
But Audacity's EQ doesn't seem to be a PEQ (with Frequency, Gain, Q-Factor, etc.). And the aforementioned presets require a PEQ. Take this one for example (see attached pic). So if I had a classic 10-band PEQ for Audacity, I guess I could solve my issue. Any clues ?
Audacity supports VST plugins. And Audacity is not the only audio editor. Also, what is problem to just draw EQ curve as seen on picture?
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-09-12 15:07:32
Somehow I knew you would say that, lol.

Another solution would be replacing the 2 DACs by a single multichannel DAC (ex : https://www.gearslutz.com/board/product-alerts-older-than-2-months/1294869-esi-launches-ugm192-gigaport-ex.html ). That would eliminate the need for ASIO4ALL. foobar would just output 4-channel sound every time : foobar2000+Matrix Mixer+Convolver, all to a single USB output.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: sacduser on 2020-09-12 15:59:45
You can equalize your headphones using Minidsp HA-DSP
DSP Headphone amplifier Equalizer.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-09-12 17:54:03
Thanks. That could work for most headphones, but not for some electrostatic headphones like the Koss ESP/95X that come with their own amplifier. I'm looking for an universal solution, since the Koss is in my plans.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: Rollin on 2020-09-12 18:48:34
As for precise parametric eq, ffmpeg has parametric eq - https://ffmpeg.org/ffmpeg-filters.html#equalizer
For example, equalizing impulse for m50 will look like
Code: [Select]
ffmpeg.exe -i "impulse.wav" -af "lowshelf=f=90:g=2.8:t=q:w=0.9, equalizer=f=200:g=-3.3:t=q:w=0.9, equalizer=f=290:g=4.5:t=q:w=1.8, equalizer=f=2800:g=-3.7:t=q:w=1.5, equalizer=f=3670:g=2.7:t=q:w=4.5, equalizer=f=4340:g=-5:t=q:w=4.5, equalizer=f=5800:g=2.8:t=q:w=3.5, equalizer=f=7000:g=-3:t=q:w=6, equalizer=f=8100:g=-4.6:t=q:w=5, highshelf=f=11000:g=-10:t=q:w=0.8" -c:a pcm_f32le "result.wav"
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: sacduser on 2020-09-13 08:23:50
You can output to 2 different headphones with different EQ presets using Jriver. 2 linked zones can be configured with separate parametric equalizer or convolution dsps.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-09-14 03:06:31
Rollin, you always come with great solutions ! But sometimes they are a bit geeky for poor little me. I'm not a CLI expert like you.

Thanks @sacduser . Well, I'm an old foobar fan and I don't intend to change, lol.
I would use JRiver if I could still use foobar's GUI, and just play music on JRiver. In other words, JRiver would need to be pretty invisible to me, as I'd keep using foobar. Is that possible somehow ? Maybe with foo_run or another component ?
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: sacduser on 2020-09-14 07:22:33
You can enable the WDM feature of Jriver and direct the output from Foobar to Jriver.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-09-14 16:43:02
Thanks, I'll look into it.

Unrelated question : let's say I have 4-channel audio going out of foobar. Normally each listener will have volume control via the physical knobs on both headphone amps. But what if there weren't headphone amps ? Just wondering. Would foobar be able to provide separate stereo volume controls for channels 1-2 and channels 3-4 ?

I'm not talking about typing figures in Matrix Mixer, becuse that's unpractical. Rather about keyboard shortcuts. Two keys for Vol+/- on channels 1-2, and two other keys for Vol+/- on channels 3-4. Can this be achieved ?
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-09-17 20:02:59
OK, let's forget about the previous question if nobody can answer it.
I have tried @Rollin 's method (foobar2000+Matrix Mixer+Convolver) and indeed it works !
For that, I have found what seems to be a nice free VST PEQ for Audacity : https://www.kvraudio.com/product/qrange-by-lkjb
(if you have something better to suggest, please do)

So I created a 4-channel impulse with Audacity, then I applied the PEQ to it, and I saved the result (wav 32-bit float).
Then within foobar's DSP Manager, I used Matrix Mixer ("Convert stereo to 4 channels") and Convolver (loading the EQed impulse).
It works ! :D

I'm just not sure of the QRange PEQ settings that I've made (and I haven't found a user manual). Here's my test EQ, taken from here (https://github.com/jaakkopasanen/AutoEq/tree/master/results/innerfidelity/innerfidelity_harman_over-ear_2018/AudioQuest%20NightHawk) :

(https://i.ibb.co/5TDM2S4/2020-09-17-194343.png)

I'm wondering this (remember I'm a beginner on this stuff) :

If anybody can help... Thanks again !
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: Rollin on 2020-09-17 21:01:01
What Process Mode must I choose? (click on the cogwheel to access them). "Low distortion", "Medium Distortion & OK Frequency Response" or "Good Frequency Response" ? I don't really understand the compromise that needs to be made between distortion and frequency response, sorry.
https://lkjbdsp.wordpress.com/2020/05/21/qrange-distortion/
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-09-17 22:13:13
Yes, that explains a lot indeed. However, the author talks about using QRange in real time, for real music and with real time constraints. I'm only using QRange once for a single calculation, with a very simple pulse signal, to transform it and save the result. Then I'm done with QRange. So I don't know what setting would be best for my particular use.

Also, all headphone PEQ presets ask that we reduce the global gain, which is normal. But since we're talking about an impulse here, do I still need to reduce the global gain ? For example here's how the 44.1 KHz pulse looks after EQ, with a global gain of -5.5 dB. Do you see my point ?

Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: sacduser on 2020-09-18 09:32:52
You can find FIR filters for many headphones at https://github.com/jaakkopasanen/AutoEq/tree/master/results. Convolution equalizer settings are provided as WAV files.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: Rollin on 2020-09-18 09:54:34
But since we're talking about an impulse here, do I still need to reduce the global gain ?
Yes.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: Rollin on 2020-09-18 09:57:15
You can find FIR filters for many headphones at https://github.com/jaakkopasanen/AutoEq/tree/master/results. Convolution equalizer settings are provided as WAV files.
Unfortunately, precision of provided impulses is lower than precision you can get with good parametric EQ.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-09-19 02:28:47
For the record I have just realized one thing: why would I need Matrix Mixer when foobar's DSP Manager gives me already the option "Convert stereo to 4 channels" which is exactly what I need? :D
Makes things even simpler.

I still don't know which one of the 3 Process Modes I should choose within QRange though.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-10-05 13:06:15
Here's an update with some info.  ;)

Now that I know that I can EQ the 2 headphones independently with Convolver and a 4-channel signal, I'm also trying to find a PEQ solution that would fit within foobar (so no Equalizer APO). There are lots of VST, but I'm also trying MathAudio Headphone EQ which is a native foobar2000 component : https://mathaudio.com/headphone-eq.htm

The problem with Headphone EQ is that it's a stereo-only component. I've contacted its developer, Sergey, and he says this :

Quote
Headphone EQ is a stereo plug-in. That means it has a single stereo input and a single stereo output. If it is necessary to process two stereo channels, the host program should use two instances of the Headphone EQ plug-in. Each instance works independently and has its own preset. It is necessary to split the audio channel and include two instances of the headphone EQ 'after' the splitter.
And also this :
Quote
If you try to process a 4-channel sound with a stereo plug-in, the host program (Foobar2000 in this case) decides what to do. The host program decides whether it will process two channels or show an error message. The Headphone EQ plug-in doesn't know anything about the source and the destination of the audio stream. It takes two buffers of sound from Foobar2000 and returns two processed buffers to Foobar2000. The plug-in doesn't know where Foobar2000 took that buffers and where Foobar2000 sends them to.

That leaves me wondering how foobar2000 works in that case. What would happen if I gave a 4-channel audio signal to MathLab Headphone EQ via foobar DSP manager : would it crash ? would it EQ only channels 1&2 ? Because if it did, I could find a way to make everything work for my case ! I could set up this DSP chain :

What do you guys think ?
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: Rollin on 2020-10-05 16:17:58
What would happen if I gave a 4-channel audio signal to MathLab Headphone EQ via foobar DSP manager
Not so hard to test it. MathLab Headphone EQ will be entirely bypassed.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-10-05 19:44:58
Entirely bypassed ? I wasn't expecting it, that's a real shame :(
Would it be so hard to modify DSP Manager behaviour, so that when it wants to pass a multichannel audio to a DSP component that only handles stereo audio, at least channels 1&2 are passed instead of completely bypassing the component ?
@Peter or another core dev, if you're listening...
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: Priest_1 on 2020-10-09 21:11:21
You need 3 Foobars.
First F2K send audio to 2 others F2K:
Foobar2000 (first instance) - set output buffer to max. Set output to null output.
Start UPNP server. Send output format = PCM or Wave.
Output - Stereo
Start playing your music or set foo scheduler for to start playing.
Foobar2000 (second and third instances) :
Set output - DAC 1 for F2K (second) and DAC 2 for F2k (third).
Set output stereo or multichannel, whatever you choose (dsp manager options)
Load to dsp manager preset 1 of your VST plugin  - to F2K (second)
Load to dsp manager preset 2 of your VST plugin - to F2K (third)
Set foo scheduler for both to start playing at same time.
Because there is delay in streaming - set foo scheduler to delay time - 7 seconds, is the time for buffering stream for both players when F2K (first instance) start to playing.


Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: Priest_1 on 2020-10-10 00:13:37


With these settings you can't here any delay in sound between both Foobars that receive stream via UPNP protocol.
You need: https://www.foobar2000.org/components/view/foo_upnp and some internet, cable or wireless.
Title: Re: How to output to 2 different headphones with different EQ presets ?
Post by: wcs13 on 2020-12-08 21:49:17
Dear all, this is for future readers.
After a lot of research and hard work, I'm glad to report that I've finally found a solution to my problem !
All details can be found here : https://hydrogenaud.io/index.php?topic=120234.msg991306#msg991306
Thank you all :)