[Qemu-devel] [PATCH v2 00/24] Audio: Mixeng-free 5.1/7.1 audio support

Kővágó, Zoltán posted 24 patches 4 years, 6 months ago
Only 21 patches received!
There is a newer version of this series
audio/Makefile.objs     |   1 -
audio/alsaaudio.c       | 372 ++++++++------------------
audio/audio.c           | 522 ++++++++++++++++++++++++++++--------
audio/audio.h           |  10 +
audio/audio_int.h       |  81 ++++--
audio/audio_pt_int.c    | 173 ------------
audio/audio_pt_int.h    |  22 --
audio/audio_template.h  |  31 ++-
audio/coreaudio.c       | 143 +++++-----
audio/dsound_template.h |  53 ++--
audio/dsoundaudio.c     | 361 +++++++------------------
audio/noaudio.c         |  78 +++---
audio/ossaudio.c        | 360 ++++++++++---------------
audio/paaudio.c         | 566 +++++++++++++---------------------------
audio/sdlaudio.c        | 104 ++++----
audio/spiceaudio.c      | 252 ++++++------------
audio/wavaudio.c        |  78 ++----
configure               |   5 -
hw/usb/dev-audio.c      | 459 +++++++++++++++++++++++++++-----
qapi/audio.json         |  12 +-
qemu-options.hx         |  15 ++
21 files changed, 1689 insertions(+), 2009 deletions(-)
delete mode 100644 audio/audio_pt_int.c
delete mode 100644 audio/audio_pt_int.h
[Qemu-devel] [PATCH v2 00/24] Audio: Mixeng-free 5.1/7.1 audio support
Posted by Kővágó, Zoltán 4 years, 6 months ago
Hi,

This is the v2 of my patch series that makes mixeng optional and enables
more than two audio channels.

Changes from v1:

* renamed "mixeng" option to "mixing-engine"
* dropped patch "audio: remove hw->samples, buffer_size_in/out pcm_ops"


Regards,
Zoltan

Kővágó, Zoltán (24):
  audio: api for mixeng code free backends
  alsaaudio: port to the new audio backend api
  coreaudio: port to the new audio backend api
  dsoundaudio: port to the new audio backend api
  noaudio: port to the new audio backend api
  ossaudio: port to the new audio backend api
  paaudio: port to the new audio backend api
  sdlaudio: port to the new audio backend api
  spiceaudio: port to the new audio backend api
  wavaudio: port to the new audio backend api
  audio: remove remains of the old backend api
  audio: unify input and output mixeng buffer management
  audio: common rate control code for timer based outputs
  audio: split ctl_* functions into enable_* and volume_*
  audio: add mixeng option (documentation)
  audio: make mixeng optional
  paaudio: get/put_buffer functions
  audio: support more than two channels in volume setting
  audio: replace shift in audio_pcm_info with bytes_per_frame
  audio: basic support for multichannel audio
  paaudio: channel-map option
  usb-audio: do not count on avail bytes actually available
  usb-audio: support more than two channels of audio
  usbaudio: change playback counters to 64 bit

 audio/Makefile.objs     |   1 -
 audio/alsaaudio.c       | 372 ++++++++------------------
 audio/audio.c           | 522 ++++++++++++++++++++++++++++--------
 audio/audio.h           |  10 +
 audio/audio_int.h       |  81 ++++--
 audio/audio_pt_int.c    | 173 ------------
 audio/audio_pt_int.h    |  22 --
 audio/audio_template.h  |  31 ++-
 audio/coreaudio.c       | 143 +++++-----
 audio/dsound_template.h |  53 ++--
 audio/dsoundaudio.c     | 361 +++++++------------------
 audio/noaudio.c         |  78 +++---
 audio/ossaudio.c        | 360 ++++++++++---------------
 audio/paaudio.c         | 566 +++++++++++++---------------------------
 audio/sdlaudio.c        | 104 ++++----
 audio/spiceaudio.c      | 252 ++++++------------
 audio/wavaudio.c        |  78 ++----
 configure               |   5 -
 hw/usb/dev-audio.c      | 459 +++++++++++++++++++++++++++-----
 qapi/audio.json         |  12 +-
 qemu-options.hx         |  15 ++
 21 files changed, 1689 insertions(+), 2009 deletions(-)
 delete mode 100644 audio/audio_pt_int.c
 delete mode 100644 audio/audio_pt_int.h

-- 
2.23.0


Re: [Qemu-devel] [PATCH v2 00/24] Audio: Mixeng-free 5.1/7.1 audio support
Posted by Gerd Hoffmann 4 years, 6 months ago
On Sun, Sep 08, 2019 at 11:22:00PM +0200, Kővágó, Zoltán wrote:
> Hi,
> 
> This is the v2 of my patch series that makes mixeng optional and enables
> more than two audio channels.
> 
> Changes from v1:
> 
> * renamed "mixeng" option to "mixing-engine"
> * dropped patch "audio: remove hw->samples, buffer_size_in/out pcm_ops"

What is the testing status of this?

I've tried (quick playback smoke test):
  - pa -- works
  - alsa -- works.
  - oss -- not working on linux (also in master), probably lack of
    support in the linux kernel, should be testing with bsd.
  - spice -- broken (see below), master works fine.
  - sdl -- not working: "audio: Failed to create voice `adc'" (also in
    master).

What about windows+macos?

cheers,
  Gerd

spice:

