Skip to content

zoltraks/hokey-stereo-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

HOKEY BASIC STEREO TEST

Introduction

The POKEY sound chip was used in the ATARI family of 8-bit computers.

The 5200 console also contains it, while the 2600 and 7800 consoles do not contain the POKEY chip.

In the case of the 7800 console, the POKEY chip was placed on the cartridge along with the game to enable sound playback.

For 7800 there is possiblity to use multicart Concerto which uses SD card reader and allows to play most of the games on 7800 console.

However it needs POKEY chip to be mounted.

Also popular STEREO extension needs second POKEY to be mounted in ATARI machine.

An alternative to the increasingly hard-to-find POKEY chip is the FPGA based PokeyMax chip.

It provides a different set of configurations (STEREO, QUAD, COVOX, SID, YM). Unfortunatelly is currently difficult to obtain these days.

A replacement for the POKEY system dedicated for use in the Concerto called HOKEY has recently become available.

Here is a description from the producer of Concerto and HOKEY chips, Atari Age forum user batari.

HOKEY was intended as a POKEY replacement for Atari 7800 homebrews but has evolved into a low-cost sound chip for Atari 7800 games. It is the only POKEY replacement with a form factor that is essentially the same as a real POKEY. It's also the lowest-cost POKEY replacement chip by a wide margin.
HOKEY's implementation of POKEY is based on the public domain datasheet and schematics of POKEY. It's a completely original POKEY implementation without use of any existing source code. HOKEY is intended as a functional replication of POKEY sound capabilities and was never intended to be a 100% authentic reproduction of the chip at the gate level. However, I will make every effort to ensure HOKEY can faithfully produce the various distortions. 

The cheapest option is to use the basic version of the HOKEY chip. This variant only contains the audio generation functionality of the POKEY chip.

It cannot therefore be used instead of the original chip, but it can be used as a second chip in the STEREO extension.

It should be noted that HOKEY is dedicated for use by multicards.

This document contains the results of testing the use of the HOKEY basic chip as a second sound chip for STEREO extension in PAL machine.

Changes

Version Date Description
1.1 2023-03-07 Additional tests from VinsCool
1.0 2023-02-21 Initial release

Credits

Filip Golewski ZoltarX This document
Vin Samuel VinsCool Additional tests
Grzegorz Żyła SuN Equipment

Test kit

  • HOKEY Basic x 2

  • POKEY x 3

  • PokeyMax v2 with STEREO configuration

  • SimpleStereo v2 STEREO board

  • ATARI 130 XE PAL machine

  • Focusrite Scarlett 2i2 audio interface

  • Altirra emulator

  • RMT music tracker

All recordings were made in 24-bit resolution at 48kHz.

Source WAV files size is almost 7 GB.

Test configurations

POKEY + HOKEY

POKEY plays on the left channel.

HOKEY plays on the right channel.

POKEY + POKEY

Standard STEREO configuration.

PokeyMax v2

FPGA replacement for two POKEY configuration (SC firmware).

Preparations

Levels

Output levels of both chips are different.

HOKEY output level is -10dB quieter than original POKEY chip.

It can be compesated with 140 Ω resistor between channel audio out and audio ground.

However most of the recordings were made without any additional electrical elements.

Adjustments

PokeyMax documentation recommends use of polarized 10 μF capacitors at audio output.

In first configuration bipolarized audio capacitors were used.

Checks

CHECK 0 is pure tone check. Uses distortion $A.

CHECK 1 is melody test. Uses various timbres.

CHECK 2 uses note A with different volume levels. Playing similar frequencies results in wave interferences.

CHECK 3 contains frequency check using all distortions but pure tone.

CHECK 4 ia s special check that uses volume only mode to generate sound.

CHECK 5 uses 1/2 and 3/4 generators to determine differences in phase shift.

CHECK 6 is a pure tone test using two lowest sounds $FF and $FE in 64 kHz mode played on both sound chips to find the proper tuning.

CHECK FE is similar test using two lowest sounds $FF and $FE in 64 kHz mode played on each generator.

CHECK FD is using $FF and $FD in 64 kHz mode to find the proper tuning.

CHECK FC is using $FF and $FC in 64 kHz mode.

