OPL recording problem

Discussion about old PC hardware.

Re: OPL recording problem

Postby Cloudschatze » 2014-2-05 @ 05:24

CT1747 (Non-EMU8000-based cards)
Pin 001 - OSC Input (from 14.31818 crystal, through 74LS04)
Pin 080 - ??? (tied to GND)
Pin 098 - Data Output (to DAC)
Pin 099 - Bit Clock Output (to DAC)
Pin 100 - Word Select Output (to DAC)

CT1747 (EMU8000-based cards)
Pin 001 - OSC Input (from EMU8000 pin 30)
Pin 080 - ??? (from(?) EMU8000 pin 31)
Pin 098 - Data Output (to EMU8000 pin 29)
Pin 099 - Bit Clock Output (to EMU8000 pin 28)
Pin 100 - Word Select Output (to EMU8000 pin 27)

EMU8000
Pin 027 - Word Clock Input
Pin 028 - Bit Clock Input
Pin 029 - Data Input
Pin 030 - OSC Output
Pin 031 - ???
Pin 078 - Bit Clock Output (to DAC)
Pin 080 - Data Output (to DAC)
Pin 081 - Word Select Output (to DAC)


So, who has a frequency counter? jwt27? :)
User avatar
Cloudschatze
Oldbie
 
Posts: 1029
Joined: 2005-6-16 @ 14:32

Re: OPL recording problem

Postby sklawz » 2014-2-05 @ 08:57

hi

The I2S word clock is ~49.7 Khz pin 100 on a CT2760 REV. 3

bye
User avatar
sklawz
Member
 
Posts: 240
Joined: 2011-3-27 @ 15:46

Re: OPL recording problem

Postby Cloudschatze » 2014-2-05 @ 15:36

sklawz wrote:The I2S word clock is ~49.7 Khz pin 100 on a CT2760 REV. 3

Nice. I hadn't expected that. :)

Is there any chance that you can measure the frequency at pin 1 of the CT1747 as well?
User avatar
Cloudschatze
Oldbie
 
Posts: 1029
Joined: 2005-6-16 @ 14:32

Re: OPL recording problem

Postby jwt27 » 2014-2-05 @ 18:07

Cloudschatze wrote:So, who has a frequency counter? jwt27? :)


Nope, sorry. For audio-frequency measurements I always use Visual Analyzer, but of course you could use this to measure higher digital frequencies too, if you run the signal through a divider first.

