Author Topic: Equalizer Settings  (Read 1313 times)

Zzyzx

  • Posts: 68
Equalizer Settings
« on: 18 Feb '23 - 19:45 »
For the standard DSP equalizer, it appears the settings are encoded in xmplay.ini somewhere in the DSP entry?
DSP=FF0001002800010000006EDBB6407A9EA74055555540FDFF7FBF673E69BF3333B3BF9CDF0240D504A340F549FF40000200100000000000000000000000000000008041

Is there any doc on how the DSP entry is encoded? (nothing fancy, I'm a developer, even a code snippet would be helpful)

I want to fine tune a few settings.
Doing that via the options or various skins is a pain since many have different bands shown and different amounts of adjustments with their sliders.
I'd also like to get an in-between setting, for example -2.85 instead of -2.80 or -2.90. What's the resolution?

I suppose I could make individual changes and diff the DSP entry to see which bytes/bits changed, but I was hoping for a little shortcut to that.

Many Thanks!

Firebrand

  • Posts: 30
Re: Equalizer Settings
« Reply #1 on: 19 Feb '23 - 18:52 »
Another option could be to be able o type values for equalizer bands somewhere in the config windows, they could be limited to minimum and maximum values allowed  :).

Zzyzx

  • Posts: 68
Re: Equalizer Settings
« Reply #2 on: 19 Feb '23 - 21:02 »
Another option could be to be able o type values for equalizer bands somewhere in the config windows, they could be limited to minimum and maximum values allowed  :).

That would be cool as well.

Without asking for any changes to the code, I was hoping to just understand how the values are encoded into the ini file, I could then just change them in a text editor.

Ian @ un4seen

  • Administrator
  • Posts: 25866
Re: Equalizer Settings
« Reply #3 on: 20 Feb '23 - 11:36 »
While searching to see if I had already described the format of the XMPLAY.INI "DSP" entry, I found that you had actually asked the same question back in 2018 :)

   www.un4seen.com/forum/?topic=18029

Let me know if it's still unclear.

Zzyzx

  • Posts: 68
Re: Equalizer Settings
« Reply #4 on: 20 Feb '23 - 18:03 »
While searching to see if I had already described the format of the XMPLAY.INI "DSP" entry, I found that you had actually asked the same question back in 2018 :)

   www.un4seen.com/forum/?topic=18029

Let me know if it's still unclear.

lol, I'm sorry, I should have searched first.

That was the last time I made changes to my system, and I couldn't recall if I had tried manually adjusting the EQ settings or was just happy enough with the slider adjustment. I just overhauled it again, and was fine tuning it. Tribute to XMPlay that it's still the audio player I use!

I'll play around with that info and see what I can do. This time, I'll put the notes in Evernote so I can find them for next time.  ::)

Thanks!

Zzyzx

  • Posts: 68
Re: Equalizer Settings
« Reply #5 on: 20 Feb '23 - 18:37 »
While searching to see if I had already described the format of the XMPLAY.INI "DSP" entry, I found that you had actually asked the same question back in 2018 :)

   www.un4seen.com/forum/?topic=18029

Let me know if it's still unclear.

I was trying to break the DSP string down...

Code: [Select]
DSP=FF0001002800010000006EDBB6407A9EA74055555540FDFF7FBF673E69BF3333B3BF9CDF0240D504A340F549FF40000200100000000000000000000000000000008041

                            63 Hz   125 Hz   250 Hz   500 Hz    1 kHz    2 kHz    4 kHz    8 kHz   16 kHz
FF 0001 00 2800 01000000 6EDBB640 7A9EA740 55555540 FDFF7FBF 673E69BF 3333B3BF 9CDF0240 D504A340 F549FF40 000200100000000000000000000000000000008041
                           3.3998   4.1188   1.4660  -4.2452   8.9920   4.1840  -1.4757    -9114  -2.5606

 63 Hz  = +4.7
125 Hz  = +2.2
250 Hz  = +0.5
500 Hz  = -4.5
  1 kHz = -5.4
  2 kHz = -4.3
  4 kHz =  0.0
  8 kHz = +2.6
 16 kHz = +7.0

Do I have the field parsing correct at the top?

I tried the combinations of big/little/mid-big/mid-little endian IEEE-754 float conversions (big endian values under the parsed string), and I couldn't get the numbers to match what I have with the slider settings (at the bottom).
I'm guessing I either have the fields broken out incorrectly, or the float format is something different than IEEE-754?

Thanks for any tips!


Ian @ un4seen

  • Administrator
  • Posts: 25866
Re: Equalizer Settings
« Reply #6 on: 21 Feb '23 - 13:14 »
The gains are IEEE-754 numbers stored in little-endian order (as they are in memory). So, for example, the byte sequence of 6E DB B6 40 = 0x40B6DB6E = 5.7142

Here's a handy webpage for converting between IEEE-754 and hex:

   https://www.h-schmidt.net/FloatConverter/IEEE754.html

Zzyzx

  • Posts: 68
Re: Equalizer Settings
« Reply #7 on: 21 Feb '23 - 22:32 »
The gains are IEEE-754 numbers stored in little-endian order (as they are in memory). So, for example, the byte sequence of 6E DB B6 40 = 0x40B6DB6E = 5.7142

Thanks, but I tried little endian for them all.

They still don't seem to map to any of the actual slider values I have listed below.
For example, 125Hz I have set to +2.2, and the little endian conversion from the second EQ position in the string shows +5.2380.

Do I have the EQ field breakouts wrong, or the order of the EQ bands off?
Is there some other offest or scaling or something going on?

