SBEMU icon indicating copy to clipboard operation
SBEMU copied to clipboard

Test Results for 7 Sound Cards (Additional Sound Card Drivers do not seem to work)

Open Torinde opened this issue 2 years ago • 82 comments

Hi I just tested 7 sound cards with SBEMU-X here are the results: (Tested only with Quake)

  • Sound Blaster Live 5.1 [SB0100] for reference: Works, no issues. Sound a bit on the low side; but same as SB-EMU

  • CMI8738-PCI-6CH-LX, CMI-8738-PCI-6CH, CMI8738-PCI-SX Sound Card: CMI Real mode support: enabled Protected mode support: enabled OPL3 Emulation at port 388: enabled Crash Sometime followed after a few seconds by: JemmEx: Exception 0D or 06

  • Sound Blaster 16 PCI Sound Card: ENS Real mode support: enabled Protected mode support: enabled OPL3 Emulation at port 388: enabled Crash

  • ESS-Solo-1 [ES1938S] No Supported Sound Card Found

  • AC97 [ULi Electronics Inc. M5455] No Supported Sound Card Found

Originally posted by @hjnijlunsing in https://github.com/sbemu-x/sbemu-x/issues/11

Torinde avatar Dec 20 '23 06:12 Torinde

I updated a fix for CMI, please test if you can, thanks. @hjnijlunsing

crazii avatar Jan 13 '24 03:01 crazii

Sound Blaster 16 PCI is also fixed.

I don't think SBEMU is needed for ESS Solo-1 since the card has good SB support.

crazii avatar Jan 13 '24 09:01 crazii

I tried the new version; findings:

  • SBLive (Reference)
  • Works with Doom (Also OPL) / Quake
  • Lemmings (Crashed) - I believe this worked ealier, but not 100% sure
  • SB 16: Sound Blaster 16 PCI Sound Card: Ensonic/SBPCI Real mode support: enabled Protected mode support: enabled OPL3 Emulation at port 388: enabled SB Pro Emulation at address 220, IRQ 7, DNA 1: enabled JemmEx: exception 06 occured at <BLA> ( I have pictures on the details if needed)

  • All 3 CMI Based cards: Sound Card: CMI 8338/8738 Real mode support: enabled Protected mode support: enabled OPL3 Emulation at port 388: enabled SB Pro Emulation at address 220, IRQ 7, DNA 1: enabled JemmEx: exception 06 occured at <BLA> ( I have pictures on the details if needed)

The errors are now happening always and the same (in the past; either crash without error; or error after few secs).

ESS Solo-1 Dos support is currently very much depending on Motherboard; thus with my ALI chipset it does not work as it does not support the TDMA/WDMA/PC-LINK. On my VIA chipset ESS Solo drivers do work. Great thing with SBEMU is that it does not seem to be dependent on these motherboard features :)

hjnijlunsing avatar Jan 13 '24 11:01 hjnijlunsing

OK, fair enough. There's driver for Solo-1, also Maestro/Allegro in ALSA, but it needs time to porting them.

I'll check the code to see what's wrong with the sbpci and CMI drivers.

crazii avatar Jan 13 '24 11:01 crazii

I updated another fix, try the latest build, thanks.

crazii avatar Jan 13 '24 12:01 crazii

Same results as earlier (Tested SB16-PCI, 1 CMI Card and the reference SBLive).

Let me know in case you want me to enable debugging. I have spare pc's laying around which I can connect to the serial port if needed. sbemu

Also going forward it would be good to include the userbuild number in SBEMU as we are probably going to collect a lot of screen shots ;-)

Quick check; are you located in NL? If so I would be happy to send you a CMI card. (Only reason I have them here is to play with SBEMU, apart from that I do not have a real use for them ;-) )

hjnijlunsing avatar Jan 13 '24 13:01 hjnijlunsing

I appreciate your offer, but I have my retro rig with SBLINK+ymf724, and I might have a piece of CMI card or two, but I put them all up. BTW I lives in Shanghai, China, a place doomed by some party and the GFW.

