@@ -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);
}
@@ -94,8 +94,8 @@ Creating sound card devices using ``-soundhw`` (since 5.1)
Sound card devices should be created using ``-device`` instead. The
names are the same for most devices. The exceptions are ``hda`` which
needs two devices (``-device intel-hda --device hda-duplex``) and
-``pcspk`` which can be activated using ``-global
-pcspk.audiodev=<name>``.
+``pcspk`` which can be activated by creating an audiodev named
+``onboard``.
``-mon ...,control=readline,pretty=on|off`` (since 4.1)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
New naming convention: Use "onboard" audiodev for onboard audio devices, using "-audiodev pa,id=onboard" for example. This patchs implements it for pcspk, it will try to use "onboard" by default. Setting another name using "-global pcspk.audiodev=<name>" continues to work. If we want go this route we should do the same for other onboard audio devices too (arm boards, ...). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> --- hw/audio/pcspk.c | 3 +++ docs/system/deprecated.rst | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-)