CHECK A4 contains 3 subtunes to test frequency offset between sound chips.

CHECK AF tests frequency differences for division values +1 / -1 between channels for notes in range C-3 to B-5.

SOURCE HOKEY POKEY MAX ALTIRRA
CHECK 0.rmt HOKEY 1 CHECK 0.ogg POKEY 1 CHECK 0.ogg MAX 1 CHECK 0.ogg ALTIRRA CHECK 0.ogg
CHECK 0.xex HOKEY 2 CHECK 0.ogg POKEY 2 CHECK 0.ogg MAX 2 CHECK 0.ogg
CHECK 1.rmt HOKEY 1 CHECK 1.ogg POKEY 1 CHECK 1.ogg MAX 1 CHECK 1.ogg ALTIRRA CHECK 1.ogg
CHECK 1.xex HOKEY 2 CHECK 1.ogg POKEY 2 CHECK 1.ogg MAX 2 CHECK 1.ogg
CHECK 2.rmt HOKEY 1 CHECK 2.ogg POKEY 1 CHECK 2.ogg MAX 1 CHECK 2.ogg ALTIRRA CHECK 2.ogg
CHECK 2.xex HOKEY 2 CHECK 2.ogg POKEY 2 CHECK 2.ogg MAX 2 CHECK 2.ogg
CHECK 3.rmt HOKEY 1 CHECK 3.ogg POKEY 1 CHECK 3.ogg MAX 1 CHECK 3.ogg ALTIRRA CHECK 3.ogg
CHECK 3.xex HOKEY 2 CHECK 3.ogg POKEY 2 CHECK 3.ogg MAX 2 CHECK 3.ogg
CHECK 4.rmt HOKEY 2 CHECK 4.ogg MAX 1 CHECK 4.ogg ALTIRRA CHECK 4.ogg
CHECK 4.xex MAX 2 CHECK 4.ogg
CHECK 5.rmt HOKEY 2 CHECK 5.ogg MAX 1 CHECK 5.ogg ALTIRRA CHECK 5.ogg
CHECK 5.xex MAX 3 CHECK 5.ogg
MAX 4 CHECK 5.ogg
CHECK 6.rmt HOKEY 2 CHECK 6.ogg ALTIRRA CHECK 6.ogg
CHECK 6.xex
CHECK FE.rmt
CHECK FE.xex HOKEY 2 CHECK FE.ogg
CHECK FD.rmt
CHECK FD.xex HOKEY 2 CHECK FD.ogg
CHECK FC.rmt
CHECK FC.xex HOKEY 2 CHECK FC.ogg
CHECK A4.rmt HOKEY 2 CHECK A4 TUNE 1.ogg
CHECK A4.xex HOKEY 2 CHECK A4 TUNE 2.ogg
HOKEY 2 CHECK A4 TUNE 3.ogg
CHECK AF.rmt HOKEY 2 CHECK AF TUNE 1.ogg
CHECK AF.xex HOKEY 2 CHECK AF TUNE 2.ogg
HOKEY 2 CHECK AF TUNE 3.ogg

Tests

Scenarios

HOKEY 1 tests were made with POKEY '87 and one of HOKEY basic chip without electrical level adjustment.

HOKEY 2 tests were made with POKEY '87 and second of HOKEY basic chip using 140 Ω resitor for level adjustment.

POKEY 1 tests were made with POKEY '87 and '82 POKEY chip.

POKEY 2 tests were made with POKEY '87 and '85 POKEY chip.

MAX 1 tests were made with PokeyMax with capactitors.

MAX 2 tests were made with PokeyMax without capactitors.

CHECK 0

This test is intended to show the differences in the sound of the system for a single tone played on individual generators at minimum and maximum volume for pure tone and white noise.

In this test, the distortion used was $A (pure tone) for the A note at different octaves and $8 (white noise) played at the maximum available frequency (minimum divider value).

A4 Volume level $F, single channel 1, 2, 3, 4
A4 Volume level $1, single channel 1, 2, 3, 4
A3 + A4 + A5 + A6 Volume levels $FFFF, $FEDC, $F842, $248F, all channels
$03, $02, $01, $00 Volume level $F, single channel, different division values
$00 + $01 + $02 + $03 Volume levels $FFFF, $FEDC, $F842, $248F, all channels
A1 + A2 + A3 + A4 (15 kHz) Volume level $F, single channel 1, 2, 3, 4

