[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/15] audio: audiodev= parameters no longer optional
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 06/15] audio: audiodev= parameters no longer optional when -audiodev present |
Date: |
Tue, 13 Aug 2019 13:18:00 +0200 |
From: Kővágó, Zoltán <address@hidden>
This means you should probably stop using -soundhw (as it doesn't allow
you to specify any options) and add the device manually with -device.
The exception is pcspk, it's currently not possible to manually add it.
To use it with audiodev, use something like this:
-audiodev id=foo,... -global isa-pcspk.audiodev=foo -soundhw pcspk
Signed-off-by: Kővágó, Zoltán <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
audio/audio.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index 4baa37caac93..d1319581949d 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -101,6 +101,8 @@ const struct mixeng_volume nominal_volume = {
#endif
};
+static bool legacy_config = true;
+
#ifdef AUDIO_IS_FLAWLESS_AND_NO_CHECKS_ARE_REQURIED
#error No its not
#else
@@ -1392,7 +1394,7 @@ static AudiodevListEntry *audiodev_find(
* if dev == NULL => legacy implicit initialization, return the already created
* state or create a new one
*/
-static AudioState *audio_init(Audiodev *dev)
+static AudioState *audio_init(Audiodev *dev, const char *name)
{
static bool atexit_registered;
size_t i;
@@ -1406,12 +1408,13 @@ static AudioState *audio_init(Audiodev *dev)
if (dev) {
/* -audiodev option */
+ legacy_config = false;
drvname = AudiodevDriver_str(dev->driver);
} else if (!QTAILQ_EMPTY(&audio_states)) {
- /*
- * todo: check for -audiodev once we have normal audiodev selection
- * support
- */
+ if (!legacy_config) {
+ dolog("You must specify an audiodev= for the device %s\n", name);
+ exit(1);
+ }
return QTAILQ_FIRST(&audio_states);
} else {
/* legacy implicit initialization */
@@ -1518,7 +1521,7 @@ void audio_free_audiodev_list(AudiodevListHead *head)
void AUD_register_card (const char *name, QEMUSoundCard *card)
{
if (!card->state) {
- card->state = audio_init(NULL);
+ card->state = audio_init(NULL, name);
}
card->name = g_strdup (name);
@@ -1544,8 +1547,11 @@ CaptureVoiceOut *AUD_add_capture(
struct capture_callback *cb;
if (!s) {
- /* todo: remove when we have normal audiodev selection support */
- s = audio_init(NULL);
+ if (!legacy_config) {
+ dolog("You must specify audiodev when trying to capture\n");
+ return NULL;
+ }
+ s = audio_init(NULL, NULL);
}
if (audio_validate_settings (as)) {
@@ -1776,7 +1782,7 @@ void audio_init_audiodevs(void)
AudiodevListEntry *e;
QSIMPLEQ_FOREACH(e, &audiodevs, next) {
- audio_init(e->dev);
+ audio_init(e->dev, NULL);
}
}
--
2.18.1
- [Qemu-devel] [PULL 03/15] audio: add audiodev property to vnc and wav_capture, (continued)
- [Qemu-devel] [PULL 03/15] audio: add audiodev property to vnc and wav_capture, Gerd Hoffmann, 2019/08/13
- [Qemu-devel] [PULL 04/15] audio: add audiodev properties to frontends, Gerd Hoffmann, 2019/08/13
- [Qemu-devel] [PULL 07/15] paaudio: do not move stream when sink/source name is specified, Gerd Hoffmann, 2019/08/13
- [Qemu-devel] [PULL 09/15] audio: remove audio_MIN, audio_MAX, Gerd Hoffmann, 2019/08/13
- [Qemu-devel] [PULL 14/15] audio: fix memory leak reported by ASAN, Gerd Hoffmann, 2019/08/13
- [Qemu-devel] [PULL 05/15] paaudio: prepare for multiple audiodev, Gerd Hoffmann, 2019/08/13
- [Qemu-devel] [PULL 11/15] paaudio: fix playback glitches, Gerd Hoffmann, 2019/08/13
- [Qemu-devel] [PULL 02/15] audio: basic support for multi backend audio, Gerd Hoffmann, 2019/08/13
- [Qemu-devel] [PULL 08/15] paaudio: properly disconnect streams in fini_*, Gerd Hoffmann, 2019/08/13
- [Qemu-devel] [PULL 13/15] audio: use size_t where makes sense, Gerd Hoffmann, 2019/08/13
- [Qemu-devel] [PULL 06/15] audio: audiodev= parameters no longer optional when -audiodev present,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 15/15] audio: Add missing fall through comments, Gerd Hoffmann, 2019/08/13
- [Qemu-devel] [PULL 12/15] audio: remove read and write pcm_ops, Gerd Hoffmann, 2019/08/13
- [Qemu-devel] [PULL 10/15] audio: do not run each backend in audio_run, Gerd Hoffmann, 2019/08/13
- [Qemu-devel] [PULL 01/15] audio: reduce glob_audio_state usage, Gerd Hoffmann, 2019/08/13
- Re: [Qemu-devel] [PULL 00/15] Audio 20190813 patches, Peter Maydell, 2019/08/13
- Re: [Qemu-devel] [PULL 00/15] Audio 20190813 patches, Peter Maydell, 2019/08/16