Crystal CS4232 and CS4235 ISA cards WSS mode

gerwin
2013-07-04
2014-10-22
  • gerwin
    gerwin
    2013-07-04

    Originally posted here: http://www.vogons.org/viewtopic.php?f=46&t=20526

    MPXplay MP3 player for DOS does not want to use it as a WSS device and instead outputs in 8-bit SB-Pro mode. This problem is present with the CS4232 and CS4235 based cards, however a CX4236B card does work as WSS right away. The advised initialization settings which are told to fix this did not make a difference.

    Recently I did find a way to make all mentioned Crystal cards play as 16-bit WSS in MPXplay, In this order:
    1) initialize the card (cs4232c.exe)
    2) run the mixer to set the volumes (cs32mix.exe)
    3) play a sample with a miles sound system game in WSS mode:
    Which can be kept brief with 'digplay.exe test.wav' using the sndsys.dig driver.
    4) set ULTRA16=530,1,7,0 (I/O, DMA, IRQ, Type)
    5) start MPXplay, and it will play MP3's in 16-bit WSS mode!
    6) if you exit MPXplay, run CS32wss.exe before starting MPXplay again, to put it back from SB-Pro mode to WSS mode.

    Maybe in the future MPXplay can be updated to do the magic of part 3 and 6 automatically?

     
  • gerwin
    gerwin
    2013-07-05

    Narrowed it down to outputs LDAC/RDAC which remain muted in MPXplay v1.59 and v1.60a4. I made a small program to unmute them (set 0x048), This replaces step 3.
    MPXplay v1.44 and earlier do not require this manual tweak.

    (Attachment located at Vogons, see link above)

     
    Last edit: gerwin 2013-07-05
  • gerwin
    gerwin
    2013-07-12

    I put this in my SC_WSS.C at the end of the "static void WSS_start(...)" procedure:
    //GB 2013, set any possible CS4232 in enhanced MODE2:
    WSS_writeDSP(baseport,0x0C,192);
    //GB 2013, reset alternate frequency settings (CS4232):
    WSS_writeDSP(baseport,0x16,0x00);
    //GB 2013, unmute outputs LDAC and RDAC:
    WSS_writeDSP(baseport,0x06,0x00);
    WSS_writeDSP(baseport,0x07,0x00);

    but the first two lines with CS4232 specifics are a bit too card specific, and not really necessary either. To make sure they don't break something else, they would need a CS4232 identification check beforehand.


    Something else,
    MPXPLAY 1.60a4 DOS4G version, Sound Blaster Pro mode in Dosbox v0.74 crashes, even when not playing anything. This is the debug log which shows three unusual things:
    -Mixer set to stereo AFTER the DMA setup.
    -rate and freq are equal, other dos drivers show rate=4*freq.
    -block / size are much higher then other dos drivers.

    DSP:Reset
    DSP:Reset
    DMA unmasked,starting output, auto 1 block 9215
    DMA Transfer:8-bits PCM Mono Auto-Init freq 11111 rate 11111 size 65536
    Mixer set to STEREO
    DSP:Reset
    DSP:Reset
    DSP:Reset
    DSP:Reset

    Unfortunately I am just a newbie regarding ISA DMA transfer rates and sizes.

     
    Last edit: gerwin 2013-07-12
  • Mpxplay
    Mpxplay
    2013-07-14

    Thank You for these, later I'll check them.

     
  • gerwin
    gerwin
    2013-08-19

    Thanks for your consideration.

    That last bit about the Sound Blaster Pro:
    I was able to test it and MPXplay actually does not work with a Sound Blaster pro 2 ISA card (CT1600). It locks up before the interface comes up.

    Edit, nevermind: it was caused by not setting the BLASTER environment. It does work when it is set properly.

    I was trying to get MPXPLAY to work nicely with dosbox 7.4 and failed. Though did notice that my changes fixed the reversed stereo on both a real SBpro card and the CS4232 SBpro compatible card. The code is based on the Quake 1 Sound Blaster handling.

    --------------SC_SBPRO.C------------------
    case SB_CARDTYPE_PRO:

    oldmixervalue = SB_readMIXER (aui,0xe);
    SB_writeMIXER(aui,0xe, oldmixervalue | 0x2);// turn on stereo
    SB_writeDSP(baseport,0x14);         // send one byte
    SB_writeDSP(baseport,0x0);
    SB_writeDSP(baseport,0x0);
    for (i=0 ; i<0x10000 ; i++) inp(baseport+0xe);      // ack the dsp
    timeconstant = 65536-(256000000/43478);
    SB_writeDSP(baseport,0x40);
    SB_writeDSP(baseport,timeconstant >> 8);
    SB_writeMIXER(aui,0xE,(SB_readMIXER(aui,0xE)|0x20)); // output filter off, stereo on
    SB_writeDSP(baseport,0x48);
    SB_writeDSP(baseport,aui->card_dmasize & 0xff); // # of samples - 1
    SB_writeDSP(baseport,aui->card_dmasize >> 8);
    SB_writeDSP(baseport,0x90); // high speed 8 bit stereo
    break;
    
     
    Last edit: gerwin 2013-08-25
  • Mpxplay
    Mpxplay
    2013-10-16

    Some answers, test results:
    1. I cannot test the WSS, because I already have no such card, but with the -scv option the program should enable the outputs on 0x06, 0x07 DSP registers. (by default, the outputs are not modified via Mpxplay).
    2. I hear correct left and right sides at SBpro, using DOSbox, so I wouldn't like to modify my code.

    btw. Usually DOSbox crashes, because it doesn't like Mpxplay's interrupt handling. So, start Mpxplay with -bn8 option in this case.
    (And rather use the Win32 version under Windows. The DOS version made for native DOS oses...)

     
  • gerwin
    gerwin
    2013-12-26

    1) confirmed; using -scv 100 makes Crystal WSS work on an original MPXplay v1.57. Only thing is, that normally a program mutes the values again at exit, which is not the case.
    2a) Strange, I have no crashes or swapped stereo with my current dosbox install, even without -bn8.
    2b) I noticed key 'X' is swap channels. Is there a parameter for this too? The SB Pro hardware and compatibility SDKs are known to be inconsistent regarding left vs right channel. Hence many DOS game have a swap stereo option for SB pro in setup.

    I was just using DosBox to analyse the Sound Blaster Initialization routines of games/apps. I don't have the software to do such a thing on real hardware. I found the Quake 1 routines are more compatible then others. Mainly because it flushes any pending DMA data beforehand (line 6 in the code snippet).

     
    Last edit: gerwin 2013-12-26
  • Hi.
    I have a leptop Dell Latitude CP m166st with a Crystal 4237b sound card. A cannot use de mpxplay in WSS mode. The sound driver for DOS enable the mode and show this working (Port 530, Irq 5 DMA 1). But I set the ULTRA16 variable as ULTRA16=530,1,5,0,0 and the mpxplay says "Cannot initialize wss sound card.
    How I do it work ??

     
    Last edit: Thiago Schimuneck 2014-10-19
  • gerwin
    gerwin
    2014-10-22

    Don't know what is going wrong. but some things to try:
    - in CS4232.INI I have WssIO=534, but for MPXplay ULTRA16=530,1,7,0.
    Notice the difference of 4 between 534 and 530.
    - Is the LPT printer port also at IRQ 5? can it be disabled.
    - Maybe try a game with the miles sound system - Windows sound system driver, named "sndsys.dig"? Such as Warcraft II.