Code: [Select]
                            63 Hz   125 Hz   250 Hz   500 Hz    1 kHz    2 kHz    4 kHz    8 kHz   16 kHz
FF 0001 00 2800 01000000 6EDBB640 7A9EA740 55555540 FDFF7FBF 673E69BF 3333B3BF 9CDF0240 D504A340 F549FF40 000200100000000000000000000000000000008041
                           5.7142   5.2380   3.3333  -0.9999  -0.9111  -1.4000   2.0448   5.0943   7.9777   <-- little endian conversions

 63 Hz  = +4.7
125 Hz  = +2.2
250 Hz  = +0.5
500 Hz  = -4.5
  1 kHz = -5.4
  2 kHz = -4.3
  4 kHz =  0.0
  8 kHz = +2.6
 16 kHz = +7.0

Thanks!

Ian @ un4seen

  • Administrator
  • Posts: 25866
Re: Equalizer Settings
« Reply #8 on: 22 Feb '23 - 13:52 »
That's strange. Are you sure the EQ levels are set as you describe, eg. that's what it says if you leave the mouse hovering over the EQ sliders? I tried copy'n'pasting your "DSP" entry into my XMPLAY.INI file and I got the levels that the conversion says, eg. 125hz = 5.2380 (not 2.2).

Zzyzx

  • Posts: 68
Re: Equalizer Settings
« Reply #9 on: 22 Feb '23 - 16:58 »
That's strange. Are you sure the EQ levels are set as you describe, eg. that's what it says if you leave the mouse hovering over the EQ sliders? I tried copy'n'pasting your "DSP" entry into my XMPLAY.INI file and I got the levels that the conversion says, eg. 125hz = 5.2380 (not 2.2).

I'm 100% sure the EQ settings I have listed vertically at the bottom are what shows when I mouse hover over each EQ band. I even checked a few different skins in case that mattered.

I don't have access to that computer at the moment, but I'll double check that I'm looking at the correct xmplay.ini file, I thought I had copied the DPS line out of the xmplay.ini in the main program folder, maybe I grabbed a backup or something.

In any case, if you confirmed you can round trip the values from manual entry in the .ini back to the UI slider values, then I must be mixing something up. Let me take a better look at what I'm doing and I can try the same round trip test to see.

Many thanks for your help!

Zzyzx

  • Posts: 68
Re: Equalizer Settings
« Reply #10 on: 23 Feb '23 - 04:33 »
That's strange. Are you sure the EQ levels are set as you describe, eg. that's what it says if you leave the mouse hovering over the EQ sliders? I tried copy'n'pasting your "DSP" entry into my XMPLAY.INI file and I got the levels that the conversion says, eg. 125hz = 5.2380 (not 2.2).

OK, I learned something...

The current xmplay.ini is located in C:\Users\Zzyzx\AppData\Local\VirtualStore\Program Files (x86)\XMPlay\ not in the program folder.

Well, there is also one in the program folder, but it is pretty old. So the EQ values I was looking at were for my prior set up, not the current settings.

Now that I'm using what seems to be the most current & updated xmplay.ini, the values in the DSP string actually do match the slider values.

So, all is good.

Does that location for xmplay.ini make sense, or is my installation off?

Thanks!

Ian @ un4seen

  • Administrator
  • Posts: 25866
Re: Equalizer Settings
« Reply #11 on: 23 Feb '23 - 16:52 »
With default Windows settings, XMPlay won't be able to write to the Program Files folder (unless you run it as admin) and Windows will automatically put any such files in the "VirtualStore". You can prevent that happening by moving XMPlay out of Program Files, or alternatively enabling the "Store per-user config/etc" option (in the Miscellaneous options page) to have them written in "C:\Users\Zzyzx\AppData\Roaming\XMPlay\" (aka "%AppData%\XMPlay") instead. It might actually be a good idea to have XMPlay detect when it's in Program Files and enable that option automatically then - I'll look into it.

Zzyzx

  • Posts: 68
Re: Equalizer Settings
« Reply #12 on: 23 Feb '23 - 18:12 »
With default Windows settings, XMPlay won't be able to write to the Program Files folder (unless you run it as admin) and Windows will automatically put any such files in the "VirtualStore". You can prevent that happening by moving XMPlay out of Program Files, or alternatively enabling the "Store per-user config/etc" option (in the Miscellaneous options page) to have them written in "C:\Users\Zzyzx\AppData\Roaming\XMPlay\" (aka "%AppData%\XMPlay") instead. It might actually be a good idea to have XMPlay detect when it's in Program Files and enable that option automatically then - I'll look into it.

That's interesting, thanks!

I've had XMPlay running on this little media PC for a couple of years now. The only change is that I've updated xmplay.exe when new versions come out.

The xmplay.ini in the program directory was last updated Dec 2022. I'm pretty sure I had it running as admin before, if I recall it was because that fixed something way back when (don't remember what).

I notice now both the shortcut I start XMPlay with, as well as xmplay.exe itself no longer have run as admin set. I'm guessing at some point it got turned off and Windows diverted xmplay.ini to the virtual folder.

Just for kicks, I'm going to enable set run as admin again and see if it starts updating in the program folder (think it should). I'd prefer to have everything together in one place if possible, having files spread out gets confusing.

Ian @ un4seen

  • Administrator
  • Posts: 25866
Re: Equalizer Settings
« Reply #13 on: 24 Feb '23 - 12:38 »
Another way that you may be able to have the XMPlay config files written in the same folder (without running as admin) is to give all users full control over the folder, like this: right-click on the XMPlay folder, open the "Security" tab, click "Edit", select "Users" from the list, tick the "Allow" box next to "Full control", and then apply.