aboutsummaryrefslogtreecommitdiff
path: root/hw/audio
diff options
context:
space:
mode:
authorKővágó, Zoltán <dirty.ice.hu@gmail.com>2019-08-19 01:06:49 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-08-21 09:13:37 +0200
commit88e47b9a450f6dabc3429a4d2c421408b07d22bb (patch)
tree9e1d5d5cd779d6a2a4d4c1578b3dcb36116b4cdd /hw/audio
parentf0b9f36d71a373d469da9feb133c91546d37643c (diff)
audio: add audiodev properties to frontends
Finally add audiodev= options to audio frontends so users can specify which backend to use when multiple backends exist. Not specifying an audiodev= option currently causes the first audiodev to be used, this is fixed in the next commit. Example usage: -audiodev pa,id=foo -device AC97,audiodev=foo Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: d64db52dda2d0e9d97bc5ab1dd9adf724280fea1.1566168923.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/audio')
-rw-r--r--hw/audio/ac97.c1
-rw-r--r--hw/audio/adlib.c1
-rw-r--r--hw/audio/cs4231a.c1
-rw-r--r--hw/audio/es1370.c7
-rw-r--r--hw/audio/gus.c1
-rw-r--r--hw/audio/hda-codec.c1
-rw-r--r--hw/audio/milkymist-ac97.c6
-rw-r--r--hw/audio/pcspk.c1
-rw-r--r--hw/audio/pl041.c1
-rw-r--r--hw/audio/sb16.c1
-rw-r--r--hw/audio/wm8750.c6
11 files changed, 26 insertions, 1 deletions
diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
index 115ee51c7c..b4c0b690d7 100644
--- a/hw/audio/ac97.c
+++ b/hw/audio/ac97.c
@@ -1410,6 +1410,7 @@ static int ac97_init (PCIBus *bus)
}
static Property ac97_properties[] = {
+ DEFINE_AUDIO_PROPERTIES(AC97LinkState, card),
DEFINE_PROP_UINT32 ("use_broken_id", AC97LinkState, use_broken_id, 0),
DEFINE_PROP_END_OF_LIST (),
};
diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c
index 2f4aacbf43..64a1060b80 100644
--- a/hw/audio/adlib.c
+++ b/hw/audio/adlib.c
@@ -299,6 +299,7 @@ static void adlib_realizefn (DeviceState *dev, Error **errp)
}
static Property adlib_properties[] = {
+ DEFINE_AUDIO_PROPERTIES(AdlibState, card),
DEFINE_PROP_UINT32 ("iobase", AdlibState, port, 0x220),
DEFINE_PROP_UINT32 ("freq", AdlibState, freq, 44100),
DEFINE_PROP_END_OF_LIST (),
diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c
index d77a4e713e..5b7baeae25 100644
--- a/hw/audio/cs4231a.c
+++ b/hw/audio/cs4231a.c
@@ -690,6 +690,7 @@ static int cs4231a_init (ISABus *bus)
}
static Property cs4231a_properties[] = {
+ DEFINE_AUDIO_PROPERTIES(CSState, card),
DEFINE_PROP_UINT32 ("iobase", CSState, port, 0x534),
DEFINE_PROP_UINT32 ("irq", CSState, irq, 9),
DEFINE_PROP_UINT32 ("dma", CSState, dma, 3),
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index 39deecbbc6..88f886491b 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -887,6 +887,11 @@ static int es1370_init (PCIBus *bus)
return 0;
}
+static Property es1370_properties[] = {
+ DEFINE_AUDIO_PROPERTIES(ES1370State, card),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void es1370_class_init (ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS (klass);
@@ -903,6 +908,7 @@ static void es1370_class_init (ObjectClass *klass, void *data)
dc->desc = "ENSONIQ AudioPCI ES1370";
dc->vmsd = &vmstate_es1370;
dc->reset = es1370_on_reset;
+ dc->props = es1370_properties;
}
static const TypeInfo es1370_info = {
@@ -923,4 +929,3 @@ static void es1370_register_types (void)
}
type_init (es1370_register_types)
-
diff --git a/hw/audio/gus.c b/hw/audio/gus.c
index dbfe7cf634..effec31d35 100644
--- a/hw/audio/gus.c
+++ b/hw/audio/gus.c
@@ -299,6 +299,7 @@ static int GUS_init (ISABus *bus)
}
static Property gus_properties[] = {
+ DEFINE_AUDIO_PROPERTIES(GUSState, card),
DEFINE_PROP_UINT32 ("freq", GUSState, freq, 44100),
DEFINE_PROP_UINT32 ("iobase", GUSState, port, 0x240),
DEFINE_PROP_UINT32 ("irq", GUSState, emu.gusirq, 7),
diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
index 4fee0673d9..68fe1de987 100644
--- a/hw/audio/hda-codec.c
+++ b/hw/audio/hda-codec.c
@@ -841,6 +841,7 @@ static const VMStateDescription vmstate_hda_audio = {
};
static Property hda_audio_properties[] = {
+ DEFINE_AUDIO_PROPERTIES(HDAAudioState, card),
DEFINE_PROP_UINT32("debug", HDAAudioState, debug, 0),
DEFINE_PROP_BOOL("mixer", HDAAudioState, mixer, true),
DEFINE_PROP_BOOL("use-timer", HDAAudioState, use_timer, true),
diff --git a/hw/audio/milkymist-ac97.c b/hw/audio/milkymist-ac97.c
index 481dde10a1..853b4ed874 100644
--- a/hw/audio/milkymist-ac97.c
+++ b/hw/audio/milkymist-ac97.c
@@ -330,6 +330,11 @@ static const VMStateDescription vmstate_milkymist_ac97 = {
}
};
+static Property milkymist_ac97_properties[] = {
+ DEFINE_AUDIO_PROPERTIES(MilkymistAC97State, card),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void milkymist_ac97_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -337,6 +342,7 @@ static void milkymist_ac97_class_init(ObjectClass *klass, void *data)
dc->realize = milkymist_ac97_realize;
dc->reset = milkymist_ac97_reset;
dc->vmsd = &vmstate_milkymist_ac97;
+ dc->props = milkymist_ac97_properties;
}
static const TypeInfo milkymist_ac97_info = {
diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
index 016946d4b2..307c664725 100644
--- a/hw/audio/pcspk.c
+++ b/hw/audio/pcspk.c
@@ -209,6 +209,7 @@ static const VMStateDescription vmstate_spk = {
};
static Property pcspk_properties[] = {
+ DEFINE_AUDIO_PROPERTIES(PCSpkState, card),
DEFINE_PROP_UINT32("iobase", PCSpkState, iobase, -1),
DEFINE_PROP_BOOL("migrate", PCSpkState, migrate, true),
DEFINE_PROP_END_OF_LIST(),
diff --git a/hw/audio/pl041.c b/hw/audio/pl041.c
index ca91399078..c30417d46d 100644
--- a/hw/audio/pl041.c
+++ b/hw/audio/pl041.c
@@ -625,6 +625,7 @@ static const VMStateDescription vmstate_pl041 = {
};
static Property pl041_device_properties[] = {
+ DEFINE_AUDIO_PROPERTIES(PL041State, codec.card),
/* Non-compact FIFO depth property */
DEFINE_PROP_UINT32("nc_fifo_depth", PL041State, fifo_depth,
DEFAULT_FIFO_DEPTH),
diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c
index 3ad01f3599..7e50ab8a84 100644
--- a/hw/audio/sb16.c
+++ b/hw/audio/sb16.c
@@ -1422,6 +1422,7 @@ static int SB16_init (ISABus *bus)
}
static Property sb16_properties[] = {
+ DEFINE_AUDIO_PROPERTIES(SB16State, card),
DEFINE_PROP_UINT32 ("version", SB16State, ver, 0x0405), /* 4.5 */
DEFINE_PROP_UINT32 ("iobase", SB16State, port, 0x220),
DEFINE_PROP_UINT32 ("irq", SB16State, irq, 5),
diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c
index 9f6df5d59c..a8725abf6a 100644
--- a/hw/audio/wm8750.c
+++ b/hw/audio/wm8750.c
@@ -702,6 +702,11 @@ void wm8750_set_bclk_in(void *opaque, int new_hz)
wm8750_clk_update(s, 1);
}
+static Property wm8750_properties[] = {
+ DEFINE_AUDIO_PROPERTIES(WM8750State, card),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void wm8750_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -712,6 +717,7 @@ static void wm8750_class_init(ObjectClass *klass, void *data)
sc->recv = wm8750_rx;
sc->send = wm8750_tx;
dc->vmsd = &vmstate_wm8750;
+ dc->props = wm8750_properties;
}
static const TypeInfo wm8750_info = {