CHECK 1


This check contains several short music patterns using different kind of instruments played once on the left and another on the right channel.

CHECK 2


This test uses the note A for different volumes using the beat effect resulting from the overlap of successive sounds with similar frequencies in following passes.

CHECK 3


In this test noise ($0, $8) and bass distortions ($2, $C, $E) will be tested from the lowest possible notes until maximum.

CHECK 4


Volume only test. Sound is made by quickly (8 per frame) change sound from minimum to maximum. This results in a waveform at frequency at about 130.9 Hz.

During the play, volume is increased from minimum to maximum.

CHECK 5


Playing sound on the lowest and highest possible divisor values for pure tone $A and noise $8 distortions.

Notes are played once on first channel, then on third to check difference between 1/2 and 3/4 sound generators as they are supposed to play in different phases.

Simple music using possible interferences between 2nd and 4th channel is played at the end.

CHECK 6


This check is using B-2 note (lowest possible at 64 kHz) played on both sound chips with difference of one frequency division unit between channels.

It shows strange but expected behavior when sound is muted when more than one generator is playing the same frequency.

CHECK A4


Subtune 1 plays the Freq offsets in both sides at once, for reference.

Subtune 2 plays the Left side to A-4 with offset $00, and shuffles the Right side.

Subtune 3 does the same as Subtune 2, but the channels are swapped.

Songs


"Second Life Syndrome" VLX/Lamers SLS 6:09
"Surprise" XTD/Lamers SURPRISE 2:02
"5th Generation" XTD/Lamers 5TH GENERATION 3:42
"Unified Theme Remix" New Generation UTR 3:19
"Midnight Rider" PG MIDNIGHT RIDER 3:07
"Unmec" stRing/Agenda UNMEC 4:04
"The Hall of Rabarbadon" Miker/Slight HALL OF RABARBADON 2:36
"Precel Kopernika" ZoltarX/NG PRECEL KOPERNIKA 3:20
"WHO DIS" ZoltarX/NG WHO DIS 2:36
"AC23INV" ZoltarX/NG AC23INV 2:58

Music is played by both POKEY and HOKEY chips.

POKEY plays on left channel (top) while HOKEY plays on right channel (bottom).

Results

Bugs

Pure tone generated by HOKEY contains some glitches in its envelope.

Sometimes when volume level goes to zero, HOKEY starts to play strange noise.

It's quiet but can be easily heard when nothing else is played.

Sometimes it freezes and sticks with more louder weird sounds.

Cold reboot is needed.

Checks

CHECK 0


This test shows a smoother wave envelope generated by HOKEY.

Spectrum for POKEY shows peak value at 440Hz which seems to be correct value to desired 439.84 Hz for PAL.

HOKEY in this case is more close to 450Hz.

Let's look at pitch values for different period multiplier values.

Test music uses value $47 for note A with 64 kHz clock.

Pitch PAL NTSC
$45 452.41 Hz 456.57 Hz
$46 446.04 Hz 450.14 Hz
$47 439.84 Hz 443.89 Hz
$48 433.82 Hz 437.81 Hz

The reason might be that HOKEY is internally tuned for NTSC mode and it's used in PAL machine. In NTSC mode frequency should be more like 443.89 kHz but because of slightly different CPU clock frequency, it is a bit higher.

CHECK 1


As in the previous test, a softer wave envelope is observed.

For this test, a spectrum analysis was performed for a fragment of a melody played alternately in the left and right channels.

POKEY and HOKEY spectrum combined.

After applying high pass filter at 8 kHz and normalization, spectrum analysis comparisation looks little different.

POKEY and HOKEY spectrum combined.

CHECK 2


It looks like HOKEY can't play maximum available frequency for noise distortion $8.

In the folowing diagram you can see first POKEY, HOKEY in the middle and second POKEY which correctly plays noise sound.

This is definetely a bug.

CHECK 4


This test totally fails on HOKEY.

It is almost perfect for MAX.

CHECK 5


Phase shift can be observed when playing the same notes betweek POKEY and HOKEY.

