The State of DACs for the MiSTer and Direct Video

Discussion about displays and related hardware including MiSTer filters and video settings.
Atohmdiy
Posts: 156
Joined: Thu Jul 02, 2020 12:20 am
Has thanked: 6 times
Been thanked: 20 times

Re: The State of DACs for the MiSTer and Direct Video

Unread post by Atohmdiy »

kitty666cats wrote: Tue Dec 24, 2024 1:47 pm
AmintaMister wrote: Sat Dec 07, 2024 2:50 pm

OK, so https://it.aliexpress.com/item/10050038 ... pt=glo2ita it's arrived.

Result: black screen with whatsoever combination of cables / settings.

I think it's a loss of time to tinkering with these chinese tinks, our MiSTers deserve quality, so I think the only quality-solutions left for Direct Video are FuryHD (maybe the 4 version) and the internal DAC of MiSTer Addons Saturn connector solution: https://misteraddons.com/products/miste ... s=11&_ss=c

IMG_4604.jpeg
IMG_4603.jpeg
IMG_4602.jpeg

That’s a scaler, of course it isn’t going to work… it says right on the shell

https://www.aliexpress.us/item/22558006 ... 4itemAdapt

^ These things have an Explore EP94Z3 / EP94Z3E. Basically the same as the EP94Z1E only newer and better.

Image I definitely like mine. The HDMI passthrough is nice, too. Might be able to find one on AliEx for a few $ less, too

Except i bought one very similar and toslink output wasn't working. Again stop counting on garbage, it's better for your health...

kitty666cats
Posts: 6
Joined: Wed Dec 13, 2023 3:45 am
Been thanked: 3 times

Re: The State of DACs for the MiSTer and Direct Video

Unread post by kitty666cats »

But you didn’t get the same one? Mine looks great and literally has a slightly newer version of the chip in the Retro Castle dual SDRAM that ranked the absolute highest out of his test results.

I wouldn’t put too much stock in what you are suggesting what to buy/not buy if that last item you linked is a scaler and thus completely useless for direct video

niallquinn
Posts: 215
Joined: Wed Jun 05, 2024 4:54 pm
Has thanked: 218 times
Been thanked: 46 times

Re: The State of DACs for the MiSTer and Direct Video

Unread post by niallquinn »

GradiusV wrote: Sun Dec 22, 2024 4:36 am

Is 256MB really important? Any cores use it ?

Jaguar, Saturn in some 3d titles, PSX in something or other, I forget.

Never know what might use it in the future.

kitty666cats
Posts: 6
Joined: Wed Dec 13, 2023 3:45 am
Been thanked: 3 times

Re: The State of DACs for the MiSTer and Direct Video

Unread post by kitty666cats »

Also - ones that look like this have the EP94Z1E chipset from the aforementioned RetroCastle board Kuro found to be reference quality 🥳

Image

https://www.ebay.com/itm/335161321326
https://www.ebay.com/itm/283644709867
https://www.ebay.com/itm/315478805810
https://www.ebay.com/itm/145892684919

…for anyone who wants one

akeley
Top Contributor
Posts: 1512
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 548 times
Been thanked: 487 times

Re: The State of DACs for the MiSTer and Direct Video

Unread post by akeley »

kitty666cats wrote: Thu Dec 26, 2024 10:10 pm

Also - ones that look like this have the EP94Z1E chipset

That's not guaranteed. The manufacturers often use the same box for different electronics.

kitty666cats
Posts: 6
Joined: Wed Dec 13, 2023 3:45 am
Been thanked: 3 times

Re: The State of DACs for the MiSTer and Direct Video

Unread post by kitty666cats »

ackmangogo wrote: Thu Feb 08, 2024 5:42 am

Found another DAC with silicon image receiver chip, sil9135, cro-dac11 from Imagenics.
Seems like same chip on hdfury 3, according to specs.
https://www.drhdmi.eu/dictionary/hdfury-3.html
https://pdf1.alldatasheet.com/datasheet ... I9135.html
Image
https://imagenics.co.jp/pdf/products/c_cro-dac11.pdf
https://drive.google.com/drive/folders/ ... KLJylmBUnM

Woah, holy shit, this Imagenics thing also has a ADV7123 in it. A lot of the new 24bit boards are using an ADV7125; the ADV7123 is 30bit. So if that thing has the same chip as a HDFury AND a ADV7123, it must be an absolute exceptional quality reference image. Probably better than everything else.

Alas, they’re a billion dollars xD

vanfanel
Posts: 191
Joined: Sun May 24, 2020 6:53 pm
Has thanked: 14 times
Been thanked: 26 times

Re: The State of DACs for the MiSTer and Direct Video

