diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4ed82ed570..7834fc2130 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7602,6 +7602,10 @@ qemuBuildAudioCommandLineArg(virCommand *cmd, def->id, qemuAudioDriverTypeToString(def->type)); + if (def->timerPeriod) + virBufferAsprintf(&buf, ",timer-period=%u", + def->timerPeriod); + qemuBuildAudioCommonArg(&buf, "in", &def->input); qemuBuildAudioCommonArg(&buf, "out", &def->output); @@ -7791,6 +7795,10 @@ qemuBuildAudioCommandLineEnv(virCommand *cmd, virCommandAddEnvPair(cmd, "QEMU_AUDIO_DRV", qemuAudioDriverTypeToString(audio->type)); + if (audio->timerPeriod) + virCommandAddEnvFormat(cmd, "QEMU_AUDIO_TIMER_PERIOD=%u", + audio->timerPeriod); + qemuBuildAudioCommonEnv(cmd, "QEMU_AUDIO_ADC_", &audio->input); qemuBuildAudioCommonEnv(cmd, "QEMU_AUDIO_DAC_", &audio->output); diff --git a/tests/qemuxml2argvdata/audio-alsa-best.args b/tests/qemuxml2argvdata/audio-alsa-best.args index 6db6d3739f..89b0faed0d 100644 --- a/tests/qemuxml2argvdata/audio-alsa-best.args +++ b/tests/qemuxml2argvdata/audio-alsa-best.args @@ -7,6 +7,7 @@ XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ QEMU_AUDIO_DRV=alsa \ +QEMU_AUDIO_TIMER_PERIOD=50 \ QEMU_AUDIO_ADC_FIXED_SETTINGS=on \ QEMU_AUDIO_ADC_VOICES=1 \ QEMU_AUDIO_ADC_FIXED_FREQ=44100 \ diff --git a/tests/qemuxml2argvdata/audio-alsa-best.x86_64-latest.args b/tests/qemuxml2argvdata/audio-alsa-best.x86_64-latest.args index 9a4456e908..0fd84746db 100644 --- a/tests/qemuxml2argvdata/audio-alsa-best.x86_64-latest.args +++ b/tests/qemuxml2argvdata/audio-alsa-best.x86_64-latest.args @@ -30,6 +30,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"driver":"host_cdrom","filename":"/dev/cdrom","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \ --audiodev id=audio1,driver=alsa,in.mixing-engine=on,in.fixed-settings=on,in.voices=1,in.frequency=44100,in.channels=2,in.format=s16,out.mixing-engine=on,out.fixed-settings=on,out.voices=2,out.frequency=22050,out.channels=4,out.format=f32,in.dev=/dev/dsp0,out.dev=/dev/dsp1 \ +-audiodev id=audio1,driver=alsa,timer-period=50,in.mixing-engine=on,in.fixed-settings=on,in.voices=1,in.frequency=44100,in.channels=2,in.format=s16,out.mixing-engine=on,out.fixed-settings=on,out.voices=2,out.frequency=22050,out.channels=4,out.format=f32,in.dev=/dev/dsp0,out.dev=/dev/dsp1 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/audio-alsa-best.xml b/tests/qemuxml2argvdata/audio-alsa-best.xml index 1a6d5f4d9f..8fe7b2fe88 100644 --- a/tests/qemuxml2argvdata/audio-alsa-best.xml +++ b/tests/qemuxml2argvdata/audio-alsa-best.xml @@ -30,7 +30,7 @@ -