mbox series

[0/9] Audio fixes and improvements

Message ID 84f1c61a-8399-c75e-96c2-febfc2dd5fab@t-online.de
Headers show
Series Audio fixes and improvements | expand

Message

Volker Rümelin Sept. 20, 2020, 5:14 p.m. UTC
A few fixes and improvements from my audio patch queue.

It's currently still not possible to reach the function
audio_generic_read(). I tested the patch
 
audio: align audio_generic_read with audio_pcm_hw_run_in

with a modified audio/paaudio.c version. If someone wants
to reproduce the test, replace .read = qpa_read with
.read = audio_generic_read in the audio/paaudio.c pcm_ops
table and start qemu with
-audiodev pa,id=audio0,in.mixing-engine=off.

With best regards,
Volker

Volker Rümelin (9):
  audio: handle buf == NULL in put_buffer_out()
  audio/audio: fix video playback slowdown with spiceaudio
  audio/spiceaudio: always rate limit playback stream
  audio: align audio_generic_read with audio_pcm_hw_run_in
  audio: remove unnecessary calls to put_buffer_in
  audio: align audio_generic_write with audio_pcm_hw_run_out
  audio: run downstream playback queue unconditionally
  audio: restore mixing-engine playback buffer size
  audio: revert tests for pcm_ops table

 audio/alsaaudio.c   |   1 +
 audio/audio.c       | 136 +++++++++++++++++++++++++++++++++-----------
 audio/audio_int.h   |   7 ++-
 audio/coreaudio.c   |   3 +
 audio/dsoundaudio.c |   6 ++
 audio/jackaudio.c   |   1 +
 audio/noaudio.c     |   1 +
 audio/ossaudio.c    |  12 ++++
 audio/paaudio.c     |   6 ++
 audio/sdlaudio.c    |   3 +
 audio/spiceaudio.c  |  27 +++++----
 audio/wavaudio.c    |   1 +
 12 files changed, 161 insertions(+), 43 deletions(-)

Comments

Gerd Hoffmann Sept. 23, 2020, 6:36 a.m. UTC | #1
> diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
> index 21b7a0484b..cb931d0fda 100644
> --- a/audio/sdlaudio.c
> +++ b/audio/sdlaudio.c
> @@ -253,6 +253,7 @@ static void sdl_callback (void *opaque, Uint8 *buf, int len)
>          return ret;                                                     \
>      }
>  
> +SDL_WRAPPER_FUNC(buffer_get_free, size_t, (HWVoiceOut *hw), (hw))
>  SDL_WRAPPER_FUNC(get_buffer_out, void *, (HWVoiceOut *hw, size_t *size),
>                   (hw, size), *size = 0, sdl_unlock)
>  SDL_WRAPPER_FUNC(put_buffer_out, size_t,

Compiling C object libcommon.fa.p/audio_sdlaudio.c.o
../../audio/sdlaudio.c:256:65: error: macro "SDL_WRAPPER_FUNC" requires 6 arguments, but only 4 given
  256 | SDL_WRAPPER_FUNC(buffer_get_free, size_t, (HWVoiceOut *hw), (hw))
      |                                                                 ^
../../audio/sdlaudio.c:243: note: macro "SDL_WRAPPER_FUNC" defined here
  243 | #define SDL_WRAPPER_FUNC(name, ret_type, args_decl, args, fail, unlock) \
      | 
../../audio/sdlaudio.c:256:17: error: expected ‘;’ before ‘static’
  256 | SDL_WRAPPER_FUNC(buffer_get_free, size_t, (HWVoiceOut *hw), (hw))
      |                 ^
      |                 ;
../../audio/sdlaudio.c:355:24: error: ‘sdl_buffer_get_free’ undeclared here (not in a function)
  355 |     .buffer_get_free = sdl_buffer_get_free,
      |                        ^~~~~~~~~~~~~~~~~~~
make: *** [Makefile.ninja:1113: libcommon.fa.p/audio_sdlaudio.c.o] Error 1

(I think coreaudio has the same problem ...).

take care,
  Gerd
Gerd Hoffmann Sept. 23, 2020, 9:07 a.m. UTC | #2
On Sun, Sep 20, 2020 at 07:14:12PM +0200, Volker Rümelin wrote:
> A few fixes and improvements from my audio patch queue.

cherry-picked 1-7 into the audio queue.

thanks,
  Gerd
Volker Rümelin Sept. 24, 2020, 5:42 p.m. UTC | #3
>> diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
>> index 21b7a0484b..cb931d0fda 100644
>> --- a/audio/sdlaudio.c
>> +++ b/audio/sdlaudio.c
>> @@ -253,6 +253,7 @@ static void sdl_callback (void *opaque, Uint8 *buf, int len)
>>          return ret;                                                     \
>>      }
>>  
>> +SDL_WRAPPER_FUNC(buffer_get_free, size_t, (HWVoiceOut *hw), (hw))
>>  SDL_WRAPPER_FUNC(get_buffer_out, void *, (HWVoiceOut *hw, size_t *size),
>>                   (hw, size), *size = 0, sdl_unlock)
>>  SDL_WRAPPER_FUNC(put_buffer_out, size_t,
> Compiling C object libcommon.fa.p/audio_sdlaudio.c.o
> ../../audio/sdlaudio.c:256:65: error: macro "SDL_WRAPPER_FUNC" requires 6 arguments, but only 4 given
>   256 | SDL_WRAPPER_FUNC(buffer_get_free, size_t, (HWVoiceOut *hw), (hw))
>       |                                                                 ^
> ../../audio/sdlaudio.c:243: note: macro "SDL_WRAPPER_FUNC" defined here
>   243 | #define SDL_WRAPPER_FUNC(name, ret_type, args_decl, args, fail, unlock) \
>       | 
> ../../audio/sdlaudio.c:256:17: error: expected ‘;’ before ‘static’
>   256 | SDL_WRAPPER_FUNC(buffer_get_free, size_t, (HWVoiceOut *hw), (hw))
>       |                 ^
>       |                 ;
> ../../audio/sdlaudio.c:355:24: error: ‘sdl_buffer_get_free’ undeclared here (not in a function)
>   355 |     .buffer_get_free = sdl_buffer_get_free,
>       |                        ^~~~~~~~~~~~~~~~~~~
> make: *** [Makefile.ninja:1113: libcommon.fa.p/audio_sdlaudio.c.o] Error 1
>
> (I think coreaudio has the same problem ...).
>
> take care,
>   Gerd
>

Sorry. This was caused by a bad rebase and my tests were insufficient. I guess I'll send my sdlaudio patches next. This patch has to wait.

With best regards,
Volker