CHECK 6


Glitches in generated wave can be observed on HOKEY side (small peaks).

HOKEY starts to play noise when it should remain silent.

CHECK A4

HOKEY generates sound in inverted phase.

CHECK AF


Download NOTE FREQUENCY.ods →

Songs

Several songs played in STEREO mode.

HOKEY can be heard on right channel, while original POKEY plays on left.

<style> .two-column-picture-table:after { content: ""; display: table; clear: both; } .two-column-picture-table > div { float: left; width: 50%; } </style>

"Second Life Syndrome" by VLX/Lamers

Download →

MONO module.

Both envelopes match.

POKEY + HOKEY

"Surprise" by XTD/Lamers

Download →

MONO module.

Both envelopes match.

POKEY + HOKEY

"5th Generation" by XTD/Lamers

Download →

STEREO module.

Envelopes don't match each other.

POKEY + HOKEY

"Unified Theme Remix" by New Generation

Download →

STEREO module.

Envelopes don't match each other.

POKEY + HOKEY

"Midnight Rider" by PG

Download →

STEREO module.

Envelopes don't match each other.

POKEY + HOKEY

"Unmec" by stRing/Agenda

Download →

MONO module.

Both envelopes match.

POKEY + HOKEY

"The Hall of Rabarbadon" by Miker/Slight

Download →

MONO module.

Both envelopes match.

POKEY + HOKEY

"Precel Kopernika" by ZoltarX/NG

Download →

PSEUDO STEREO module.

Second envelope is delayed by 1 frame (20 ms).

POKEY + HOKEY

"WHO DIS" by ZoltarX/NG

Download →

MONO module.

Both envelopes match.

POKEY + HOKEY

"AC23INV" by ZoltarX/NG

Download →

MONO module.

Both envelopes match.

POKEY + HOKEY

Conclusions

  1. HOKEY plays too quietly, and not -6 dB, but rather -10 dB

  2. HOKEY is out of tune, playing slightly higher frequencies (450 Hz vs 440 Hz for A4)

  3. HOKEY generates sound in inverted phase

  4. HOKEY does not play the highest noise frequencies (distortion $8, divisor $00)

  5. HOKEY has glitches when generating pure tone

Downloads

Recordings are available to download in compressed OGG format made with the highest quality (q=10).

Google Drive

This quality is still enough to further analysis.

And we got 1/4 the size comparing to uncompressed data.

Frequency tables

The following frequency tables were generated using the program RMT 1.34 2023-01-01.

Frequency table for tone A, distortion $A (pure tone) for 64 kHz audio clock.

POKEY (PAL) POKEY (NTSC)
A3 219,92 Hz 221,95 Hz 220,00 Hz
A4 439,84 Hz 443,89 Hz 440,00 Hz
A5 879,69 Hz 887,78 Hz 880,00 Hz
A6 1759,37 Hz 1775,57 Hz 1760,00 Hz

Frequency table for tone A, distortion $A (czyty ton) for 15 kHz audio clock.

POKEY (PAL) POKEY (NTSC)
A3 55,17 Hz 55,67 Hz 55,00 Hz
A4 109,55 Hz 110,56 Hz 110,00 Hz
A5 222,24 Hz 224,28 Hz 220,00 Hz
A6 432,13 Hz 436,10 Hz 440,00 Hz

Division table for noise, distortion $8 for 64kHz audio clock.

POKEY (PAL) POKEY (NTSC)
$00 31668,70 Hz 31960,23 Hz
$01 15834,35 Hz 15980,12 Hz
$02 10556,23 Hz 10653,41 Hz
$03 7917,17 Hz 7990,06 Hz

Reference materials

Frequency table for equal tempered tuning system.

https://pages.mtu.edu/~suits/notefreqs.html

Atari Age forum posts from the producer of Concerto and HOKEY.

https://forums.atariage.com/topic/314517-concerto-sd-card-multicart-ordering-info/

https://forums.atariage.com/topic/321741-hokey-demo/?do=findComment&comment=4968839

https://forums.atariage.com/topic/348255-dkr-wip/

https://forums.atariage.com/topic/346754-hokey-pokey-sound-issues/

About

HOKEY BASIC STEREO TEST

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published