Skip to content

Commit 90c88f3

Browse files
v1.7
1 parent 836530e commit 90c88f3

File tree

4 files changed

+23
-11
lines changed

4 files changed

+23
-11
lines changed

History.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
v1.7, __._.2025
2+
v1.7, 11.8.2025
33
- fixed: clear CF in case int 31h hook proc handles the function (ax=0x20x).
44
- added soundfont support from VSBHDASF; new cmdline options /SF, /MV, /PS.
55
- fixed: array bounds check in vopl3.cpp added (& 0xff).
@@ -14,7 +14,7 @@
1414
- fixed: ES1371 audio driver.
1515
- /F cmdline option now accepts 11025 as argument.
1616
- added support for SiS 7012.
17-
- cmdline option /O1 for SBLive enables speaker connector.
17+
- cmdline option /O1 for SBLive enables speaker jack.
1818
- fixed: SB Live/SB Audigy FX8010 initialization.
1919

2020
v1.6, 10.6.2025

MPXPLAY/SC_E1371.C

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
//**************************************************************************
1515
//function: Ensoniq 1371/1373 low level routines (for SB PCI 16/64/128 cards)
1616
//based on ALSA (http://www.alsa-project.org)
17+
//v1.7 fix: 5880 variants weren't enabled, since the "enable" bit was set
18+
//in ES_REG_SERIAL, but has to be set in ES_REG_STATUS (fix by mkarcher).
1719

1820
#include <stdlib.h>
1921
#include <stdint.h>
@@ -28,7 +30,7 @@
2830
#include "PCIBIOS.H"
2931
#include "AC97MIX.H"
3032

31-
#if 0
33+
#if 0 /* v1.7: generally use 512 as default period_size */
3234
#define ES1371_DMABUF_PERIODS 32
3335
#define ES1371_MAX_CHANNELS 2
3436
#define ES1371_MAX_BYTES 4
@@ -37,18 +39,21 @@
3739
#define ES1371_DMABUF_ALIGN 512
3840
#endif
3941

40-
/* 00-07 interrupt/chip select
42+
/* v1.7: poll count reduced */
43+
//#define POLL_COUNT 0x8000
44+
#define POLL_COUNT 0x1000
45+
46+
/* ports:
47+
* 00-07 interrupt/chip select
4148
* 08-0B UART
42-
* 0C-0F host interface - memory page
49+
* 0C-0F host interface - memory page
4350
* 10-13 sample rate converter
4451
* 14-17 codec
4552
* 18-1F legacy
4653
* 20-2F serial interface
4754
* 30-3F host interface - memory
4855
*/
4956

50-
#define POLL_COUNT 0x1000
51-
5257
#define ES_REG_CONTROL 0x00 /* R/W: Interrupt/Chip select control register */
5358
#define ES_1371_GPIO_OUT(o) (((o)&0x0f)<<16)/* GPIO out [3:0] pins - W/R */
5459
#define ES_1371_SYNC_RES (1<<14) /* Warm AC97 reset */
@@ -187,6 +192,9 @@
187192

188193
#define ENSONIQ_CARD_INFOBIT_AC97RESETHACK 0x01
189194

195+
/* sample rate converter (SRC) mask for status check;
196+
* bits 16-18, although used here, are documented as "undefined"!
197+
*/
190198
#define SRC_MASK 0x870000UL
191199

192200
struct ensoniq_card_s
@@ -228,7 +236,6 @@ static unsigned int snd_es1371_wait_src_rdy(struct ensoniq_card_s *card)
228236
}
229237

230238
/* read "sample rate converter" data
231-
* it's undocumented what purpose bit 16 has ( neither is bit 17/18 explained )
232239
*/
233240

