Jump to content
IGNORED

Curious case of stereo detection failure


woj

Recommended Posts

So here is one for you. First, the stereo board in question is a self-made copied design of mytek's board, just with the PIC / ps/2 keyboard interfaced skipped. I am sure the board is fine, there was a problem with a wrong (too slow) 4066 used at one point, but mytek helped me, and now all my boards have the right chip. I have a total of 5 now (I practiced SMD soldering on them if you wonder), one of which is actually through hole and that one is for sure 100% compatible with mytek's (assembled with the same parts as his). 

 

Now, the curiosity is that on my beefed up 130XE (U1MB, VBXE, Sophia, UAV, stereo) most programs detect the stereo (with the exception of Yoomp, but that one is known to randomly fail with this) and act accordingly. On my yet to be beefed up 800XL (gadgets on the way, so far it has UAV and 74F08) many programs fail to detect the stereo, some do. Most notably IK Enhanced Edition refuses to play stereo (it does on 130XE). Stereo as such works, games that do not switch to mono on not detecting it play stereo nicely, including the said Yoomp. I swapped the stereo boards around, it does not seem to be it, it is the computer. I am not fully confident that it is 100% stable and OK, I did have some issues with it (like refusing to work with its original OS ROM and failing RAM test, but fine with the same OS version burned into another EPROM chip). I did not yet try swapping Pokey chips instead, so far those always stay with the computer, probably the next thing I should do.

 

Has anyone experienced something like this and can tell me what is going on?

Link to comment
Share on other sites

17 minutes ago, Peri Noid said:

A stereo board requires the A4 address line to be connected. It may be important, from where on the board you're taking this signal.

It is connected, to a via of the trace going to the PBI connector, one of them next to the OS rom. As said, stereo does work, the problem is with detection, Pang detects it (does not continue because of the missing memory), IK EE does not, Atari Blast does not, both games play on the left channel only. Games that do not try to detect it just play stereo.

Link to comment
Share on other sites

1 hour ago, Peri Noid said:

A stereo board requires the A4 address line to be connected. It may be important, from where on the board you're taking this signal.

It would be the A4 address no matter where it's connected. Well assuming you actually are connected to A4 ;)

 

And if you are getting a stereo audio output in the case where the board is being recognized as a dual Pokey board, then we know that A4 is being used correctly.

 

I do recall there being a problem with stereo recognition in certain pieces of software, but I don't remember what the issue actually was. I would think that a test for a dual Pokey should come down to writing a register in both the Pokey's with a unique byte, and then reading it back to see if you get two unique bytes. If you were to get the same byte in both locations, then you are simply seeing the mirrored address space from a single Pokey.

 

Link to comment
Share on other sites

48 minutes ago, mytek said:

It would be the A4 address no matter where it's connected. Well assuming you actually are connected to A4 ;)

 

And if you are getting a stereo audio output in the case where the board is being recognized as a dual Pokey board, then we know that A4 is being used correctly.

 

I do recall there being a problem with stereo recognition in certain pieces of software, but I don't remember what the issue actually was. I would think that a test for a dual Pokey should come down to writing a register in both the Pokey's with a unique byte, and then reading it back to see if you get two unique bytes. If you were to get the same byte in both locations, then you are simply seeing the mirrored address space from a single Pokey.

 

I detect stereo pokey like this:

 

....
    mva #0 SSKCTL
    mva #0 SKCTL
    mva #0 SKCTL+$10        ; make sure a potential 2nd pokey is cleared, too, if it's there
....

    ; Restart SKCTL. This starts all the poly counters

    mva #3 SSKCTL
    mva #3 SKCTL

....

    ; Except when there's a second pokey. Its counters are not restarted.
    ; Its RANDOM should not change.

    lda RANDOM+$10
    cmp RANDOM+$10
    beq detected_stereo         ; so equal means there's a 2nd pokey

detected_mono
    prints 0, "No STEREO Pokey detected!"
    jmp *

detected_stereo
    mva #3 SKCTL+$10            ; start second pokey here
.....

 

Edited by ivop
  • Like 1
Link to comment
Share on other sites

41 minutes ago, mytek said:

It would be the A4 address no matter where it's connected. Well assuming you actually are connected to A4 ;)

 

And if you are getting a stereo audio output in the case where the board is being recognized as a dual Pokey board, then we know that A4 is being used correctly.