crazii avatar Jan 13 '24 13:01 crazii

BTW can you perform a local build with your PC enabling the log in sc_es1731.c? just uncomment the line //#define MPXPLAY_USE_DEBUGF 1 in line 18.

crazii avatar Jan 13 '24 13:01 crazii

Results: sbemu

hjnijlunsing avatar Jan 13 '24 17:01 hjnijlunsing

Thanks to @jiyunomegami, now CMI driver works. I also tried to fix ES1371 agian, you can confirm both changes.

crazii avatar Jan 13 '24 18:01 crazii

Just tested; my results are different.

Positive side: All crashes are resolved ;-)

Tests with Doom:

  • Sound Blaster Live (reference) - Works OPL + Digital
  • Sound Blaster 16 PCI - No sound (Music or Digital)
  • CMI8738-PCI-SX - No sound (Music or Digital)
  • CMI8738-PCI-6CH-LX - Music sounds fine, Digital is garbled & stuttering
  • CMI-8738-PCI-6CH - Music sounds fine, Digital is garbled & stuttering (Let me know if an audio recording is helpful)

hjnijlunsing avatar Jan 13 '24 18:01 hjnijlunsing

I think the CMI driver works, but the problem is the buffer is too long, the interrupt happens in too low frequency that the digital sounds will be delayed(SBEMU will fill new data on each interrupt). besides CMI/ES1371 cards have no "PERIODS", all other cards can divide the buffer into periods and issue an interrupt on each periods done, it's like double/multiple buffering that avoid sound buffer underrun. I'll see to the ES1371 problems and try to improve the CMI buffering tomorrow.

crazii avatar Jan 13 '24 19:01 crazii

I added experimental code for CMI, can you confirm the changes? thanks

crazii avatar Jan 14 '24 03:01 crazii

What's the IRQ number used for your ES1371 card? is it below 7 (may be 5/7) or higher (9/10/11)? It might be that the default setup uses 5/7 to get DOS compatibility, but it's not level triggered.

crazii avatar Jan 14 '24 04:01 crazii

I forgot that VirtualBox has a SBPCI sound card, I can debug with it. EDIT: not recognized, probably a ISA card. VMWare player has an SBPCI.

crazii avatar Jan 14 '24 04:01 crazii

With the latest CMI driver, playing the Monkey Island intro, I get some buzzing (within the normal music), and then the system crashes after the intro ends and the game begins.

jiyunomegami avatar Jan 14 '24 07:01 jiyunomegami

The sound is OK if you use card->dma_size -1 and card->period_size -1 in setrate: snd_cmipci_write_16(card, CM_REG_CH0_FRAME2 , card->dma_size - 1); snd_cmipci_write_16(card, CM_REG_CH0_FRAME2 + 2, card->period_size - 1);

jiyunomegami avatar Jan 14 '24 07:01 jiyunomegami

Yes, that's an experimental piece of code - the CMI spec/datasheet says only "count" no mentioning -1, so I just wanna try it. I just reverted it.

BTW it seems the ES1371 driver has no big problem, only the volume is too low, I adjusted the initial volume now it has sounds, code updated. or you may try the /VOL8 or VOL9 (no spaces, 9 is the maximum) to set volume. But the digital sound seems delayed, noticeably in Duke3d menu "clicks", I don't know if it is a problem of VMWare player or real, so you may check the result. The period of buffering is also added for ES1371.

We still got problem on CMI8738-PCI-SX, I'll check the code again.

crazii avatar Jan 14 '24 08:01 crazii

Also going forward it would be good to include the userbuild number in SBEMU as we are probably going to collect a lot of screen shots ;-)

@volkertb could help with that.

crazii avatar Jan 14 '24 09:01 crazii

Very interesting results; two of my CMI cards are working as is the ES1371 now!

In fact... They are working better then my reference Sound Blaster Live which seems to have an audible back-tick with FX, not very disturbing, but the CMI and ES1371 do not have these issues.