Unread post by vanfanel »

I have an EP94Z1E equipped DAC (https://www.amazon.es/dp/B0C2PHDR7F) that works very well for NES, MegaDrive, SNES, etc, but for cores like PSX that do many videomode changes on the fly, it suffers to re-sync and even loses image sometimes until the next video mode change.
Also, 50Hz systems like the ZX Spectrum, ZXNext and C64 don't work at all.
Do you guys know of a solution for that?

getdls
Posts: 6
Joined: Thu Jan 30, 2025 9:34 pm
Has thanked: 4 times
Been thanked: 3 times

Re: The State of DACs for the MiSTer and Direct Video

Unread post by getdls »

I've been toying around with a gamma correction curve for the AG6200 using Kuro Houous measurements (thnx)
...hoping I could get better results than by setting the ini hdmi_limited=2 (16..255) for the cheap dongles..

However.. I can't really say if initial value when correcting should start from 16 or 0 ?

That is, if we had more measuring points in the original mV between 0 and 24, (0 24 98 170 248 344 414 486 562 632 700)
Would it be closer to a very steep 0 [20,24,24] 24 or a more interpolated 0 [6,12,18,24] 24 ?

Code: Select all

corrected_std_dev_8bit = np.array([  16,  38,  64,  88, 111, 127, 153, 176, 202, 227, 252])
corrected_std_dev_8bit = np.array([  0,  38,  64,  88, 111, 127, 153, 176, 202, 227, 252])

Code: Select all

import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt

# Corrected values
corrected_std_dev_8bit = np.array([  16,  38,  64,  88, 111, 127, 153, 176, 202, 227, 252])
corrected_median_8bit = np.array([  16,  39,  63,  88, 113, 129, 155, 181, 206, 231, 255])

# Reference points (IRE levels) corresponding to the 8-bit values
ire_levels = np.linspace(0, 255, len(corrected_std_dev_8bit))

# Cubic interpolation function
f_std_dev = interp1d(ire_levels, corrected_std_dev_8bit, kind='cubic')
f_median = interp1d(ire_levels, corrected_median_8bit, kind='cubic')

# Generate new points for interpolation (0 to 255)
new_ire_levels = np.arange(0, 256)

# Interpolated values
std_dev_interpolated = f_std_dev(new_ire_levels)
median_interpolated = f_median(new_ire_levels)

# Printing the interpolated values
print("Interpolated Corrected Standard Deviation Values (0 to 255):")
print(std_dev_interpolated.astype(int))

print("\nInterpolated Corrected Median Values (0 to 255):")
print(median_interpolated.astype(int))

# Plotting the interpolated values
plt.figure(figsize=(12, 8))
plt.plot(new_ire_levels, std_dev_interpolated, label='Interpolated Corrected Standard Deviation Curve', color='red')
plt.plot(new_ire_levels, median_interpolated, label='Interpolated Corrected Median Curve', color='green')

plt.xlabel('IRE Level')
plt.ylabel('8-bit Value')
plt.title('Cubic Interpolation of Corrected Values')
plt.legend(loc='upper left')
plt.grid(True)
plt.show()
getdls
Posts: 6
Joined: Thu Jan 30, 2025 9:34 pm
Has thanked: 4 times
Been thanked: 3 times

Re: The State of DACs for the MiSTer and Direct Video

Unread post by getdls »

Did some poking around and my best guess is that it should be in the 16 range.

However, when you take a look at how the HDMI limit will work in the init file, the actual error between that and the (median) correction curve is relatively small. So, I guess I'll just stick to using the init fix :)

ploterror.png
ploterror.png (73.48 KiB) Viewed 1759 times

Code: Select all

import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt

# Original correction curve values
correction_curve = np.array([16, 39, 63, 88, 113, 129, 155, 181, 206, 231, 255])

# HDMI limited 2 coefficients
hdmi_limited_2_coeffs = np.array([0.93701171875, 0.93701171875, 0.93701171875])

# Create IRE levels (0-255 range)
ire_levels = np.linspace(0, 255, len(correction_curve))
new_ire_levels = np.arange(0, 256)

# Compute the HDMI limited 2 corrections over the 0-255 range
hdmi_limited_2_curve = (new_ire_levels * hdmi_limited_2_coeffs[0] + 16).astype(int)

# Interpolation functions for the gamma correction curves
f_correction = interp1d(ire_levels, correction_curve, kind='cubic')

# Interpolated values for the full 0-255 range
correction_interpolated = f_correction(new_ire_levels)

# Calculate the absolute error
absolute_error = np.abs(correction_interpolated - hdmi_limited_2_curve)

# Calculate the relative error (in percentage)
relative_error = (absolute_error / correction_interpolated) * 100

# Plotting the curves
plt.figure(figsize=(12, 8))
plt.plot(new_ire_levels, correction_interpolated, label='Interpolated Correction Curve', color='green')
plt.plot(new_ire_levels, hdmi_limited_2_curve, label='HDMI Limited 2 Curve', color='purple', linestyle='-.')
plt.plot(new_ire_levels, absolute_error, label='Absolute Error', color='blue', linestyle='--')
plt.plot(new_ire_levels, relative_error, label='Relative Error (%)', color='red', linestyle=':')

plt.xlabel('IRE Level')
plt.ylabel('8-bit Value / Percentage')
plt.title('Error Analysis: Interpolated Correction Curve vs. HDMI Limited 2 Curve')
plt.legend(loc='upper left')
plt.grid(True)
plt.show()

# Printing the absolute and relative errors
print("Absolute Error (0-255):")
for val in absolute_error.astype(int):
    print(val)

print("\nRelative Error (percentage):")
for val in relative_error:
    print(f"{val:.2f}%")
akeley
Top Contributor
Posts: 1512
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 548 times
Been thanked: 487 times

Re: The State of DACs for the MiSTer and Direct Video

Unread post by akeley »

getdls wrote: Sun Feb 02, 2025 7:40 pm

So, I guess I'll just stick to using the init fix :)

So, is that code above a sort of solution for the AG6200 et al? If yes, how would a mere mortal go about applying it in practice?

getdls
Posts: 6
Joined: Thu Jan 30, 2025 9:34 pm
Has thanked: 4 times
Been thanked: 3 times

Re: The State of DACs for the MiSTer and Direct Video

Unread post by getdls »

The result was more or less that while it was a solution, our error margin (deviation) means that we can't say that it's better or worse than just setting hdmi_limited_2 in mister.ini. While it's tempting to say that it's slightly better around the 120-150 range, the "hump" there is still within the standard (std) deviation. Ie I don't think it's worth the extra hassle

Now if I could specifically measure my own crappy DAC.. then that would have been a different story :)