(edit: Reading my own words again, I am actually saying I DO have a frequency counter XD. In any case, I don't have any (working) AWE cards to test.)

I just had a look at the YMF719 again with this program, here is an A5 note played in Adlib Tracker:

Image

As you can see, it's not exactly 440Hz. So unless adtrack2 uses some non-standard tuning system, I think this proves that the OPL3-SAx does not compensate for the lower sampling rate, and will thus sound slightly detuned. I would've expected a difference of -7 cents (438.2Hz) here though... Will have to check the sampling rate again, as I measured that on a different card.
Last edited by jwt27 on 2014-2-05 @ 20:16, edited 1 time in total.
WANTED - Manuals/drivers for:
  • Tecmar Graphics Master
  • Paradise Autoswitch EGA 350 (EGA1A)
User avatar
jwt27
Oldbie
 
Posts: 1628
Joined: 2011-8-15 @ 02:19
Location: Fryslân

Re: OPL recording problem

Postby NewRisingSun » 2014-2-05 @ 18:34

The difference is too big to be caused solely by the sampling rate difference. According to my calculations, the difference between a YMF289/YMF278/YMF719 and an original OPL2/OPL3 should be (49,715+10/11)/(49,515+15/19)=1.004041531385281... ~ 0.4 %, which would detune 440 Hz to ~438.2289 Hz, but not 436 Hz.

Try this .COM file. It will play a sine wave at exactly (or as close as the OPL allows it) 440 Hz.
Attachments
OPL440.zip
(243 Bytes) Downloaded 35 times
Last edited by NewRisingSun on 2014-2-05 @ 19:39, edited 1 time in total.
NewRisingSun
Oldbie
 
Posts: 822
Joined: 2005-9-02 @ 02:26

Re: OPL recording problem

Postby jwt27 » 2014-2-05 @ 19:10

NewRisingSun wrote:The difference is too big to be caused solely by the sampling rate difference. According to my calculations, the difference between a YMF289/YMF278/YMF719 and an original OPL2/OPL3 should be (49,715+10/11)/(49,515+15/19)=1.004041531385281... ~ 0.4 %, which would detune 440 Hz to ~438.2289 Hz, but not 436 Hz.

Try this .COM file. It will play a sine wave at exactly (or as close as the OPL allows it) 440 Hz.


Thanks, it's measuring right now. Takes a LOT of cpu time on a Pentium 4 XD

edit: somehow your program produces a much more stable frequency, and as a result the histogram looks entirely different. Perhaps your 440Hz is closer to a round number of samples? I just turned the FFT size up a bit and restarted to make sure I'm not seeing any measurement errors.
WANTED - Manuals/drivers for:
  • Tecmar Graphics Master
  • Paradise Autoswitch EGA 350 (EGA1A)
User avatar
jwt27
Oldbie
 
Posts: 1628
Joined: 2011-8-15 @ 02:19
Location: Fryslân

Re: OPL recording problem

Postby NewRisingSun » 2014-2-05 @ 19:39

I am sorry, but I noticed a stupid mistake in my program. Please redownload the file again.
NewRisingSun
Oldbie
 
Posts: 822
Joined: 2005-9-02 @ 02:26

Re: OPL recording problem

Postby jwt27 » 2014-2-05 @ 19:46

Looks like it's doing exactly the same, except the amplitude is doubled?
WANTED - Manuals/drivers for:
  • Tecmar Graphics Master
  • Paradise Autoswitch EGA 350 (EGA1A)
User avatar
jwt27
Oldbie
 
Posts: 1628
Joined: 2011-8-15 @ 02:19
Location: Fryslân

Re: OPL recording problem

Postby NewRisingSun » 2014-2-05 @ 19:51

The incorrect version wrote an undefined value into one register. :depressed:
NewRisingSun
Oldbie
 
Posts: 822
Joined: 2005-9-02 @ 02:26

Re: OPL recording problem

Postby jwt27 » 2014-2-05 @ 20:14

Alright, here's the result from your second program:

Image

It's not exactly 438.2289Hz, but very close. Still, this shows that the YMF719 does not compensate at all for the change in sampling rate.
Now I wonder why my first graph looks so completely different. Either adrack2 does some weird things, or I made a mistake somewhere. I'll try measuring it again.
WANTED - Manuals/drivers for:
  • Tecmar Graphics Master
  • Paradise Autoswitch EGA 350 (EGA1A)
User avatar
jwt27
Oldbie
 
Posts: 1628
Joined: 2011-8-15 @ 02:19
Location: Fryslân

Re: OPL recording problem

Postby NewRisingSun » 2014-2-05 @ 20:19

That's not correct --- it does compensate, just not perfectly. If it did not compensate at all --- meaning if it used the same dividers --- 440 Hz would be played at 440 Hz*44100/(49,715+10/11)=390+186/625 Hz. But I am glad that my (and your) calculations seem to have correctly predicted the result. Now to find out what is up with the CT1747 when it is connected to the EMU8000.

And that is a very weird-looking histogram for showing a bimodal distribution.
NewRisingSun
Oldbie
 
Posts: 822
Joined: 2005-9-02 @ 02:26

Re: OPL recording problem

Postby jwt27 » 2014-2-05 @ 20:28

NewRisingSun wrote:That's not correct --- it does compensate, just not perfectly. If it did not compensate at all --- meaning if it used the same dividers --- 440 Hz would be played at 440*44100/(49,715+10/11)=390.2976 Hz.

And that is a very weird-looking histogram for showing a bimodal distribution.


Ah yes, you're right of course. I shouldn't have said "at all" there.

About the graph, I only have 420 sample points here, it would probably look a bit nicer if I let it run all day... or bought a faster PC. Still, the displayed mean value should be accurate enough.
WANTED - Manuals/drivers for:
  • Tecmar Graphics Master
  • Paradise Autoswitch EGA 350 (EGA1A)
User avatar
jwt27
Oldbie
 
Posts: 1628
Joined: 2011-8-15 @ 02:19
Location: Fryslân

Re: OPL recording problem

Postby Jepael » 2014-2-05 @ 20:32

adtrack2 uses 0x241 or 577 in decimal as FNUM for A note, so it's off a bit. Your OPL440 utility uses the best value 580 for 14.318180 MHz clock (which by NTSC definition is not fractional, but the error is so small it does not matter).

Please note that crystals or oscillators used in consumer sound cards may not be the most accurate, so expect +/- 100 PPM error range. What's worse if the clock is built with separate inverter and regular crystal, the circuitry may not be optimal and it will pull the frequency.

I have one SB with onboard 14.318MHz crystal and the YMF262 sampling frequency is 49707 or about -180 PPM error.
I also have one Aztech sound card, and the crystal is not even 14.318MHz but something a bit higher very near it.

Hmm, maybe the bimodal distribution comes from some kind of digital sampling rate conversion, as the FNUM is calculated in the datasheet as if the sampling rate were 49518, while samples are output at 44100? Could it just drop samples? Or could there be some fractional divider in the chain?
Jepael
Oldbie
 
Posts: 1195
Joined: 2005-6-15 @ 19:28
Location: Finland

Re: OPL recording problem

Postby NewRisingSun » 2014-2-05 @ 20:51

14.318180 MHz clock (which by NTSC definition is not fractional
What do you mean? That the crystals used in sound cards do not output the mathematically ideal frequency (agree), or that ideal NTSC frequencies are irrational numbers (disagree)?
Hmm, maybe the bimodal distribution comes from some kind of digital sampling rate conversion, as the FNUM is calculated in the datasheet as if the sampling rate were 49518, while samples are output at 44100? Could it just drop samples?
That would produce horrendous artifacts. It is far more likely that given the 33,868,800 Hz master clock, the Envelope Generator, Phase Generator and Low-Frequency Oscillators use a divider of 684 while everything else uses a divider of 768.

I think it is more a problem of the histogram-producing algorithm than anything else.
Last edited by NewRisingSun on 2014-2-05 @ 21:10, edited 1 time in total.
NewRisingSun
Oldbie
 
Posts: 822
Joined: 2005-9-02 @ 02:26

Re: OPL recording problem

Postby jwt27 » 2014-2-05 @ 21:06

Jepael wrote:Hmm, maybe the bimodal distribution comes from some kind of digital sampling rate conversion, as the FNUM is calculated in the datasheet as if the sampling rate were 49518, while samples are output at 44100? Could it just drop samples? Or could there be some fractional divider in the chain?


I think it's because 440, or rather 438.2289Hz is not a round number of samples, so it's "switching" between two different frequencies every other period. I'm running the same measurement on 3094.75Hz now (F-NUM 0x1E00, 16 samples long) and it's starting to look more like a gaussian distribution.

Also found out why my first histogram looks so different. I turned down the modulator "output level" to 0 in adtrack2, which of course does not disable frequency modulation completely.
WANTED - Manuals/drivers for:
  • Tecmar Graphics Master
  • Paradise Autoswitch EGA 350 (EGA1A)
User avatar
jwt27
Oldbie
 
Posts: 1628
Joined: 2011-8-15 @ 02:19
Location: Fryslân

Re: OPL recording problem

Postby sklawz » 2014-2-06 @ 00:04

lo

Cloudschatze wrote:
sklawz wrote:The I2S word clock is ~49.7 Khz pin 100 on a CT2760 REV. 3

Nice. I hadn't expected that. :)

Is there any chance that you can measure the frequency at pin 1 of the CT1747 as well?


it's 14.33 MHz.

bye-bye
User avatar
sklawz
Member
 
Posts: 240
Joined: 2011-3-27 @ 15:46

Re: OPL recording problem

Postby Cloudschatze » 2014-2-06 @ 01:09

sklawz wrote:it's 14.33 MHz.

Thanks-much.

So, the EMU8000 is doing non-integer frequency division - something else I'd thought improbable. Go figure. :dead:
User avatar
Cloudschatze
Oldbie
 
Posts: 1029
Joined: 2005-6-16 @ 14:32

Re: OPL recording problem

Postby sklawz » 2014-2-06 @ 01:16

Hi

Cloudschatze wrote:
sklawz wrote:it's 14.33 MHz.

Thanks-much.

So, the EMU8000 is doing non-integer frequency division - something else I'd thought improbable. Go figure. :dead:


The frequency is most likely 14,318,181 as anticipated. Where it comes
from is unknown, the track disappears under the 8-bit bus transceiver.

The counter I used isn't particularly accurate at that frequency, it was
a WHITEGOLD WG020. Basically a cheap multi-meter with a frequency
option. My scope (bitscope) isn't so hot at that frequency either but
I could stick a probe in somehow, but it isn't all that easy to do in my case.

Bye-bye
User avatar
sklawz
Member
 
Posts: 240
Joined: 2011-3-27 @ 15:46

Re: OPL recording problem

Postby Cloudschatze » 2014-2-06 @ 01:21

sklawz wrote:The frequency is most likely 14,318,181 as anticipated. Where it comes
from is unknown, the track disappears under the 8-bit bus transceiver.


It comes from pin 30 on the EMU8000.
User avatar
Cloudschatze
Oldbie
 
Posts: 1029
Joined: 2005-6-16 @ 14:32

Re: OPL recording problem

Postby sklawz » 2014-2-06 @ 01:31

Hi

Does the ISA OSC signal enter the EMU8000? We may speculate that
the EMU syncs it's clocks to this signal also and regenerates it for
the YMF262 embedded in the CT1747? You need more information.

Bye-bye

UPDATE: From inspection B30 is not connected and OSC doesn't enter
the board.
User avatar
sklawz
Member
 
Posts: 240
Joined: 2011-3-27 @ 15:46

PreviousNext

Return to General Old Hardware

Who is online

Users browsing this forum: candle_86, sheath and 7 guests