QSound and QPrint Interface

Nagging hardware related question? Post here!
User avatar
aalea
Bent Pin Expansion Port
Posts: 86
Joined: Mon Feb 07, 2022 9:27 pm

Re: QSound and QPrint Interface

Post by aalea »

Derek_Stewart wrote:Hi,
My Qsound board, as shown above has through plating damage to the voltage regulator connections.
I can use a 7405 regulator, or could a TSR-1-2450 work the same?
I would use a 7805, because it has long legs, and you can use it to repair the tracks, this board has very low current, so the 7805 will not heat a lot, in fact I have it without disipator.

There is nothing wrong in use the TSR, but is the 2A one, so it's a pity.


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: QSound and QPrint Interface

Post by mk79 »

OK, I'm starting to spend far more time on this than I ever wanted :roll: Programming for QDOS is less fun and forgiving than SMSQ/E. By the way if anybody has one of the final PCBs over I'd like to build one myself sometime ;)

Attached a fixed ROM and an improved AY player as I found a problem along the way.
Attachments
ayplay103.zip
(33.14 KiB) Downloaded 113 times
qsound193.zip
(3.27 KiB) Downloaded 96 times


User avatar
aalea
Bent Pin Expansion Port
Posts: 86
Joined: Mon Feb 07, 2022 9:27 pm

Re: QSound and QPrint Interface

Post by aalea »

mk79 wrote:OK, I'm starting to spend far more time on this than I ever wanted :roll: Programming for QDOS is less fun and forgiving than SMSQ/E. By the way if anybody has one of the final PCBs over I'd like to build one myself sometime ;)

Attached a fixed ROM and an improved AY player as I found a problem along the way.
Thank You so much for your effort, and don't worry, I will give you one, but first I need to solve my problem with the position of the ROM.

YEAH!, this rom work, I was able to use your ayplay program and reproduce lots of tunes donwload from zxart!!

The tunes are offset on pitch, but I suppous that this is related to the clock of the interfaz and is not easy to fix on software.

The programs in basic published previously, aeludium_bas, menuett_bas work, so the RELEASE bug is fix, but, I was not able to reproduce oonlight_bas, the program throws me an error "out of memory'', and I have 640kb, unfortunatelly I was not able to reproduce the error in the emulator, and in the emulator works (well, at least there is no error).

What I can not test is the qsound device, because I'm unable to use silvester's player


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: QSound and QPrint Interface

Post by mk79 »

aalea wrote:Thank You so much for your effort, and don't worry, I will give you one, but first I need to solve my problem with the position of the ROM.
Great :-)
The tunes are offset on pitch, but I suppous that this is related to the clock of the interfaz and is not easy to fix on software.
Yes, the frequency is a problem, not sure if it would work to adapt the AY registers on-the-fly in this case. What base frequency does the QSound board use, was it 1.5MHz or something like that?
The programs in basic published previously, aeludium_bas, menuett_bas work, so the RELEASE bug is fix, but, I was not able to reproduce oonlight_bas, the program throws me an error "out of memory'', and I have 640kb, unfortunatelly I was not able to reproduce the error in the emulator, and in the emulator works (well, at least there is no error).
Weird. On what line does it throw the error?
What I can not test is the qsound device, because I'm unable to use silvester's player
My AYPlay uses the QSOUND device for output, so that works as well then :-)


Silvester
Gold Card
Posts: 436
Joined: Thu Dec 12, 2013 10:14 am
Location: UK

Re: QSound and QPrint Interface

Post by Silvester »