qemu-system-x86_64: /home/kraxel/projects/qemu/audio/spiceaudio.c:143:
line_out_put_buffer: Assertion `buf == out->frame + out->fpos &&
out->fpos <= out->fsize' failed.

#0  0x00007f55ac24d377 in raise () at /lib64/libc.so.6
#1  0x00007f55ac24ea68 in abort () at /lib64/libc.so.6
#2  0x00007f55ac246196 in __assert_fail_base () at /lib64/libc.so.6
#3  0x00007f55ac246242 in  () at /lib64/libc.so.6
#4  0x0000557b648dfe30 in line_out_put_buffer (hw=0x557b66773a40,
buf=0x557b66709f5c, size=1764)
    at /home/kraxel/projects/qemu/audio/spiceaudio.c:143
#5  0x0000557b648d8bc6 in audio_pcm_hw_run_out (hw=0x557b66773a40,
live=441)
    at /home/kraxel/projects/qemu/audio/audio.c:1081
#6  0x0000557b648d8f16 in audio_run_out (s=0x557b65b68100)
    at /home/kraxel/projects/qemu/audio/audio.c:1166
#7  0x0000557b648d9804 in audio_run (s=0x557b65b68100,
msg=0x557b64e41f58 "timer")
    at /home/kraxel/projects/qemu/audio/audio.c:1349
#8  0x0000557b648d830b in audio_timer (opaque=0x557b65b68100)
    at /home/kraxel/projects/qemu/audio/audio.c:830
#9  0x0000557b64cdd1ec in timerlist_run_timers
(timer_list=0x557b65b23730)
    at /home/kraxel/projects/qemu/util/qemu-timer.c:592
#10 0x0000557b64cdd296 in qemu_clock_run_timers
(type=QEMU_CLOCK_VIRTUAL)
    at /home/kraxel/projects/qemu/util/qemu-timer.c:606
#11 0x0000557b64cdd556 in qemu_clock_run_all_timers ()
    at /home/kraxel/projects/qemu/util/qemu-timer.c:692
#12 0x0000557b64cddcf2 in main_loop_wait (nonblocking=0)
    at /home/kraxel/projects/qemu/util/main-loop.c:524
#13 0x0000557b648c9c9f in main_loop () at
/home/kraxel/projects/qemu/vl.c:1806
#14 0x0000557b648d135d in main (argc=18, argv=0x7ffda3815208,
envp=0x7ffda38152a0)
    at /home/kraxel/projects/qemu/vl.c:4488

(sleep 3; remote-viewer spice://localhost:12345) & qemu-default
-enable-kvm -name "qemu fedora audio testing" -M q35 -m 4G -cdrom
/vmdisk/iso/Fedora-Workstation-Live-x86_64-30-1.2.iso -device intel-hda
-device hda-micro,audiodev=snd0 -spice port=12345,disable-ticketing
-audiodev spice,id=snd0

Re: [Qemu-devel] [PATCH v2 00/24] Audio: Mixeng-free 5.1/7.1 audio support
Posted by Zoltán Kővágó 4 years, 6 months ago
On 2019-09-12 12:20, Gerd Hoffmann wrote:
> On Sun, Sep 08, 2019 at 11:22:00PM +0200, Kővágó, Zoltán wrote:
>> Hi,
>>
>> This is the v2 of my patch series that makes mixeng optional and enables
>> more than two audio channels.
>>
>> Changes from v1:
>>
>> * renamed "mixeng" option to "mixing-engine"
>> * dropped patch "audio: remove hw->samples, buffer_size_in/out pcm_ops"
> 
> What is the testing status of this?

I've ran some very simple audio playback tests, here are my results:
* alsa - works
* pa - works
* oss - works, but it looks like I have to specify both in.dev and 
out.dev if the default /dev/dsp does not exist, otherwise I just get a 
generic "Could not init `oss' audio driver".  We need a better error 
message here IMHO.
* sdl - works
* spice - yes, it's broken now, I'll fix it in the next update.  I've 
also found a second bug (SIGSEGV if the guest starts playing while no 
client is connected).

> What about windows+macos?

No idea, I don't have a windows or mac computer.  I could try it in a 
windows VM though, if I figure out how to compile qemu on windows.

Regards,
Zoltan

Re: [Qemu-devel] [PATCH v2 00/24] Audio: Mixeng-free 5.1/7.1 audio support
Posted by Gerd Hoffmann 4 years, 6 months ago
  Hi,

> * oss - works, but it looks like I have to specify both in.dev and out.dev
> if the default /dev/dsp does not exist, otherwise I just get a generic
> "Could not init `oss' audio driver".  We need a better error message here
> IMHO.

Yes, we basically have to add a Error* arg to the init callback so the
drivers can return error messages.  I've started looking into this a
while back, will try to resume the effort once we have this series
finally merged.

> * sdl - works
> * spice - yes, it's broken now, I'll fix it in the next update.  I've also
> found a second bug (SIGSEGV if the guest starts playing while no client is
> connected).
> 
> > What about windows+macos?
> 
> No idea, I don't have a windows or mac computer.  I could try it in a
> windows VM though, if I figure out how to compile qemu on windows.

debian and fedora have cross compilers for windows (mingw project)
which is supported by qemu and is probably easier than getting things
built on windows.

macos does at least build, but I have macos only in a vm without
sound support so I can't test whenever it actually works ...

Peter, any chance you can give this a try?

cheers,
  Gerd