Baron-von-Riedesel / VSBHDA

Sound Blaster emulation for DOS
57 stars 3 forks source link

VSBHDA not compatible with VIA Vinyl HDA #16

Open redruM0381 opened 1 month ago

redruM0381 commented 1 month ago

Attempting to use VSBHDA on a Wyse Cx0 thin client. I believe it has a Via Vinyl HD chipset. Works fine with SBEMU, which picks it up as Intel HDA.

JemmEx loaded
SET BLASTER=A220 I7 D1 H5 P330 T6
jload -q qpiemu.dll
jload -q jhdmpi.dll
hdpmi16i -x2
vsbhda16
HDA: card 0 skipped (mixer init error)
No soundcard found!

Both 32bit and 16bit versions give the same error.

Baron-von-Riedesel commented 1 month ago

Ok, that reminds me that this "mixer init error" msg is too generic and has to be improved.

It might just be the case that your HDA device has no lineout widget - try the /O1 option to tell the program that it should scan for a "speaker".

redruM0381 commented 1 month ago

I tried /O1 and /O2. Same error as before. The speakers are plugged into the headphone jack. These TC's only have headphones, and mic jacks.

redruM0381 commented 1 month ago

I found your debug version. Here's the output:

vsbhda16: entry, esp=8524
b7: malloc(c) free=0 (dynend/curbrk=8524/8524
b7, brk(10): new/old _curbrk 11000/8524, _dynend=9000
b7: malloc(18) free=7ff0 (dynend/curbrk=9010/11000
b7: malloc(18) free=7fd4 (dynend/curbrk=902c/11000
b7: malloc(18) free=7fb8 (dynend/curbrk=9048/11000
b7: malloc(18) free=7f9c (dynend/curbrk=9064/11000
b7: malloc(18) free=7f80 (dynend/curbrk=9080/11000
b7: malloc(bd) free=7f64 (dynend/curbrk=909c/11000
b7: malloc(2c) free=7ea0 (dynend/curbrk=9160/11000
AU_init
d7: malloc(a4) free=1000 (dynend/curbrk=77bc/87bc
MDma_get_max_pcmoutbufsize(77c0, 65535, 4608, 2, 0
AU_init: checking card ENS
d7: malloc(2c) free=f58 (dynend/curbrk=7864/87bc
d7: malloc(10) free=f28 (dynend/curbrk=7894/87bc
MDma_free_cardmem(0)
d7: free(7894) ok
d7: free(7864) ok
AU_init: checking card ICH AC97
d7: malloc(34) free=f58 (dynend/curbrk=7864/87bc
d7: malloc(10) free=f20 (dynend/curbrk=789c/87bc
MDma_free_cardmem(0)
d7: free(789c) ok
d7: free(7864) ok
AU_init: checking card Intel HDA
d7: malloc(90) free=f58 (dynend/curbrk=7864/87bc
d7: malloc(10) free=ec4 (dynend/curbrk=78f8/87bc
MDma_get_max_pcmoutbufsize(77c0, 0, 512, 2, 0
MDma_alloc_cardmem(45312)
d7: malloc(c) free=eb0 (dynend/curbrk=790c/87bc
MDma_alloc_cardmem: b000
hda_buffer_init: cs=0 csc=0 GCAP=4401 SD-ofs=100
HDA_adetect, board type: VIA 82xx (vendor/ID=1106/3288)
azx_reset: GCTL=1
azx_reset: done, codec_mask:0
hda_hw_init: STATESTS=0 INTCTL=c0000000 INTSTS=0
hda_hw_init: CORB base=9c4000 wp=0 rp=0 ctl=0 sts=0 siz=42
hda_hw_init: RIRB base=9c4400 wp=0 ric=40 ctl=0 sts=0 siz=42
HDA_adetect: hw init done
HDA: card 0 skipped (mixer init error)
hda_hw_close: STATESTS=0 INTCTL=c0000000 INTSTS=0
hda_hw_close: CORB base=9c4000 wp=0 rp=0 ctl=0 sts=0 siz=42
hda_hw_close: RIRB base=9c4400 wp=0 ric=40 ctl=0 sts=0 siz=42
MDma_free_cardmem(7910)
d7: free(790c) ok
HDA_close
d7: free(78f8) ok
d7: free(7864) ok
HDA_adetect: no acceptable card found
AU_init: checking card SB Live!/Audigy
SBLIVE_adetect
d7: malloc(40) free=f58 (dynend/curbrk=7864/87bc
d7: malloc(10) free=f14 (dynend/curbrk=78a8/87bc
MDma_free_cardmem(0)
d7: free(78a8) ok
d7: free(7864) ok
AU_init: checking card VIA VT82XX AC97
d7: malloc(28) free=f58 (dynend/curbrk=7864/87bc
d7: malloc(10) free=f2c (dynend/curbrk=7890/87bc
VIA82XX_close
MDma_free_cardmem(0)
d7: free(7890) ok
d7: free(7864) ok
No soundcard found!
b7: free(9010) failed
b7: free(902c) failed
b7: free(9048) failed
b7: free(9064) failed
b7: free(9080) failed
b7: free(9000) failed
b7: free(9160) ok
b7: malloc(4) free=7ea0 (dynend/curbrk=9160/11000
b7: free(9160) ok
b7: free(909c) ok
Baron-von-Riedesel commented 1 month ago

hda_hw_init: STATESTS=0 INTCTL=c0000000 INTSTS=0

Ok, I see. It doesn't even try to talk to a codec, because HDA field STATESTS is zero - making vsbhda assume there's no codec attached. In this case the "mixer init error" is plainly wrong.

A fix might be to reset the HDA controller if field STATESTS is zero. However, to verify that this indeed may fix the problem you should first try tool HDASTAT - it has an option to reset the HDA controller. So:

  1. run "HDASTAT -r -a -n" ( resets the controller and limits displays to the minumum )
  2. lauch start.bat

https://github.com/Baron-von-Riedesel/HDAutils

redruM0381 commented 1 month ago

That works! Well, sorta. At least we're on the right track. Emulation is working now, but buggy.

I'm trying to use the 16bit protected mode so Tyrian launches. It launches now, but PCM sounds are noisy w/ loud static. Sounds also play with ~500ms delay. It also hangs solid as soon as I load a level, but only if PCM is enabled. Music is totally fine.

I also noticed that Doom/Duke3d/Wolf3d do not run at all w/ 16bit VSBHDA, but do work fine with the 32bit version (expected?).

Baron-von-Riedesel commented 1 month ago

but PCM sounds are noisy w/ loud static.

This is a known issue and surely will be fixed eventually...

also noticed that Doom/Duke3d/Wolf3d do not run at all w/ 16bit VSBHDA, but do work fine with the 32bit version (expected?).

Wolf3d should work, since it is a real-mode game. DOS/4GW games like Doom won't run, that's "by design".

Baron-von-Riedesel commented 1 month ago

the noise issue should be fixed now.

redruM0381 commented 1 month ago

The noise issue does seem to be fixed in the menus, but Tyrian still hard locks the machine once a level is loaded. This doesnt occur if sound effects are disabled.

The wolf3d issue is only with JemmEx loaded, so unrelated. I guess they don't play well together. Wolf3d reports not enough memory, even though there's 590k conventional and 32mb EMS reported. himem.sys works fine with it, but that won't work with VSBHDA.

Baron-von-Riedesel commented 4 weeks ago

The wolf3d issue is only with JemmEx loaded, so unrelated. I guess they don't play well together.

It's no generic problem, because for me it works, no matter if JemmEx is loaded with EMS support or not ( with EMS, there's 596 kB free conv. memory, without there's 627 kB ). So I'm afraid I cannot help on this issue.