I got my hardware working OK, using PB1 spare output to switch between default 0.75Mhz and 2MHz AY clock. But QSOUND device on v1.93 rom seems to be tripping up my player. I did a 'crafty' (that'll teach me ;) ) way of detecting whether output channel was to PSG file or the QSOUND device by looking for EOF on output file (ie. initial empty PSG file), on QPC2 it was OK but causes QL to hang. I couldn't try Marcel's player on my 128K QL testbed - not enough memory.

Next, coding solution...
myQS.jpg


David
User avatar
aalea
Bent Pin Expansion Port
Posts: 86
Joined: Mon Feb 07, 2022 9:27 pm

Re: QSound and QPrint Interface

Post by aalea »

mk79 wrote:
The tunes are offset on pitch, but I suppous that this is related to the clock of the interfaz and is not easy to fix on software.
Yes, the frequency is a problem, not sure if it would work to adapt the AY registers on-the-fly in this case. What base frequency does the QSound board use, was it 1.5MHz or something like that?
Clock come from line E, so it's about 0.75Mhz, in any case, the idea is to upgrade and allow 2Mhz as per silvester solution, (because 1.77 is dificult to buy).
mk79 wrote:
The programs in basic published previously, aeludium_bas, menuett_bas work, so the RELEASE bug is fix, but, I was not able to reproduce oonlight_bas, the program throws me an error "out of memory'', and I have 640kb, unfortunatelly I was not able to reproduce the error in the emulator, and in the emulator works (well, at least there is no error).
Weird. On what line does it throw the error?
Damm, today I was unable to reproduce the error, the basic program run ok, and the 2 tunes of this basic program work perfectly, so I don't know what cause the error yesterday.


User avatar
aalea
Bent Pin Expansion Port
Posts: 86
Joined: Mon Feb 07, 2022 9:27 pm

Re: QSound and QPrint Interface

Post by aalea »

Silvester wrote:I got my hardware working OK, using PB1 spare output to switch between default 0.75Mhz and 2MHz AY clock. But QSOUND device on v1.93 rom seems to be tripping up my player. I did a 'crafty' (that'll teach me ;) ) way of detecting whether output channel was to PSG file or the QSOUND device by looking for EOF on output file (ie. initial empty PSG file), on QPC2 it was OK but causes QL to hang. I couldn't try Marcel's player on my 128K QL testbed - not enough memory.

Next, coding solution...

myQS.jpg
Have you problem with play command? any "out of range error"?

Which schematic your follow to do the interface? technology of chip? (74LS, 74HC....) model or ROM chip?


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: QSound and QPrint Interface

Post by mk79 »

Silvester wrote:But QSOUND device on v1.93 rom seems to be tripping up my player. I did a 'crafty' (that'll teach me ;) ) way of detecting whether output channel was to PSG file or the QSOUND device by looking for EOF on output file (ie. initial empty PSG file), on QPC2 it was OK but causes QL to hang.
Hm, the device should never hang, so this is at least strange or a bug in the device. I can't reproduce it in QemuLator when using AYPlay to stream to QSound. I guess it does something but can't be sure of course as there is no sound, but at least it doesn't crash.
By the way, one can call iof.posr with a 0 value to the QSound device to check how many frames have been played yet.

But when I just execute AYPlay QEmuLator immediately crashes out because you use my internal QPC instructions, which should never be done outside of the SMSQ/E source code. And I don't understand it especially in this case, I provide all functionality of those commands in a simple to use and hardware agnostic API, there is no reason to use undocumented internal instructions. Just use the QSound API and the code should work with QPC and the QSound ROM and whatever else might come up in the future.

Code: Select all

        #include "dev8_keys_qsound"
        #include "dev8_keys_sys"

;+++
;       AY_WRALL
;
;       Registers:
;               Entry                           Exit
;       D0.L    $03                     D0.L    0 or error code
;       D1.B    Chip number             D1      undefined
;       D2                              D2      undefined
;       A1.L    Pointer to data block   A1      undefined
;       A5                              A5      undefined
;---
        moveq   #ay.wrall,d0
        moveq	#0,d1
        lea     registers(pc),a1
        move.l  sys_qsound(a6),a0
        jsr     (a0)


Silvester
Gold Card
Posts: 436
Joined: Thu Dec 12, 2013 10:14 am
Location: UK

Re: QSound and QPrint Interface

Post by Silvester »

aalea wrote:Have you problem with play command? any "out of range error"?
Yes, I almost always get that error.

PLAY 'CDEFGAH' is always accepted (but of course no sound).
PLAY 'v8CDEFGAH' sometimes just plays scale (but not always)
PLAY 'v10CDEFGAH' always complains 'out of range' (as do all other commands with arguments in PLAY string)

I tried v1.31 and v1.93 roms, both don't work as expected with PLAY command. But SOUND_AY, POKE_AY etc all do work as expected.
aalea wrote:Which schematic your follow to do the interface? technology of chip? (74LS, 74HC....) model or ROM chip?
The one I posted here but using 74HC85 instead of 74LS266 (also 74LS03, 74LS10). I used 74HC00 to switch frequencies as posted here. Looking at source code PB0-PB3 are always output, PB4-PB7 as inputs. Unused PB1 is always output high by default (selecting 0.75MHz), PB0 (AY BC1) & PB2 (AY BDIR) are low when inactive.
Last edited by Silvester on Mon Oct 10, 2022 3:44 am, edited 1 time in total.


David
Silvester
Gold Card
Posts: 436
Joined: Thu Dec 12, 2013 10:14 am
Location: UK

Re: QSound and QPrint Interface

Post by Silvester »

mk79 wrote:Hm, the device should never hang, so this is at least strange or a bug in the device.
v1.93 rom hangs QL on both these Basic commands:

OPEN#3;QSOUND
BGET#3,a

OPEN#3;QSOUND
BPUT#3;1,2,3,4,5,6,7,8,9,10,11,12,13,14

On QPC2 you get err_bp for BGET, with expected noisy output on BPUT.

(BTW your device code will be running in the very slow E bus access to EPROM so I don't know whether it may affect it.)
mk79 wrote:But when I just execute AYPlay QEmuLator immediately crashes out because you use my internal QPC instructions, which should never be done outside of the SMSQ/E source code.
Yes I forgot I left that in there :oops: . As I mentioned I got bad playback running QPC2 with Wine on Linux I thought it might have been the device overhead/bug. I forgot to revert back to API call.


David
Post Reply