If you're still curious, stick the code below into this site (https://python-fiddle.com/examples/matplotlib) and hit play. It will return back two columns (0-255 range) that you can copy and paste into two separate gamma_AG6200.txt files. Save those two files into the /gamma folder in Mister, and you can then load from the core menus.

The original code was more to keep a reference back to the DAC measurements..

Code: Select all

import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt

# Absolute truth of the correction curve
correction_curve = np.array([16, 39, 63, 88, 113, 129, 155, 181, 206, 231, 255])

# Offset the entire curve by -10
brightness_decreased_curve = correction_curve - 10

# Apply positive adjustments to the bottom and top values
brightness_decreased_curve[0] = 16  # Reference start value
brightness_decreased_curve[1] += 8
brightness_decreased_curve[2] += 5
brightness_decreased_curve[-3] += 5
brightness_decreased_curve[-2] += 8
brightness_decreased_curve[-1] = 255  # Reference end value

# Reference points (IRE levels) corresponding to the 8-bit values
ire_levels = np.linspace(0, 255, len(correction_curve))

# Cubic interpolation function for the correction curve and adjusted curve
f_correction = interp1d(ire_levels, correction_curve, kind='cubic')
f_adjusted_curve = interp1d(ire_levels, brightness_decreased_curve, kind='cubic')

# Generate new points for interpolation (0 to 255)
new_ire_levels = np.arange(0, 256)

# Interpolated values for the full 0-255 range
correction_interpolated = f_correction(new_ire_levels)
adjusted_curve_interpolated = f_adjusted_curve(new_ire_levels)

# Plotting the interpolated curves
plt.figure(figsize=(12, 8))
plt.plot(new_ire_levels, correction_interpolated, label='Interpolated Correction Curve', color='green')
plt.plot(new_ire_levels, adjusted_curve_interpolated, label='Interpolated Adjusted Curve', color='blue', linestyle='--')

plt.xlabel('IRE Level')
plt.ylabel('8-bit Value')
plt.title('Interpolated Correction Curve and Adjusted Curve (0-255 range)')
plt.legend(loc='upper left')
plt.grid(True)
plt.show()

# Printing the interpolated values as rows
print("#Interpolated Correction Curve (0-255):")
for val in correction_interpolated.astype(int):
    print(val)

print("#Interpolated Adjusted Curve gamma -10 (0-255):")
for val in adjusted_curve_interpolated.astype(int):
    print(val)
Attachments
plotvSTDv.png
plotvSTDv.png (95.42 KiB) Viewed 844 times
Post Reply