Also tried the onboard VIA VT8233, this also seems to have some buffer issues. Thus kind of the same issues / sound issues as the CMI's were facing earlier. Is a similar fix a possibility? ;-)

(I can make sound recordings if required)

hjnijlunsing avatar Jan 14 '24 09:01 hjnijlunsing

I believe I already did that for VT82xx, but there might be other problems.

EDIT: I've fix a bug on VT8237, which is the same chip of 8233, but I don't have a VT8233 PC, only a 8237 bought in order to fix that bug.

crazii avatar Jan 14 '24 09:01 crazii

In fact... They are working better then my reference Sound Blaster Live which seems to have an audible back-tick with FX, not very disturbing, but the CMI and ES1371 do not have these issues.

The SBLive uses 4096 bytes buffer which may have the same problem, but I don't know if it is required by the spec or not, I cannot find the spec/datasheet for emu10k1, nor do I have a card to test, but you may change emu10k1.h:37 #define EMUPAGESIZE 4096 to 512 and try it out. and if it works, I think it'll be good news.

crazii avatar Jan 14 '24 10:01 crazii

Just tried changing it; unfortunately running SBEMU after the change just results in a lot of noise.

hjnijlunsing avatar Jan 14 '24 10:01 hjnijlunsing

Then it's probably required by the spec, I remember a timer interrupt is used, you can tune the value of sc_sbliv.c:867 emu10k1_writefn0(card, TIMER, 0x240); //set timer rate to see what happens, it is not well documented, I believe it can be improved. maybe 0x3FF would be better?

crazii avatar Jan 14 '24 10:01 crazii

I cannot find the spec/datasheet for emu10k1

There are Live! drivers for Linux and other OSes (along with other materials at the linked issues) - in case that helps.

Torinde avatar Jan 14 '24 12:01 Torinde

I cannot find the spec/datasheet for emu10k1

There are Live! drivers for Linux and other OSes (along with other materials at the linked issues) - in case that helps.

I remember checked multiple sources but they are all the same one, besides the special interrupt behavior for real time reaction might not be required/implemented by other code, that's a problem.

crazii avatar Jan 14 '24 13:01 crazii

Have you checked the SB Live! OSS driver sources yet? Those should really be different from the drivers in the mainline Linux kernel, since the OSS drivers are licensed differently, and have different people working on them.

Alternatively, the sound driver sources in the xBSDs should also be distinct from the Linux drivers, since the Linux driver sources are licensed under GPLv2 and also use the Linux-specific ALSA architecture/model, and the xBSD projects prefer to license their sources more liberally, and therefore can't just copy the Linux sources.

volkertb avatar Jan 14 '24 13:01 volkertb

I had a peek on OSS today, not to the emu10k1 source yet.

crazii avatar Jan 14 '24 13:01 crazii

Oh, and in addition to the above sources, you might also want to take a look at the open-source kX Project drivers, which are alternative Windows and macOS drivers for a number of sound cards, including the Sound Blaster Live!.

You can find their projects and sources at https://github.com/kxproject

I remember switching to kX audio drivers back in the day, when I was using Windows 2000 on a PC with a Sound Blaster Live!, because I was fed up with the buggy Creative drivers. I remember the kX drivers being rock-stable and flawless, unlike the official Creative drivers. :sweat_smile:

Maybe those driver sources might provide some clues as well. :slightly_smiling_face:

volkertb avatar Jan 14 '24 13:01 volkertb

Setting it to 0x3FF definitely made it worse.

Also I am getting warning (unrelated) currently when compiling:

CC output/mpxplay/au_cards/sc_inthd.o mpxplay/au_cards/sc_inthd.c: In function 'snd_ihd_mixer_init': mpxplay/au_cards/sc_inthd.c:937:3: warning: implicit declaration of function 'delay' [-Wimplicit-function-declaration] 937 | delay(10); | ^~~~~

hjnijlunsing avatar Jan 14 '24 14:01 hjnijlunsing