234241
static unsigned short snd_es1371_src_read(struct ensoniq_card_s *card, unsigned short reg)
@@ -463,8 +470,9 @@ static unsigned int snd_es1371_buffer_init( struct ensoniq_card_s *card, struct
463470
//////////////////////////////////////////////////////////////////////////////////////////////////////
464471
{
465472
unsigned int bytes_per_sample = 2; // 16 bit
473+
/* v1.7: use /PS cmdline option if set */
466474
//card->pcmout_bufsize = MDma_get_max_pcmoutbufsize( aui, 0, ES1371_DMABUF_ALIGN, bytes_per_sample, 0);
467-
card->pcmout_bufsize = MDma_get_max_pcmoutbufsize( aui, 0, aui->gvars->period_size ? aui->gvars->period_size : ES1371_DMABUF_ALIGN, bytes_per_sample, 0);
475+
card->pcmout_bufsize = MDma_get_max_pcmoutbufsize( aui, 0, aui->gvars->period_size ? aui->gvars->period_size : ES1371_DMABUF_ALIGN, bytes_per_sample, 0);
468476
card->dm = MDma_alloc_cardmem( card->pcmout_bufsize );
469477
if (!card->dm)
470478
return 0;
@@ -566,6 +574,7 @@ static void snd_es1371_prepare_playback( struct ensoniq_card_s *card, struct aud
566574
/* for DAC1: FRAME=port 30h, SIZE=port 34h, COUNT=port 24h */
567575
outl((card->port + ES_REG_DAC_FRAME), (unsigned long) pds_cardmem_physicalptr(card->dm, card->pcmout_buffer));
568576
outl((card->port + ES_REG_DAC_SIZE), (aui->card_dmasize >> 2) - 1);
577+
/* v1.7: use /PS cmdline option if set */
569578
//outl((card->port + ES_REG_DAC_COUNT), (aui->card_dmasize >> 2) - 1);
570579
outl((card->port + ES_REG_DAC_COUNT), aui->gvars->period_size ? (aui->gvars->period_size >> 2) - 1 : (512>>2) - 1);
571580

@@ -636,6 +645,7 @@ static int ES1371_adetect( struct audioout_info_s *aui )
636645
|| ((card->pci_dev->device_id == 0x5880) && ((card->chiprev == CT5880REV_CT5880_C) || (card->chiprev == CT5880REV_CT5880_D) || (card->chiprev == CT5880REV_CT5880_E)))
637646
) ) {
638647
card->infobits |= ENSONIQ_CARD_INFOBIT_AC97RESETHACK;
648+
/* v1.7 fix: to enable 5880, bit 29 has to be set IN THE STATUS register */
639649
//card->sctrl |= ES_1371_ST_AC97_RST;
640650
card->cssr |= ES_1371_ST_AC97_RST;
641651
dbgprintf(("ES1371_adetect: INFOBIT_AC97RESETHACK set\n"));
@@ -680,6 +690,7 @@ static void ES1371_setrate( struct audioout_info_s *aui )
680690
/////////////////////////////////////////////////////////
681691
{
682692
struct ensoniq_card_s *card = aui->card_private_data;
693+
/* v1.7: use /PS cmdline option if set */
683694
unsigned int pagesize = aui->gvars->period_size ? aui->gvars->period_size : ES1371_DMABUF_ALIGN;
684695

685696
dbgprintf(("ES1371_setrate\n"));

src/MAIN.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static const struct {
160160
"PS", "Set period size [def 512]", &gvars.period_size,
161161
#if SOUNDFONT
162162
"SF:", "Set sound font file name", (int *)&gvars.soundfont,
163-
"MV", "Set voice limit [1-256, def 64]", &gvars.voices,
163+
"MV", "Set voice limit [0-256, def 64]", &gvars.voices,
164164
#endif
165165
"CF", "Set compatibility flags [def 0]", &gvars.compatflags,
166166
NULL, NULL, 0,

vsbhda.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
This option uses the RDTSC instruction - Although usually no problem, this
120120
instruction is priviledged if bit TSD (bit 2) is set in register CR4; then
121121
running this instruction in ring3 will cause a GPF.
122+
- /DIVE: the fix can only work for programs running in protected-mode!
122123
- /PS: "period size" is space (in bytes) for samples rendered during one
123124
interrupt request. A period size of 512, for example, means that about
124125
128 samples will be rendered ( since output is always 16-bit, stereo ).
@@ -128,7 +129,7 @@
128129
synthesizer you'll usually have to also set the MPU port - either via the
129130
BLASTER variable or the /P cmdline option.
130131
- /MV: setting a voice limit of 0 will trigger dynamic allocation - this
131-
may not work for all applications.
132+
is the most flexible setting, but may not work for all applications.
132133
- /O: for the SB Live card, /O1 enables the "speaker" connector; /O2
133134
has no meaning for this card.
134135
- /CF: defines up to 32 bits to fine tune VSBHDA's behavior.

0 commit comments

Comments
 (0)