mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 23:10:32 +00:00
Reformat HDAudio.ZC
This commit is contained in:
parent
2fd8527fdb
commit
f2490f75bc
1 changed files with 275 additions and 244 deletions
|
@ -1,11 +1,11 @@
|
||||||
//SysFile("~/sup1hdaudio/Sup1CodeScraps/Mem/Mem2Meg.ZC");
|
//SysFile("~/sup1hdaudio/Sup1CodeScraps/Mem/Mem2Meg.ZC");
|
||||||
|
|
||||||
#
|
#help_index "Sound/HDAudio"
|
||||||
help_index "Sound/HDAudio"
|
|
||||||
|
|
||||||
//snd devs
|
//snd devs
|
||||||
#define SD_PC_SPEAKER 0
|
#define SD_PC_SPEAKER 0
|
||||||
#define SD_HD_AUDIO 1
|
#define SD_HD_AUDIO 1
|
||||||
|
|
||||||
#define SND_SAMPLE_RATE 48000
|
#define SND_SAMPLE_RATE 48000
|
||||||
#define SND_SAMPLE_BITS 24
|
#define SND_SAMPLE_BITS 24
|
||||||
#define SND_OCHANNELS 2
|
#define SND_OCHANNELS 2
|
||||||
|
@ -13,8 +13,7 @@ help_index "Sound/HDAudio"
|
||||||
#define SND_OUT_CONTAINER I32
|
#define SND_OUT_CONTAINER I32
|
||||||
#define SND_IN_CONTAINER I16
|
#define SND_IN_CONTAINER I16
|
||||||
#define SND_BUF_LEN 0x400
|
#define SND_BUF_LEN 0x400
|
||||||
#define SND_BUF_TIME_mS(SND_BUF_LEN / SND_OCHANNELS *1000.0 / \
|
#define SND_BUF_TIME_mS (SND_BUF_LEN / SND_OCHANNELS * 1000.0 / SND_SAMPLE_RATE)
|
||||||
SND_SAMPLE_RATE)
|
|
||||||
|
|
||||||
F64 snd_freq = 0;
|
F64 snd_freq = 0;
|
||||||
I64 snd_dev = SD_PC_SPEAKER;
|
I64 snd_dev = SD_PC_SPEAKER;
|
||||||
|
@ -34,18 +33,23 @@ I64 snd_flags;
|
||||||
#define HD_2_CHAN 1
|
#define HD_2_CHAN 1
|
||||||
#define HD_3_CHAN 2
|
#define HD_3_CHAN 2
|
||||||
#define HD_4_CHAN 3
|
#define HD_4_CHAN 3
|
||||||
|
|
||||||
#define HD_8_BIT 0
|
#define HD_8_BIT 0
|
||||||
#define HD_16_BIT 1
|
#define HD_16_BIT 1
|
||||||
#define HD_20_BIT 2
|
#define HD_20_BIT 2
|
||||||
#define HD_24_BIT 3
|
#define HD_24_BIT 3
|
||||||
#define HD_32_BIT 4
|
#define HD_32_BIT 4
|
||||||
#define HD_48kHz 0
|
#define HD_48kHz 0
|
||||||
|
|
||||||
#define HD_DFT_OUT_FMT (HD_2_CHAN + HD_24_BIT << 4 + HD_48kHz << 8)
|
#define HD_DFT_OUT_FMT (HD_2_CHAN + HD_24_BIT << 4 + HD_48kHz << 8)
|
||||||
#define HD_DFT_IN_FMT (HD_2_CHAN + HD_16_BIT << 4 + HD_48kHz << 8)
|
#define HD_DFT_IN_FMT (HD_2_CHAN + HD_16_BIT << 4 + HD_48kHz << 8)
|
||||||
|
|
||||||
#define HD_POS_BUF_MULTIPLES 0x1000
|
#define HD_POS_BUF_MULTIPLES 0x1000
|
||||||
|
|
||||||
#define HD_CORB_ENTRIES 256
|
#define HD_CORB_ENTRIES 256
|
||||||
#define HD_RIRB_ENTRIES 256
|
#define HD_RIRB_ENTRIES 256
|
||||||
#define HD_BDL_ENTRIES 256
|
#define HD_BDL_ENTRIES 256
|
||||||
|
|
||||||
#define HD_GCTL 0x08
|
#define HD_GCTL 0x08
|
||||||
#define HD_STATESTS 0x0E
|
#define HD_STATESTS 0x0E
|
||||||
#define HD_GSTS 0x10
|
#define HD_GSTS 0x10
|
||||||
|
@ -60,6 +64,7 @@ I64 snd_flags;
|
||||||
#define HD_RIRBWP 0x58
|
#define HD_RIRBWP 0x58
|
||||||
#define HD_RIRBCTL 0x5C
|
#define HD_RIRBCTL 0x5C
|
||||||
#define HD_RIRBSTS 0x5D
|
#define HD_RIRBSTS 0x5D
|
||||||
|
|
||||||
#define STRCTL 0x00
|
#define STRCTL 0x00
|
||||||
#define STRSTS 0x03
|
#define STRSTS 0x03
|
||||||
#define STRLPIB 0x04
|
#define STRLPIB 0x04
|
||||||
|
@ -78,6 +83,7 @@ I64 snd_flags;
|
||||||
#define OSTR1 0x120
|
#define OSTR1 0x120
|
||||||
#define OSTR2 0x140
|
#define OSTR2 0x140
|
||||||
#define OSTR3 0x160
|
#define OSTR3 0x160
|
||||||
|
|
||||||
#define VERB_GET_PARAM 0xF0000
|
#define VERB_GET_PARAM 0xF0000
|
||||||
#define VERB_CONNECT_SEL_GET 0xF0100
|
#define VERB_CONNECT_SEL_GET 0xF0100
|
||||||
#define VERB_CONNECT_SEL_SET 0x70100
|
#define VERB_CONNECT_SEL_SET 0x70100
|
||||||
|
@ -193,8 +199,23 @@ I64 snd_flags;
|
||||||
#define AWT_VENDOR 0xF
|
#define AWT_VENDOR 0xF
|
||||||
#define AWT_NODE 0x10
|
#define AWT_NODE 0x10
|
||||||
DefineListLoad("ST_AUDIO_WIDGET_TYPES",
|
DefineListLoad("ST_AUDIO_WIDGET_TYPES",
|
||||||
"Output\0Input\0Mixer\0Sellector\0Pin Complex\0"
|
"Output\0"
|
||||||
"Power Widget\0Vol Knob\0Beep Gen\0\0\0\0\0\0\0\0Vendor\0Node\0");
|
"Input\0"
|
||||||
|
"Mixer\0"
|
||||||
|
"Selector\0"
|
||||||
|
"Pin Complex\0"
|
||||||
|
"Power Widget\0"
|
||||||
|
"Vol Knob\0"
|
||||||
|
"Beep Gen\0"
|
||||||
|
" \0"
|
||||||
|
" \0"
|
||||||
|
" \0"
|
||||||
|
" \0"
|
||||||
|
" \0"
|
||||||
|
" \0"
|
||||||
|
" \0"
|
||||||
|
"Vendor\0"
|
||||||
|
"Node\0");
|
||||||
|
|
||||||
class CHDBufDesc
|
class CHDBufDesc
|
||||||
{
|
{
|
||||||
|
@ -213,8 +234,10 @@ class CHDAudioCtrl
|
||||||
I64 cad;
|
I64 cad;
|
||||||
U32 *corb;
|
U32 *corb;
|
||||||
I64 *rirb;
|
I64 *rirb;
|
||||||
CHDBufDesc *ostr0_bdl, *istr0_bdl;
|
CHDBufDesc *ostr0_bdl,
|
||||||
SND_OUT_CONTAINER *ostr0_buf[2], *o_tmp_buf;
|
*istr0_bdl;
|
||||||
|
SND_OUT_CONTAINER *ostr0_buf[2],
|
||||||
|
*o_tmp_buf;
|
||||||
SND_IN_CONTAINER *istr0_buf[2];
|
SND_IN_CONTAINER *istr0_buf[2];
|
||||||
CTask *task;
|
CTask *task;
|
||||||
I64 waveform;
|
I64 waveform;
|
||||||
|
@ -222,14 +245,14 @@ class CHDAudioCtrl
|
||||||
CSndWaveCtrl *tone_swcs[HD_TONES];
|
CSndWaveCtrl *tone_swcs[HD_TONES];
|
||||||
U8 rirb_rp, corb_wp;
|
U8 rirb_rp, corb_wp;
|
||||||
Bool audio_task_started, in_running, out_running;
|
Bool audio_task_started, in_running, out_running;
|
||||||
}
|
} hda;
|
||||||
|
|
||||||
hda;
|
|
||||||
MemSet(&hda, 0, sizeof(CHDAudioCtrl));
|
MemSet(&hda, 0, sizeof(CHDAudioCtrl));
|
||||||
|
|
||||||
U0 HDSyncCORB()
|
U0 HDSyncCORB()
|
||||||
{
|
{
|
||||||
U16 *wp, *rp;
|
U16 *wp, *rp;
|
||||||
|
|
||||||
wp = hda.bar + HD_CORBWP;
|
wp = hda.bar + HD_CORBWP;
|
||||||
*wp = hda.corb_wp;
|
*wp = hda.corb_wp;
|
||||||
rp = hda.bar + HD_CORBRP;
|
rp = hda.bar + HD_CORBRP;
|
||||||
|
@ -247,10 +270,12 @@ I64 HDSyncRIRB()
|
||||||
{
|
{
|
||||||
U16 *_w;
|
U16 *_w;
|
||||||
I64 wp, res = 0;
|
I64 wp, res = 0;
|
||||||
|
|
||||||
_w = hda.bar + HD_RIRBWP;
|
_w = hda.bar + HD_RIRBWP;
|
||||||
wp = *_w;
|
wp = *_w;
|
||||||
while (hda.rirb_rp != wp)
|
while (hda.rirb_rp != wp)
|
||||||
res = hda.rirb[++hda.rirb_rp];
|
res = hda.rirb[++hda.rirb_rp];
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,12 +283,15 @@ I64 HDReadRIRB()
|
||||||
{
|
{
|
||||||
U16 *_w;
|
U16 *_w;
|
||||||
I64 wp, res = 0;
|
I64 wp, res = 0;
|
||||||
|
|
||||||
_w = hda.bar + HD_RIRBWP;
|
_w = hda.bar + HD_RIRBWP;
|
||||||
do {
|
do
|
||||||
|
{
|
||||||
Yield;
|
Yield;
|
||||||
wp = *_w;
|
wp = *_w;
|
||||||
} while (wp == hda.rirb_rp);
|
} while (wp == hda.rirb_rp);
|
||||||
res = hda.rirb[++hda.rirb_rp];
|
res = hda.rirb[++hda.rirb_rp];
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,6 +321,7 @@ Bool HDTestCORBSync(I64 cad, I64 nid, U32 val)
|
||||||
if (wp == hda.rirb_rp)
|
if (wp == hda.rirb_rp)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
HDReadRIRB;
|
HDReadRIRB;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,7 +353,7 @@ U0 HDTraverse(I64 cad, I64 nid)
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case AWT_OUTPUT:
|
case AWT_OUTPUT:
|
||||||
if (FALSE) //if disabled
|
if (FALSE) //if disabled // ????
|
||||||
HDWriteCORBSync(cad, nid, VERB_CHAN_STREAM_ID_SET + 0x00);
|
HDWriteCORBSync(cad, nid, VERB_CHAN_STREAM_ID_SET + 0x00);
|
||||||
else
|
else
|
||||||
HDWriteCORBSync(cad, nid, VERB_CHAN_STREAM_ID_SET + 0x10);
|
HDWriteCORBSync(cad, nid, VERB_CHAN_STREAM_ID_SET + 0x10);
|
||||||
|
@ -332,7 +361,7 @@ U0 HDTraverse(I64 cad, I64 nid)
|
||||||
HDWriteCORBSync(cad, nid, VERB_PROCESS_STATE_SET + 0x01);
|
HDWriteCORBSync(cad, nid, VERB_PROCESS_STATE_SET + 0x01);
|
||||||
break;
|
break;
|
||||||
case AWT_INPUT:
|
case AWT_INPUT:
|
||||||
if (TRUE) //if disabled
|
if (TRUE) //if disabled // ????
|
||||||
HDWriteCORBSync(cad, nid, VERB_CHAN_STREAM_ID_SET + 0x00);
|
HDWriteCORBSync(cad, nid, VERB_CHAN_STREAM_ID_SET + 0x00);
|
||||||
else
|
else
|
||||||
HDWriteCORBSync(cad, nid, VERB_CHAN_STREAM_ID_SET + 0x20);
|
HDWriteCORBSync(cad, nid, VERB_CHAN_STREAM_ID_SET + 0x20);
|
||||||
|
@ -398,19 +427,19 @@ U0 HDSnd(F64 freq, I64 waveform = WF_SQUARE, F64 amp = 1.0)
|
||||||
U0 HDFillBuf(SND_OUT_CONTAINER *buf, I64)
|
U0 HDFillBuf(SND_OUT_CONTAINER *buf, I64)
|
||||||
{
|
{
|
||||||
I64 i, size = SND_BUF_LEN * sizeof(SND_OUT_CONTAINER);
|
I64 i, size = SND_BUF_LEN * sizeof(SND_OUT_CONTAINER);
|
||||||
|
|
||||||
if (!hda.o_tmp_buf)
|
if (!hda.o_tmp_buf)
|
||||||
hda.o_tmp_buf = SysMAlloc(size);
|
hda.o_tmp_buf = SysMAlloc(size);
|
||||||
MemSet(hda.o_tmp_buf, 0, size);
|
MemSet(hda.o_tmp_buf, 0, size);
|
||||||
for (i = 0; i < HD_TONES; i++)
|
for (i = 0; i < HD_TONES; i++)
|
||||||
SndWaveAddBuf(hda.tone_swcs[i], hda.o_tmp_buf,
|
SndWaveAddBuf(hda.tone_swcs[i], hda.o_tmp_buf, SND_BUF_LEN / SND_OCHANNELS, hda.freq, hda.waveform, snd_vol * hda.amp);
|
||||||
SND_BUF_LEN / SND_OCHANNELS, hda.freq,
|
|
||||||
hda.waveform, snd_vol *hda.amp);
|
|
||||||
MemCopy(buf, hda.o_tmp_buf, size);
|
MemCopy(buf, hda.o_tmp_buf, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 HDAudioTaskEndCB()
|
U0 HDAudioTaskEndCB()
|
||||||
{
|
{
|
||||||
I64 i;
|
I64 i;
|
||||||
|
|
||||||
HDStop(FALSE, TRUE);
|
HDStop(FALSE, TRUE);
|
||||||
fp_snd = NULL;
|
fp_snd = NULL;
|
||||||
for (i = 0; i < HD_TONES; i++)
|
for (i = 0; i < HD_TONES; i++)
|
||||||
|
@ -425,6 +454,7 @@ U0 HDAudioTaskEndCB()
|
||||||
public U0 HDTonesInit()
|
public U0 HDTonesInit()
|
||||||
{
|
{
|
||||||
I64 i;
|
I64 i;
|
||||||
|
|
||||||
if (hda.bar)
|
if (hda.bar)
|
||||||
{
|
{
|
||||||
for (i = 0; i < HD_TONES; i++)
|
for (i = 0; i < HD_TONES; i++)
|
||||||
|
@ -448,6 +478,7 @@ U0 HDAudioTask(I64)
|
||||||
ibuf_rollover = 0;
|
ibuf_rollover = 0;
|
||||||
U32 *pos_in_obuf = hda.bar + OSTR0 + STRLPIB,
|
U32 *pos_in_obuf = hda.bar + OSTR0 + STRLPIB,
|
||||||
*pos_in_ibuf = hda.bar + ISTR0 + STRLPIB;
|
*pos_in_ibuf = hda.bar + ISTR0 + STRLPIB;
|
||||||
|
|
||||||
Fs->task_end_cb = &HDAudioTaskEndCB;
|
Fs->task_end_cb = &HDAudioTaskEndCB;
|
||||||
for (i = 0; i < HD_TONES; i++)
|
for (i = 0; i < HD_TONES; i++)
|
||||||
hda.tone_swcs[i] = SndWaveCtrlNew;
|
hda.tone_swcs[i] = SndWaveCtrlNew;
|
||||||
|
@ -463,35 +494,32 @@ U0 HDAudioTask(I64)
|
||||||
hda.audio_task_started = TRUE; //This flag is probably not necessary
|
hda.audio_task_started = TRUE; //This flag is probably not necessary
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
if (next_obuf_trigger - obuf_rollover <= *pos_in_obuf< next_obuf_trigger - obuf_rollover +
|
if (next_obuf_trigger - obuf_rollover <=
|
||||||
(HD_POS_BUF_MULTIPLES - 1) *SND_BUF_LEN* sizeof(SND_OUT_CONTAINER))
|
*pos_in_obuf <
|
||||||
|
next_obuf_trigger - obuf_rollover + (HD_POS_BUF_MULTIPLES - 1) * SND_BUF_LEN * sizeof(SND_OUT_CONTAINER))
|
||||||
{
|
{
|
||||||
next_obuf_trigger += SND_BUF_LEN * sizeof(SND_OUT_CONTAINER);
|
next_obuf_trigger += SND_BUF_LEN * sizeof(SND_OUT_CONTAINER);
|
||||||
if (next_obuf_trigger - obuf_rollover >=
|
if (next_obuf_trigger - obuf_rollover >= HD_POS_BUF_MULTIPLES * SND_BUF_LEN * sizeof(SND_OUT_CONTAINER))
|
||||||
HD_POS_BUF_MULTIPLES *SND_BUF_LEN* sizeof(SND_OUT_CONTAINER))
|
obuf_rollover += HD_POS_BUF_MULTIPLES * SND_BUF_LEN * sizeof(SND_OUT_CONTAINER);
|
||||||
obuf_rollover += HD_POS_BUF_MULTIPLES *SND_BUF_LEN *
|
|
||||||
sizeof(SND_OUT_CONTAINER);
|
|
||||||
if (fp_snd_fill_buf)
|
if (fp_snd_fill_buf)
|
||||||
{
|
{
|
||||||
LBts(&snd_flags, Sf_FILLING_OUT);
|
LBts(&snd_flags, Sf_FILLING_OUT);
|
||||||
(*fp_snd_fill_buf)(hda.ostr0_buf[snd_obuf_num & 1], snd_obuf_num);
|
(*fp_snd_fill_buf)(hda.ostr0_buf[snd_obuf_num & 1], snd_obuf_num);
|
||||||
if (IsMute)
|
if (IsMute)
|
||||||
MemSet(hda.ostr0_buf[snd_obuf_num & 1], 0,
|
MemSet(hda.ostr0_buf[snd_obuf_num & 1], 0, SND_BUF_LEN * sizeof(SND_OUT_CONTAINER));
|
||||||
SND_BUF_LEN* sizeof(SND_OUT_CONTAINER));
|
|
||||||
LBtr(&snd_flags, Sf_FILLING_OUT);
|
LBtr(&snd_flags, Sf_FILLING_OUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
snd_obuf_num++;
|
snd_obuf_num++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next_ibuf_trigger - ibuf_rollover <= *pos_in_ibuf< next_ibuf_trigger - ibuf_rollover + (HD_POS_BUF_MULTIPLES - 1) *
|
if (next_ibuf_trigger - ibuf_rollover <=
|
||||||
SND_BUF_LEN* sizeof(SND_IN_CONTAINER))
|
*pos_in_ibuf <
|
||||||
|
next_ibuf_trigger - ibuf_rollover + (HD_POS_BUF_MULTIPLES - 1) * SND_BUF_LEN * sizeof(SND_IN_CONTAINER))
|
||||||
{
|
{
|
||||||
next_ibuf_trigger += SND_BUF_LEN* sizeof(SND_IN_CONTAINER);
|
next_ibuf_trigger += SND_BUF_LEN* sizeof(SND_IN_CONTAINER);
|
||||||
if (next_ibuf_trigger - ibuf_rollover >=
|
if (next_ibuf_trigger - ibuf_rollover >= HD_POS_BUF_MULTIPLES * SND_BUF_LEN * sizeof(SND_IN_CONTAINER))
|
||||||
HD_POS_BUF_MULTIPLES *SND_BUF_LEN* sizeof(SND_IN_CONTAINER))
|
ibuf_rollover += HD_POS_BUF_MULTIPLES * SND_BUF_LEN * sizeof(SND_IN_CONTAINER);
|
||||||
ibuf_rollover += HD_POS_BUF_MULTIPLES *SND_BUF_LEN *
|
|
||||||
sizeof(SND_IN_CONTAINER);
|
|
||||||
if (fp_snd_copy_buf)
|
if (fp_snd_copy_buf)
|
||||||
(*fp_snd_copy_buf)(hda.istr0_buf[snd_obuf_num & 1], snd_ibuf_num);
|
(*fp_snd_copy_buf)(hda.istr0_buf[snd_obuf_num & 1], snd_ibuf_num);
|
||||||
snd_ibuf_num++;
|
snd_ibuf_num++;
|
||||||
|
@ -504,15 +532,18 @@ U0 HDAudioTask(I64)
|
||||||
U0 HDRst()
|
U0 HDRst()
|
||||||
{
|
{
|
||||||
U32 d, *_d;
|
U32 d, *_d;
|
||||||
|
|
||||||
HDStop(TRUE, TRUE);
|
HDStop(TRUE, TRUE);
|
||||||
_d = hda.bar + HD_GCTL;
|
_d = hda.bar + HD_GCTL;
|
||||||
*_d = 0; //rst
|
*_d = 0; //rst
|
||||||
do {
|
do
|
||||||
|
{
|
||||||
Sleep(1);
|
Sleep(1);
|
||||||
d = *_d;
|
d = *_d;
|
||||||
} while (d & 1);
|
} while (d & 1);
|
||||||
*_d = 1;
|
*_d = 1;
|
||||||
do {
|
do
|
||||||
|
{
|
||||||
Sleep(1);
|
Sleep(1);
|
||||||
d = *_d;
|
d = *_d;
|
||||||
} while (!(d & 1));
|
} while (!(d & 1));
|
||||||
|
@ -559,11 +590,9 @@ public Bool HDAudioInit(I64 hd_bus, I64 hd_dev, I64 hd_fun)
|
||||||
HDAudioEnd;
|
HDAudioEnd;
|
||||||
else
|
else
|
||||||
HDAudioUncachedInit;
|
HDAudioUncachedInit;
|
||||||
if (PCIReadU16(hd_bus, hd_dev, hd_fun, 0) == 0x8086 &&
|
if (PCIReadU16(hd_bus, hd_dev, hd_fun, 0) == 0x8086 && (hda.bar = PCIReadU32(hd_bus, hd_dev, hd_fun, 0x10) & ~(0x1F)))
|
||||||
(hda.bar = PCIReadU32(hd_bus, hd_dev, hd_fun, 0x10) &~(0x1F)))
|
|
||||||
{
|
{
|
||||||
PCIWriteU16(hd_bus, hd_dev, hd_fun, 0x04,
|
PCIWriteU16(hd_bus, hd_dev, hd_fun, 0x04, PCIReadU16(hd_bus, hd_dev, hd_fun, 0x04) | 0x406);
|
||||||
PCIReadU16(hd_bus, hd_dev, hd_fun, 0x04) | 0x406);
|
|
||||||
|
|
||||||
HDRst;
|
HDRst;
|
||||||
|
|
||||||
|
@ -581,11 +610,15 @@ public Bool HDAudioInit(I64 hd_bus, I64 hd_dev, I64 hd_fun)
|
||||||
|
|
||||||
_w = hda.bar + HD_CORBRP;
|
_w = hda.bar + HD_CORBRP;
|
||||||
*_w = 0x8000; //Rst read ptr
|
*_w = 0x8000; //Rst read ptr
|
||||||
do { Yield;
|
do
|
||||||
|
{
|
||||||
|
Yield;
|
||||||
w = *_w;
|
w = *_w;
|
||||||
} while (!(w & 0x8000));
|
} while (!(w & 0x8000));
|
||||||
*_w = 0x0000; //Rst read ptr
|
*_w = 0x0000; //Rst read ptr
|
||||||
do { Yield;
|
do
|
||||||
|
{
|
||||||
|
Yield;
|
||||||
w = *_w;
|
w = *_w;
|
||||||
} while (w & 0x8000);
|
} while (w & 0x8000);
|
||||||
|
|
||||||
|
@ -609,8 +642,7 @@ public Bool HDAudioInit(I64 hd_bus, I64 hd_dev, I64 hd_fun)
|
||||||
*_d = hda.ostr0_bdl(I64).u32[1];
|
*_d = hda.ostr0_bdl(I64).u32[1];
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
hda.ostr0_bdl[i].buf = hda.ostr0_buf[i] =
|
hda.ostr0_bdl[i].buf = hda.ostr0_buf[i] = CAllocAligned(SND_BUF_LEN * sizeof(SND_OUT_CONTAINER), 128, hda.hc);
|
||||||
CAllocAligned( SND_BUF_LEN* sizeof(SND_OUT_CONTAINER), 128, hda.hc);
|
|
||||||
hda.ostr0_bdl[i].len = SND_BUF_LEN * sizeof(SND_OUT_CONTAINER);
|
hda.ostr0_bdl[i].len = SND_BUF_LEN * sizeof(SND_OUT_CONTAINER);
|
||||||
hda.ostr0_bdl[i].ctrl = 1;
|
hda.ostr0_bdl[i].ctrl = 1;
|
||||||
}
|
}
|
||||||
|
@ -693,5 +725,4 @@ Bool HDAudioScan()
|
||||||
|
|
||||||
HDAudioScan;
|
HDAudioScan;
|
||||||
|
|
||||||
#
|
#help_index ""
|
||||||
help_index ""
|
|
Loading…
Reference in a new issue