But it may be a problem with timings. Playing consists in writing to Pokey's ports. Detection, as I presume, includes reading. You probably have it done correctly but it's worth checking. I used to use TK-II-stereo in one of my 800XLs without issues (now it's PokeyMAX there). 

Link to comment
Share on other sites

We had a thread years ago on detection techniques.

I would guess that problem software might be using a method that's either faulty or not comprehensive enough or that it's attempting the right thing but not doing it properly.

 

Or, alternatively - if it's a Pokey recreation, the device might not behave as expected when certain tests are performed.

Edited by Rybags
Link to comment
Share on other sites

IK Enhanced Edition uses IRQST to detect stereo:

 

    F8D7: A9 00             LDA #$00
    F8D9: 8D 1E D2          STA $D21E
    F8DC: 8D 08 D2          STA AUDCTL
    F8DF: A9 01             LDA #$01
    F8E1: 8D 0E D2          STA IRQEN
    F8E4: 8D 00 D2          STA AUDF1
    F8E7: 8D 09 D2          STA STIMER
    F8EA: 2C 0E D2          BIT IRQST
    F8ED: D0 FB             BNE $F8EA
    F8EF: 2C 1E D2          BIT $D21E
    F8F2: D0 02             BNE $F8F6
    F8F4: A9 00             LDA #$00
    F8F6: 8D FA F8          STA $F8FA
    F8F9: 60                RTS

 

This code disables IRQs on the secondary POKEY, enables timer 1 IRQ on the primary POKEY, waits for timer 1 IRQ to assert, and then checks that secondary timer 1 hasn't. This should work as long as reads are reliable; it notably doesn't rely on the /IRQ signal.

 

  • Like 1
Link to comment
Share on other sites

Thanks for all the answers!

 

Yes, it has occurred to me that I could have connected to something else than A4, but I did re-check it, no mistake there. This morning I swapped out the complete board with both Pokeys from the 130XE (Yes, I do have 4 Pokeys in total, and none of them is a remake of any kind). The problem on the 800XL remains, which eliminates the Pokey chips themselves, and also the board now for certain, the complete set works just fine in the 130XE, does not in the 800XL. But what is interesting, when I powered the 800XL cold (with the known working stereo board from 130XE) and fired up IK EE, not only in played mono on the left channel, some of the actual Pokey channels were missing or silent too, I mean there was only ~half of the tracks playing! On the second power on everything played, still mono. I did have this once before just after installing the stereo board for the first time, but did not pay too much attention to it, I figured it was some loose connection, badly seated connector or IC. But now I see the problem is reproducible.

 

Now, having past problems with the OS rom playing up on this one, now also seeing that IK EE turns of OS and works from the OS address range (I assume this from phaeron's listing) I am inclined to think there is some deeper timing / addressing issue on this computer. I will continue with swapping out RAM chips to ones with different timing (I do have a set somewhere) and putting the 74LS08 back in. Then I can only hope that either this, or the SRAM module on the way to me, will fix this. Public note to self - DO NOT re-flash the firmware on the new coming U1MB on this computer, connect it to the 130XE instead to do this.

 

One more thing that came to mind, I was replacing the socket under the delay line when I got the computer last year, had some huge problems with this job for some reason and had a non-booting system after the first attempt. So re-inspecting that area might be a good idea, or perhaps the chip itself is playing up... The one suspicious thing was that on a non-socketed computer, this and the MMU were the only two socketed chips, so there might have been some prior issues there. 

Edited by woj
  • Like 1
Link to comment
Share on other sites

Soft test of Timer IRQ I feel is a good idea.

2nd Pokey options could potentially be various - IRQ sent to CPU or not, POTs connected or not, and FPGA type could have incomplete simulation of some elements such as keyscan or SIO.

Timer IRQ would be a fairly simple extension from the normal AUDF restart so likely to be included.

Link to comment
Share on other sites

Is this IK EE different from the other versions I've seen out there? I have one of the newer releases of IK that I think has a 2023 date on it, and it only plays mono on the left through my 130xe with the stereo switched on. Yoomp has never been an issue and always detects the stereo on my setup and Pang also detects it on my 130xe (Although the game itself ins't playable on my NTSC console). But it does at least start and I can hear the title music etc.

 

Link to comment
Share on other sites

I swapped around all possible ICs I had floating in my box, but not the ones that would require taking apart the other computer. So that was OS rom, Basic, MMU, 74LS08, all RAMs. Still no go. Now I also know it was not the delay line with troublesome socket, but the IC above it, I remembered it wrong. Nevertheless, took the opportunity to socket the delay line too. (Now I see I forgot swapping the Sophia with the GTIA that I have spare in my box too).

 

But, what I do know, this situation when I hear half of the track from IK EE is actually the game playing one channel of the stereo track it seems. So like it does figure out that there is stereo, on some boots, but then something later on fails in making both channels play. This is sooooo weird? 😕

 

Edit: Ok, hang me, it might be that we are having a discussion about nothing :facepalm: The extended description about IK EE in the thread linked above suggests that stereo (and generally other cool sound features) are not supported for 64K machines. Which is what my 800XL currently is. The half channels behaviour is still weird, but now not so surprising.

 

Edit2: before U1MB arrives I do have SysCheckII that I can set to memory extension for test :)

Edited by woj
  • Like 1
Link to comment
Share on other sites

Seriously, that was it, too little memory. Megablast (I mixed it up with Atariblast above) now also works.

 

One could wonder that with being that absent minded I do not fall under cars everyday and I can actually write working 6502 code :D Though on a third attempt usually...

  • Like 1
Link to comment
Share on other sites

16 hours ago, woj said:

Seriously, that was it, too little memory. Megablast (I mixed it up with Atariblast above) now also works.

 

One could wonder that with being that absent minded I do not fall under cars everyday and I can actually write working 6502 code :D Though on a third attempt usually...

Speaking of Atari Blast, does it not work with FujiNet? I've tried three different downloads of Atari Blast to run on my 130xe and it will start to load up and I sometimes see the initial AtariBlast screen that shows the sectors under it..but then it just locks up with a solid tone usually playing at that point? My Uno won't load it due to the size of the image so my FujiNet is the only way. I have Atari Blast for my 5200 so I do have a way to play it, but was curious to check it out on my 130xe.

 

Link to comment
Share on other sites

1 hour ago, Peri Noid said:

Atari Blast! Requires full 1MB of RAM to work from FN. But if you have it on a cart, it works fine on a stock machine. 

Okay, that makes sense. Yeah I don't have a full 1mb of ram expanded in my 130xe. So that explains that. And yes the other IK EE does seem to work in Stereo on my 130xe without issue. Although I'm pretty sure it comes up in default mode with mixed audio evenly across both Pokeys. If I press the M key on the keyboard a few times, I will then hear different sounds breaking out from each pokey across the speakers. But yeah that one seems working for me. But I'm also using two actual POKEYs off my TK-II board. The one that came off the 130xe, and another out of an older 5200.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...