[PATCH 00/12] audio: deprecate -soundhw

Gerd Hoffmann posted 12 patches 4 years ago
Test asan passed
Test checkpatch passed
Test docker-quick@centos7 passed
Test docker-mingw@fedora passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200429110214.29037-1-kraxel@redhat.com
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>
There is a newer version of this series
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
[PATCH 00/12] audio: deprecate -soundhw
Posted by Gerd Hoffmann 4 years ago

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

-- 
2.18.2


Re: [PATCH 00/12] audio: deprecate -soundhw
Posted by Daniel P. Berrangé 4 years ago
On Wed, Apr 29, 2020 at 01:02:02PM +0200, Gerd Hoffmann wrote:
>  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 ++

There should also be an addition to docs/system/deprecated.rst to point
users to the suggested replacement syntax.

Regards,
Daniel
-- 
|: 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 :|


Re: [PATCH 00/12] audio: deprecate -soundhw
Posted by Philippe Mathieu-Daudé 4 years ago
Hi Gerd,

On 4/29/20 1:02 PM, Gerd Hoffmann wrote:
> 
> 
> 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

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.

> 
>   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
> 


Re: [PATCH 00/12] audio: deprecate -soundhw
Posted by Gerd Hoffmann 4 years ago
On Wed, Apr 29, 2020 at 06:54:08PM +0200, Philippe Mathieu-Daudé wrote:
> Hi Gerd,
> 
> On 4/29/20 1:02 PM, Gerd Hoffmann wrote:
> > 
> > 
> > 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
> 
> 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.

> 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


Re: [PATCH 00/12] audio: deprecate -soundhw
Posted by Philippe Mathieu-Daudé 4 years ago
On 4/30/20 9:41 AM, Gerd Hoffmann wrote:
> On Wed, Apr 29, 2020 at 06:54:08PM +0200, Philippe Mathieu-Daudé wrote:
>> Hi Gerd,
>>
>> On 4/29/20 1:02 PM, Gerd Hoffmann wrote:
>>>
>>>
>>> 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
>>
>> 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.
> 
>> 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.

> 
> cheers,
>    Gerd
>