audio: deprecate -soundhw
cover audio: deprecate -soundhw
Gerd Hoffmann (12):
stubs: add isa_create_simple
stubs: add pci_create_simple
audio: add deprecated_register_soundhw
audio: deprecate -soundhw ac97
audio: deprecate -soundhw es1370
audio: deprecate -soundhw adlib
audio: deprecate -soundhw cs4231a
audio: deprecate -soundhw gus
audio: deprecate -soundhw sb16
audio: deprecate -soundhw hda
audio: deprecate -soundhw pcspk
[RFC] audio: try use onboard audiodev for pcspk
include/hw/audio/soundhw.h | 2 ++ hw/audio/ac97.c | 9 ++------- hw/audio/adlib.c | 8 +------- hw/audio/cs4231a.c | 8 +------- hw/audio/es1370.c | 9 ++------- hw/audio/gus.c | 8 +------- hw/audio/intel-hda.c | 3 +++ hw/audio/pcspk.c | 27 ++++++++++++++++++++++++--- hw/audio/sb16.c | 9 ++------- hw/audio/soundhw.c | 24 +++++++++++++++++++++++- qdev-monitor.c | 2 ++ stubs/isa-bus.c | 7 +++++++ stubs/pci-bus.c | 7 +++++++ stubs/Makefile.objs | 2 ++ 14 files changed, 79 insertions(+), 46 deletions(-) create mode 100644 stubs/isa-bus.c create mode 100644 stubs/pci-bus.c
Signature · 1 line
2.18.2
PATCH 1/12 stubs: add isa_create_simple
Needed for -soundhw cleanup.
--- stubs/isa-bus.c | 7 +++++++ stubs/Makefile.objs | 1 + 2 files changed, 8 insertions(+) create mode 100644 stubs/isa-bus.c
stubs/isa-bus.c new file +7 -0
@@ -0,0 +1,7 @@ +#include "qemu/osdep.h" +#include "hw/isa/isa.h" + +ISADevice *isa_create_simple (ISABus *bus,const char *name) +{ +return NULL ; +}
stubs/Makefile.objs +1 -0
@@ -13,6 +13,7 @@ stub-obj-y += get-vm-name.o stub-obj-y += iothread.o stub-obj-y += iothread-lock.o stub-obj-y += is-daemonized.o +stub-obj-y += isa-bus.o stub-obj-$(CONFIG_LINUX_AIO) += linux-aio.o stub-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o stub-obj-y += machine-init-done.o
Signature · 1 line
2.18.2
Re: [PATCH 01/12] stubs: add isa_create_simple
Quoted 15 lines · Gerd Hoffmann
Needed for -soundhw cleanup.
Signed-off-by Gerd Hoffmann <[email protected]>--- stubs/isa-bus.c | 7 +++++++ stubs/Makefile.objs | 1 + 2 files changed, 8 insertions(+)create mode 100644
stubs/isa-bus.cstubs/isa-bus.c new file +0
-0
stubs/isa-bus.c line 6
Quoted 6 lines
stubs/isa-bus.c new file +6
-0@@ -0,0 +1,7 @@ +#include "qemu/osdep.h" +#include "hw/isa/isa.h" + +ISADevice *isa_create_simple (ISABus *bus,const char *name) +{ +return NULL ;
We want:
g_assert_not_reached();
Otherwise:
Quoted 14 lines
stubs/isa-bus.c new file +1
-0+}stubs/Makefile.objs +1
-0@@ -13,6 +13,7 @@ stub-obj-y += get-vm-name.o stub-obj-y += iothread.o stub-obj-y += iothread-lock.o stub-obj-y += is-daemonized.o +stub-obj-y += isa-bus.o stub-obj-$(CONFIG_LINUX_AIO) += linux-aio.o stub-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o stub-obj-y += machine-init-done.o
PATCH 2/12 stubs: add pci_create_simple
In reply to Gerd HoffmannNeeded for -soundhw cleanup.
--- stubs/pci-bus.c | 7 +++++++ stubs/Makefile.objs | 1 + 2 files changed, 8 insertions(+) create mode 100644 stubs/pci-bus.c
stubs/pci-bus.c new file +7 -0
@@ -0,0 +1,7 @@ +#include "qemu/osdep.h" +#include "hw/pci/pci.h" + +PCIDevice *pci_create_simple (PCIBus *bus,int devfn,const char *name) +{ +return NULL ; +}
stubs/Makefile.objs +1 -0
@@ -40,6 +40,7 @@ stub-obj-y += target-get-monitor-def.o stub-obj-y += vmgenid.o stub-obj-y += xen-common.o stub-obj-y += xen-hvm.o +stub-obj-y += pci-bus.o stub-obj-y += pci-host-piix.o stub-obj-y += ram-block.o stub-obj-y += ramfb.o
Signature · 1 line
2.18.2
Re: [PATCH 02/12] stubs: add pci_create_simple
Quoted 15 lines · Gerd Hoffmann
Needed for -soundhw cleanup.
Signed-off-by Gerd Hoffmann <[email protected]>--- stubs/pci-bus.c | 7 +++++++ stubs/Makefile.objs | 1 + 2 files changed, 8 insertions(+)create mode 100644
stubs/pci-bus.cstubs/pci-bus.c new file +0
-0
stubs/pci-bus.c line 6
Quoted 6 lines
stubs/pci-bus.c new file +6
-0@@ -0,0 +1,7 @@ +#include "qemu/osdep.h" +#include "hw/pci/pci.h" + +PCIDevice *pci_create_simple (PCIBus *bus,int devfn,const char *name) +{ +return NULL ;
We want:
g_assert_not_reached();
Otherwise:
Quoted 14 lines
stubs/pci-bus.c new file +1
-0+}stubs/Makefile.objs +1
-0@@ -40,6 +40,7 @@ stub-obj-y += target-get-monitor-def.o stub-obj-y += vmgenid.o stub-obj-y += xen-common.o stub-obj-y += xen-hvm.o +stub-obj-y += pci-bus.o stub-obj-y += pci-host-piix.o stub-obj-y += ram-block.o stub-obj-y += ramfb.o
PATCH 3/12 audio: add deprecated_register_soundhw
In reply to Gerd HoffmannAdd helper function for -soundhw deprecation. It can replace the simple init functions which just call {isa,pci}_create_simple() with a hardcoded type. It also prints a deprecation message.
--- include/hw/audio/soundhw.h | 2 ++ hw/audio/soundhw.c | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-)
include/hw/audio/soundhw.h +2 -0
@@ -6,6 +6,8 @@ void isa_register_soundhw(const char *name, const char *descr,void pci_register_soundhw (const char *name,const char *descr,int (*init_pci)(PCIBus *bus)); +void deprecated_register_soundhw (const char *name,const char *descr, +int isa,const char *typename);void soundhw_init (void );void select_soundhw (const char *optarg);
hw/audio/soundhw.c +23 -1
@@ -22,6 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/option.h" #include "qemu/help_option.h" #include "qemu/error-report.h" #include "qom/object.h"
@@ -32,6 +33,7 @@struct soundhw {const char *name;const char *descr; +const char *typename;int enabled;int isa;union {
@@ -65,6 +67,17 @@ void pci_register_soundhw(const char *name, const char *descr, soundhw_count++; } +void deprecated_register_soundhw (const char *name,const char *descr, +int isa,const char *typename) +{ +assert (soundhw_count <ARRAY_SIZE (soundhw) -1 ); + soundhw[soundhw_count].name = name; + soundhw[soundhw_count].descr = descr; + soundhw[soundhw_count].isa = isa; + soundhw[soundhw_count].typename = typename; + soundhw_count++; +} +void select_soundhw (const char *optarg) {struct soundhw *c;
@@ -136,7 +149,16 @@ void soundhw_init(void)for (c = soundhw; c->name; ++c) {if (c->enabled) { -if (c->isa) { +if (c->typename) { +warn_report ("'-soundhw %s' is deprecated, " +"please use '-device %s' instead" , + c->name, c->typename); +if (c->isa) { +isa_create_simple (isa_bus, c->typename); + }else { +pci_create_simple (pci_bus,-1 , c->typename); + } + }else if (c->isa) {if (!isa_bus) {error_report ("ISA bus not available for %s" , c->name);exit (1 );
Signature · 1 line
2.18.2
PATCH 4/12 audio: deprecate -soundhw ac97
In reply to Gerd HoffmannSwitch to deprecated_register_soundhw(). Remove the now obsolete init function. Add an alias so both ac97 and AC97 are working with -device.
--- hw/audio/ac97.c | 9 ++------- qdev-monitor.c | 1 + 2 files changed, 3 insertions(+), 7 deletions(-)
hw/audio/ac97.c +2 -7
@@ -1395,12 +1395,6 @@ static void ac97_exit(PCIDevice *dev)AUD_remove_card (&s->card); } -static int ac97_init (PCIBus *bus) -{ -pci_create_simple (bus,-1 ,TYPE_AC97 ); -return 0 ; -} -static Property ac97_properties[] = {DEFINE_AUDIO_PROPERTIES (AC97LinkState, card),DEFINE_PROP_END_OF_LIST (),
@@ -1438,7 +1432,8 @@ static const TypeInfo ac97_info = {static void ac97_register_types (void ) {type_register_static (&ac97_info); -pci_register_soundhw ("ac97" ,"Intel 82801AA AC97 Audio" , ac97_init); +deprecated_register_soundhw ("ac97" ,"Intel 82801AA AC97 Audio" , +0 ,TYPE_AC97 ); }type_init (ac97_register_types)
qdev-monitor.c +1 -0
@@ -52,6 +52,7 @@ typedef struct QDevAlias/* Please keep this table sorted by typename. */ static const QDevAlias qdev_alias_table[] = { + {"AC97" ,"ac97" },/* -soundhw name */ {"e1000" ,"e1000-82540em" }, {"ich9-ahci" ,"ahci" }, {"lsi53c895a" ,"lsi" },
Signature · 1 line
2.18.2
PATCH 5/12 audio: deprecate -soundhw es1370
In reply to Gerd HoffmannSwitch to deprecated_register_soundhw(). Remove the now obsolete init function. Add an alias so both es1370 and ES1370 are working with -device.
--- hw/audio/es1370.c | 9 ++------- qdev-monitor.c | 1 + 2 files changed, 3 insertions(+), 7 deletions(-)
hw/audio/es1370.c +2 -7
@@ -881,12 +881,6 @@ static void es1370_exit(PCIDevice *dev)AUD_remove_card (&s->card); } -static int es1370_init (PCIBus *bus) -{ -pci_create_simple (bus,-1 ,TYPE_ES1370 ); -return 0 ; -} -static Property es1370_properties[] = {DEFINE_AUDIO_PROPERTIES (ES1370State, card),DEFINE_PROP_END_OF_LIST (),
@@ -925,7 +919,8 @@ static const TypeInfo es1370_info = {static void es1370_register_types (void ) {type_register_static (&es1370_info); -pci_register_soundhw ("es1370" ,"ENSONIQ AudioPCI ES1370" , es1370_init); +deprecated_register_soundhw ("es1370" ,"ENSONIQ AudioPCI ES1370" , +0 ,TYPE_ES1370 ); }type_init (es1370_register_types)
qdev-monitor.c +1 -0
@@ -54,6 +54,7 @@ typedef struct QDevAliasstatic const QDevAlias qdev_alias_table[] = { {"AC97" ,"ac97" },/* -soundhw name */ {"e1000" ,"e1000-82540em" }, + {"ES1370" ,"es1370" },/* -soundhw name */ {"ich9-ahci" ,"ahci" }, {"lsi53c895a" ,"lsi" }, {"virtio-9p-ccw" ,"virtio-9p" ,QEMU_ARCH_S390X },
Signature · 1 line
2.18.2
PATCH 6/12 audio: deprecate -soundhw adlib
In reply to Gerd HoffmannSwitch to deprecated_register_soundhw().
Remove the now obsolete init function.
--- hw/audio/adlib.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
hw/audio/adlib.c +1 -7
@@ -322,16 +322,10 @@ static const TypeInfo adlib_info = { .class_init = adlib_class_initfn, }; -static int Adlib_init (ISABus *bus) -{ -isa_create_simple (bus,TYPE_ADLIB ); -return 0 ; -} -static void adlib_register_types (void ) {type_register_static (&adlib_info); -isa_register_soundhw ("adlib" ,ADLIB_DESC , Adlib_init); +deprecated_register_soundhw ("adlib" ,ADLIB_DESC ,1 ,TYPE_ADLIB ); }type_init (adlib_register_types)
Signature · 1 line
2.18.2
PATCH 7/12 audio: deprecate -soundhw cs4231a
In reply to Gerd HoffmannSwitch to deprecated_register_soundhw().
Remove the now obsolete init function.
--- hw/audio/cs4231a.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
hw/audio/cs4231a.c +1 -7
@@ -683,12 +683,6 @@ static void cs4231a_realizefn (DeviceState *dev, Error **errp)AUD_register_card ("cs4231a" , &s->card); } -static int cs4231a_init (ISABus *bus) -{ -isa_create_simple (bus,TYPE_CS4231A ); -return 0 ; -} -static Property cs4231a_properties[] = {DEFINE_AUDIO_PROPERTIES (CSState, card),DEFINE_PROP_UINT32 ("iobase" , CSState, port,0x534 ),
@@ -720,7 +714,7 @@ static const TypeInfo cs4231a_info = {static void cs4231a_register_types (void ) {type_register_static (&cs4231a_info); -isa_register_soundhw ("cs4231a" ,"CS4231A" , cs4231a_init); +deprecated_register_soundhw ("cs4231a" ,"CS4231A" ,1 ,TYPE_CS4231A ); }type_init (cs4231a_register_types)
Signature · 1 line
2.18.2
PATCH 8/12 audio: deprecate -soundhw gus
In reply to Gerd HoffmannSwitch to deprecated_register_soundhw().
Remove the now obsolete init function.
--- hw/audio/gus.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
hw/audio/gus.c +1 -7
@@ -292,12 +292,6 @@ static void gus_realizefn (DeviceState *dev, Error **errp)AUD_set_active_out (s->voice,1 ); } -static int GUS_init (ISABus *bus) -{ -isa_create_simple (bus,TYPE_GUS ); -return 0 ; -} -static Property gus_properties[] = {DEFINE_AUDIO_PROPERTIES (GUSState, card),DEFINE_PROP_UINT32 ("freq" , GUSState, freq,44100 ),
@@ -328,7 +322,7 @@ static const TypeInfo gus_info = {static void gus_register_types (void ) {type_register_static (&gus_info); -isa_register_soundhw ("gus" ,"Gravis Ultrasound GF1" , GUS_init); +deprecated_register_soundhw ("gus" ,"Gravis Ultrasound GF1" ,1 ,TYPE_GUS ); }type_init (gus_register_types)
Signature · 1 line
2.18.2
Quoted 6 lines · Gerd Hoffmann
include/hw/audio/soundhw.h | 2 ++ hw/audio/ac97.c | 9 ++------- hw/audio/adlib.c | 8 +------- hw/audio/cs4231a.c | 8 +------- hw/audio/es1370.c | 9 ++------- hw/audio/gus.c | 8 +-------
Quoted 8 lines
hw/audio/intel-hda.c | 3 +++ hw/audio/pcspk.c | 27 ++++++++++++++++++++++++--- hw/audio/sb16.c | 9 ++------- hw/audio/soundhw.c | 24 +++++++++++++++++++++++- qdev-monitor.c | 2 ++ stubs/isa-bus.c | 7 +++++++ stubs/pci-bus.c | 7 +++++++ stubs/Makefile.objs | 2 ++
There should also be an addition to docs/system/deprecated.rst to point users to the suggested replacement syntax.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH 9/12 audio: deprecate -soundhw sb16
In reply to Gerd HoffmannSwitch to deprecated_register_soundhw().
Remove the now obsolete init function.
--- hw/audio/sb16.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
hw/audio/sb16.c +2 -7
@@ -1415,12 +1415,6 @@ static void sb16_realizefn (DeviceState *dev, Error **errp)AUD_register_card ("sb16" , &s->card); } -static int SB16_init (ISABus *bus) -{ -isa_create_simple (bus,TYPE_SB16 ); -return 0 ; -} -static Property sb16_properties[] = {DEFINE_AUDIO_PROPERTIES (SB16State, card),DEFINE_PROP_UINT32 ("version" , SB16State, ver,0x0405 ),/* 4.5 */
@@ -1453,7 +1447,8 @@ static const TypeInfo sb16_info = {static void sb16_register_types (void ) {type_register_static (&sb16_info); -isa_register_soundhw ("sb16" ,"Creative Sound Blaster 16" , SB16_init); +deprecated_register_soundhw ("sb16" ,"Creative Sound Blaster 16" , +1 ,TYPE_SB16 ); }type_init (sb16_register_types)
Signature · 1 line
2.18.2
PATCH 10/12 audio: deprecate -soundhw hda
In reply to Gerd HoffmannAdd deprecation message to the audio init function.
--- hw/audio/intel-hda.c | 3 +++ 1 file changed, 3 insertions(+)
hw/audio/intel-hda.c +3 -0
@@ -25,6 +25,7 @@#include "qemu/bitops.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qemu/error-report.h" #include "hw/audio/soundhw.h" #include "intel-hda.h" #include "migration/vmstate.h"
@@ -1307,6 +1308,8 @@ static int intel_hda_and_codec_init(PCIBus *bus)BusState *hdabus;DeviceState *codec; +warn_report ("'-soundhw hda' is deprecated, " +"please use '-device intel-hda -device hda-duplex' instead" ); controller =DEVICE (pci_create_simple (bus,-1 ,"intel-hda" )); hdabus =QLIST_FIRST (&controller->child_bus); codec =qdev_create (hdabus,"hda-duplex" );
Signature · 1 line
2.18.2
PATCH 11/12 audio: deprecate -soundhw pcspk
In reply to Gerd HoffmannAdd deprecation message to the audio init function.
Factor out audio initialization and call that from both audio init and realize, so setting audiodev via -global is enough to properly initialize pcspk.
--- hw/audio/pcspk.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-)
hw/audio/pcspk.c +21 -3
@@ -28,6 +28,7 @@#include "audio/audio.h" #include "qemu/module.h" #include "qemu/timer.h" +#include "qemu/error-report.h" #include "hw/timer/i8254.h" #include "migration/vmstate.h" #include "hw/audio/pcspk.h"
@@ -112,11 +113,15 @@ static void pcspk_callback(void *opaque, int free) } } -static int pcspk_audio_init (ISABus *bus) +static int pcspk_audio_init (PCSpkState *s) { -PCSpkState *s = pcspk_state;struct audsettings as = {PCSPK_SAMPLE_RATE ,1 ,AUDIO_FORMAT_U8 ,0 }; +if (s->voice) { +/* already initialized */ +return 0 ; + } +AUD_register_card (s_spk, &s->card); s->voice =AUD_open_out (&s->card, s->voice, s_spk, s, pcspk_callback, &as);
@@ -185,6 +190,10 @@ static void pcspk_realizefn(DeviceState *dev, Error **errp)isa_register_ioport (isadev, &s->ioport, s->iobase); +if (s->card.state) { +pcspk_audio_init (s); + } + pcspk_state = s; }
@@ -236,9 +245,18 @@ static const TypeInfo pcspk_info = { .class_init = pcspk_class_initfn, }; +static int pcspk_audio_init_soundhw (ISABus *bus) +{ +PCSpkState *s = pcspk_state; + +warn_report ("'-soundhw pcspk' is deprecated, " +"please set a backend using '-global isa-pcspk.audiodev=<name>' instead" ); +return pcspk_audio_init (s); +} +static void pcspk_register (void ) {type_register_static (&pcspk_info); -isa_register_soundhw ("pcspk" ,"PC speaker" , pcspk_audio_init); +isa_register_soundhw ("pcspk" ,"PC speaker" , pcspk_audio_init_soundhw); }type_init (pcspk_register)
Signature · 1 line
2.18.2
RFC PATCH 12/12 audio: try use onboard audiodev for pcspk
In reply to Gerd HoffmannNew naming convention: Use "onboard" audiodev for onboard audio devices.
This patchs implements it for pcspk. If we want go this route we should do the same for other onboard audio devices too (arm boards, ...).
--- hw/audio/pcspk.c | 3 +++ 1 file changed, 3 insertions(+)
hw/audio/pcspk.c +3 -0
@@ -190,6 +190,9 @@ static void pcspk_realizefn(DeviceState *dev, Error **errp)isa_register_ioport (isadev, &s->ioport, s->iobase); +if (!s->card.state) { + s->card.state =audio_state_by_name ("onboard" ); + }if (s->card.state) {pcspk_audio_init (s); }
Signature · 1 line
2.18.2
Hi Gerd,
Quoted 15 lines · Gerd Hoffmann
Gerd Hoffmann (12):
stubs: addisa_create_simple
stubs: addpci_create_simple
audio: adddeprecated_register_soundhw
audio: deprecate -soundhw ac97
audio: deprecate -soundhw es1370
audio: deprecate -soundhw adlib
audio: deprecate -soundhw cs4231a
audio: deprecate -soundhw gus
audio: deprecate -soundhw sb16
audio: deprecate -soundhw hda
audio: deprecate -soundhw pcspk
[RFC] audio: try use onboard audiodev for pcspk
I don't understand what you are trying to fix with this series.
I suppose there is a problem with the pcspk, as I had a problem when I tried to make the soundhw more QOM-friendly. pcspk needs rethink and some work so I didn't finished. Also I had a problem with intel-hda. I see in your series both are handled differently. I'll send the patch with the broken code marked XXX, maybe you can it figure out.
Quoted 19 lines
include/hw/audio/soundhw.h | 2 ++ hw/audio/ac97.c | 9 ++------- hw/audio/adlib.c | 8 +------- hw/audio/cs4231a.c | 8 +------- hw/audio/es1370.c | 9 ++------- hw/audio/gus.c | 8 +------- hw/audio/intel-hda.c | 3 +++ hw/audio/pcspk.c | 27 ++++++++++++++++++++++++--- hw/audio/sb16.c | 9 ++------- hw/audio/soundhw.c | 24 +++++++++++++++++++++++- qdev-monitor.c | 2 ++ stubs/isa-bus.c | 7 +++++++ stubs/pci-bus.c | 7 +++++++ stubs/Makefile.objs | 2 ++ 14 files changed, 79 insertions(+), 46 deletions(-)create mode 100644
stubs/isa-bus.c
create mode 100644stubs/pci-bus.c
Quoted 19 lines · Philippe Mathieu-Daudé
Hi Gerd,
Quoted 15 lines · Gerd Hoffmann
Gerd Hoffmann (12):
stubs: addisa_create_simple
stubs: addpci_create_simple
audio: adddeprecated_register_soundhw
audio: deprecate -soundhw ac97
audio: deprecate -soundhw es1370
audio: deprecate -soundhw adlib
audio: deprecate -soundhw cs4231a
audio: deprecate -soundhw gus
audio: deprecate -soundhw sb16
audio: deprecate -soundhw hda
audio: deprecate -soundhw pcspk
[RFC] audio: try use onboard audiodev for pcspk
Quoted 1 line
I don't understand what you are trying to fix with this series.
Almost nothing. I'm just deprecating -soundhw, and I don't feel like putting too much effort into code which I want remove anyway.
The new deprecated_register_soundhw() is there to allow removing the init callback for most hardware and have common code handle the simple cases. Alternatively I could leave things as-is and just copy&paste the deprecation warning into each init callback.
The only functional change (beside the added deprecation warnings) is that the pcspk realize function initializes audio in case audiodev is set, so "-global isa-pcspk.audiodev=<something>" is enough to activate the speaker. The need to also have "-soundhw pcspk" on the command line is gone.
Quoted 2 lines
I suppose there is a problem with the pcspk, as I had a problem when I tried to make the soundhw more QOM-friendly.
I see your patch adds a deprecation warning for -soundhw too. I'm wondering why you want convert this to QOM now just to throw away the code in a few months?
cheers,
Gerd
Quoted 36 lines · Gerd Hoffmann
Quoted 19 lines · Philippe Mathieu-Daudé
Hi Gerd,
Quoted 15 lines · Gerd Hoffmann
Gerd Hoffmann (12):
stubs: addisa_create_simple
stubs: addpci_create_simple
audio: adddeprecated_register_soundhw
audio: deprecate -soundhw ac97
audio: deprecate -soundhw es1370
audio: deprecate -soundhw adlib
audio: deprecate -soundhw cs4231a
audio: deprecate -soundhw gus
audio: deprecate -soundhw sb16
audio: deprecate -soundhw hda
audio: deprecate -soundhw pcspk
[RFC] audio: try use onboard audiodev for pcspkQuoted 1 line
I don't understand what you are trying to fix with this series.
Almost nothing. I'm just deprecating -soundhw, and I don't feel like putting too much effort into code which I want remove anyway.
The new
deprecated_register_soundhw()is there to allow removing the init callback for most hardware and have common code handle the simple cases. Alternatively I could leave things as-is and just copy&paste the deprecation warning into each init callback.The only functional change (beside the added deprecation warnings) is that the pcspk realize function initializes audio in case audiodev is set, so "-global isa-pcspk.audiodev=<something>" is enough to activate the speaker. The need to also have "-soundhw pcspk" on the command line is gone.
Quoted 6 lines
Quoted 2 lines
I suppose there is a problem with the pcspk, as I had a problem when I tried to make the soundhw more QOM-friendly.
I see your patch adds a deprecation warning for -soundhw too. I'm wondering why you want convert this to QOM now just to throw away the code in a few months?
Well I didn't know you planed to throw them away. I started looking at the hw/audio/ files for the Arduino GSoC project because we want the ADC to sample data from a stream of floats (then opposite with PWM). Using .wav file seemed to make things simpler, then I noticed the AUD API. Then I started to have a cleaner producer/consumer API (i.e. the 8042 PIT is a dsp stream producer, the pcspkr is a dsp stream consumer). To to that it was simpler to implement the producer/consumer interface split with the QOM API. The you know the NeverEnding Story... The -soundhw cleanup was part of it, as it was simple/contained I extracted it.
Quoted 4 lines
cheers,
Gerd