audio: fix delay control, increase default buffer delay to 40ms
just doing a single sleep isnt enougth, as we get woken up for every block!
This commit is contained in:
parent
0b268440b9
commit
d41f67c2b9
5 changed files with 8 additions and 5 deletions
|
@ -381,7 +381,8 @@ ac97write(Audio *adev, void *vp, long n, vlong)
|
||||||
}
|
}
|
||||||
p += n;
|
p += n;
|
||||||
}
|
}
|
||||||
sleep(&ring->r, outrate, ctlr);
|
while(outrate(ctlr) == 0)
|
||||||
|
sleep(&ring->r, outrate, ctlr);
|
||||||
return p - (uchar*)vp;
|
return p - (uchar*)vp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1288,7 +1288,8 @@ hdawrite(Audio *adev, void *vp, long n, vlong)
|
||||||
p += n;
|
p += n;
|
||||||
}
|
}
|
||||||
hdakick(ctlr);
|
hdakick(ctlr);
|
||||||
sleep(&ring->r, outrate, ctlr);
|
while(outrate(ctlr) == 0)
|
||||||
|
sleep(&ring->r, outrate, ctlr);
|
||||||
return p - (uchar*)vp;
|
return p - (uchar*)vp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -549,7 +549,8 @@ audiowrite(Audio *adev, void *vp, long n, vlong)
|
||||||
}
|
}
|
||||||
p += n;
|
p += n;
|
||||||
}
|
}
|
||||||
sleep(&ctlr->vous, ratebuf, ctlr);
|
while(ratebuf(ctlr) == 0)
|
||||||
|
sleep(&ctlr->vous, ratebuf, ctlr);
|
||||||
return p - (uchar*)vp;
|
return p - (uchar*)vp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ audioattach(char *spec)
|
||||||
if((attached & i) == 0){
|
if((attached & i) == 0){
|
||||||
static char *settings[] = {
|
static char *settings[] = {
|
||||||
"speed 44100",
|
"speed 44100",
|
||||||
"delay 882", /* 20 ms */
|
"delay 1764", /* 40 ms */
|
||||||
"master 100",
|
"master 100",
|
||||||
"audio 100",
|
"audio 100",
|
||||||
"head 100",
|
"head 100",
|
||||||
|
|
|
@ -14,7 +14,7 @@ struct Audio
|
||||||
int maxfreq;
|
int maxfreq;
|
||||||
};
|
};
|
||||||
|
|
||||||
int audiodelay = 882;
|
int audiodelay = 1764; /* 40 ms */
|
||||||
int audiofreq = 44100;
|
int audiofreq = 44100;
|
||||||
int audiochan = 2;
|
int audiochan = 2;
|
||||||
int audiores = 16;
|
int audiores = 16;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue