conf: add support for timer period audio setting

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2021-06-03 09:15:19 +01:00
parent 002f0ff4f3
commit dfffcefff6
4 changed files with 19 additions and 1 deletions

View File

@ -6924,6 +6924,10 @@ to the guest sound device.
``id``
Integer id of the audio device. Must be greater than 0.
``timerPeriod``
Timer period in microseconds. Must be greater than 0. If omitted,
the lowest possible period is used.
All the backends support child element for configuring input and
output properties
@ -6931,7 +6935,7 @@ output properties
...
<devices>
<audio id='1' type='pulseaudio'>
<audio id='1' type='pulseaudio' timerPeriod='40'>
<input mixingEngine='yes' fixedSettings='yes' voices='1' bufferLength='100'>
<settings frequency='44100' channels='2' format='s16'/>
</input>

View File

@ -4774,6 +4774,11 @@
<attribute name="id">
<ref name="uint8"/>
</attribute>
<optional>
<attribute name="timerPeriod">
<ref name="uint32"/>
</attribute>
</optional>
<choice>
<group>
<attribute name="type">

View File

@ -13193,6 +13193,10 @@ virDomainAudioDefParseXML(virDomainXMLOption *xmlopt G_GNUC_UNUSED,
&def->id) < 0)
goto error;
if (virXMLPropUInt(node, "timerPeriod", 10, VIR_XML_PROP_NONZERO,
&def->timerPeriod) < 0)
goto error;
inputNode = virXPathNode("./input", ctxt);
outputNode = virXPathNode("./output", ctxt);
@ -25461,6 +25465,9 @@ virDomainAudioDefFormat(virBuffer *buf,
virBufferAsprintf(buf, "<audio id='%d' type='%s'", def->id, type);
if (def->timerPeriod)
virBufferAsprintf(buf, " timerPeriod='%u'", def->timerPeriod);
switch (def->type) {
case VIR_DOMAIN_AUDIO_TYPE_NONE:
break;

View File

@ -1559,6 +1559,8 @@ struct _virDomainAudioDef {
unsigned int id;
unsigned int timerPeriod;
virDomainAudioIOCommon input;
virDomainAudioIOCommon output;
union {