Skip to contentSkip to conversation

tests: set QEMU_AUDIO_DRV=none for pci sound cards

PATCH In review Gerd Hoffmann 4 participants 7 messages Jul 22, 2014 – Aug 27, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: set QEMU_AUDIO_DRV=none for pci sound cards

This way the tests run without sound hardware being present on the build machine. Even with sound hardware it IMO isn't very useful to use it in regression testing. Once the sound card tests are advanced enougth that they try to actually play sound we probably want the guests sound output written to a file (via QEMU_AUDIO_DRV=wav) rather than played on the build machines sound hardware.

---
 tests/ac97-test.c      | 3 +++
 tests/es1370-test.c    | 3 +++
 tests/intel-hda-test.c | 3 +++
 3 files changed, 9 insertions(+)
tests/ac97-test.c +3 -0
index af30ea1..ba3be1a 100644
@@ -8,6 +8,7 @@
  */
 
 #include <glib.h>
+#include <stdlib.h>
 #include <string.h>
 #include "libqtest.h"
 #include "qemu/osdep.h"
@@ -21,6 +22,8 @@ int main(int argc, char **argv)
 {
     int ret;
 
+    setenv("QEMU_AUDIO_DRV", "none", true);
+
     g_test_init(&argc, &argv, NULL);
     qtest_add_func("/ac97/nop", nop);
 
tests/es1370-test.c +3 -0
index cc23fb5..d539ba3 100644
@@ -8,6 +8,7 @@
  */
 
 #include <glib.h>
+#include <stdlib.h>
 #include <string.h>
 #include "libqtest.h"
 #include "qemu/osdep.h"
@@ -21,6 +22,8 @@ int main(int argc, char **argv)
 {
     int ret;
 
+    setenv("QEMU_AUDIO_DRV", "none", true);
+
     g_test_init(&argc, &argv, NULL);
     qtest_add_func("/es1370/nop", nop);
 
tests/intel-hda-test.c +3 -0
index d89b407..32dc58f 100644
@@ -8,6 +8,7 @@
  */
 
 #include <glib.h>
+#include <stdlib.h>
 #include <string.h>
 #include "libqtest.h"
 #include "qemu/osdep.h"
@@ -35,6 +36,8 @@ int main(int argc, char **argv)
 {
     int ret;
 
+    setenv("QEMU_AUDIO_DRV", "none", true);
+
     g_test_init(&argc, &argv, NULL);
     qtest_add_func("/intel-hda/ich6", ich6_test);
     qtest_add_func("/intel-hda/ich9", ich9_test);
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Gerd Hoffmann

This way the tests run without sound hardware being present on the build machine. Even with sound hardware it IMO isn't very useful to use it in regression testing. Once the sound card tests are advanced enougth that they try to actually play sound we probably want the guests sound output written to a file (via QEMU_AUDIO_DRV=wav) rather than played on the build machines sound hardware.

Bonus: I no longer get "audio: Could not init `oss' audio driver" noise.

#2 lore raw

Ping?

Quoted 15 lines · Markus Armbruster
Quoted 9 lines · Gerd Hoffmann

This way the tests run without sound hardware being present on the build machine. Even with sound hardware it IMO isn't very useful to use it in regression testing. Once the sound card tests are advanced enougth that they try to actually play sound we probably want the guests sound output written to a file (via QEMU_AUDIO_DRV=wav) rather than played on the build machines sound hardware.

Bonus: I no longer get "audio: Could not init `oss' audio driver" noise.

#3 lore raw
Quoted 1 line · Markus Armbruster

Ping?

Back online. What is the state here? I've seen Stefan (Cc'ed) posted a different patch for the same issue? Anything merged meanwhile?

cheers,
Gerd

Quoted 18 lines
Quoted 15 lines · Markus Armbruster
Quoted 9 lines · Gerd Hoffmann

This way the tests run without sound hardware being present on the build machine. Even with sound hardware it IMO isn't very useful to use it in regression testing. Once the sound card tests are advanced enougth that they try to actually play sound we probably want the guests sound output written to a file (via QEMU_AUDIO_DRV=wav) rather than played on the build machines sound hardware.

Bonus: I no longer get "audio: Could not init `oss' audio driver" noise.

#4 lore raw
Quoted 5 lines · Gerd Hoffmann
Quoted 1 line · Markus Armbruster

Ping?

Back online. What is the state here? I've seen Stefan (Cc'ed) posted a different patch for the same issue? Anything merged meanwhile?

Neither patch has been merged. Either would do for me :)

#5 lore raw
In reply to Gerd Hoffmann
Quoted 5 lines · Gerd Hoffmann
Quoted 1 line · Markus Armbruster

Ping?

Back online. What is the state here? I've seen Stefan (Cc'ed) posted a different patch for the same issue? Anything merged meanwhile?

I am sending a v2 of my series that will use setenv(3) like you did except for all tests (Markus preferred that approach).

Stefan

Reviewed-by on v1 1/1
#6 lore raw
In reply to Gerd Hoffmann
Quoted 9 lines · Gerd Hoffmann

This way the tests run without sound hardware being present on the build machine. Even with sound hardware it IMO isn't very useful to use it in regression testing. Once the sound card tests are advanced enougth that they try to actually play sound we probably want the guests sound output written to a file (via QEMU_AUDIO_DRV=wav) rather than played on the build machines sound hardware.

Useful already:

Long term, won't it be cleaner to supply driver using a command line flag? Can be a patch on top ...

Quoted 72 lines
---
 tests/ac97-test.c      | 3 +++
 tests/es1370-test.c    | 3 +++
 tests/intel-hda-test.c | 3 +++
 3 files changed, 9 insertions(+)
tests/ac97-test.c +3 -0
index af30ea1..ba3be1a 100644
@@ -8,6 +8,7 @@
  */
 
 #include <glib.h>
+#include <stdlib.h>
 #include <string.h>
 #include "libqtest.h"
 #include "qemu/osdep.h"
@@ -21,6 +22,8 @@ int main(int argc, char **argv)
 {
     int ret;
 
+    setenv("QEMU_AUDIO_DRV", "none", true);
+
     g_test_init(&argc, &argv, NULL);
     qtest_add_func("/ac97/nop", nop);
 
tests/es1370-test.c +3 -0
index cc23fb5..d539ba3 100644
@@ -8,6 +8,7 @@
  */
 
 #include <glib.h>
+#include <stdlib.h>
 #include <string.h>
 #include "libqtest.h"
 #include "qemu/osdep.h"
@@ -21,6 +22,8 @@ int main(int argc, char **argv)
 {
     int ret;
 
+    setenv("QEMU_AUDIO_DRV", "none", true);
+
     g_test_init(&argc, &argv, NULL);
     qtest_add_func("/es1370/nop", nop);
 
tests/intel-hda-test.c +3 -0
index d89b407..32dc58f 100644
@@ -8,6 +8,7 @@
  */
 
 #include <glib.h>
+#include <stdlib.h>
 #include <string.h>
 #include "libqtest.h"
 #include "qemu/osdep.h"
@@ -35,6 +36,8 @@ int main(int argc, char **argv)
 {
     int ret;
 
+    setenv("QEMU_AUDIO_DRV", "none", true);
+
     g_test_init(&argc, &argv, NULL);
     qtest_add_func("/intel-hda/ich6", ich6_test);
     qtest_add_func("/intel-hda/ich9", ich9_test);
Signature · 1 line
1.8.3.1