mbox series

[0/5] mostly changes related to audio float samples

Message ID 417bfe2f-e3c1-d83d-b437-47859daf524d@t-online.de (mailing list archive)
Headers show
Series mostly changes related to audio float samples | expand

Message

Volker Rümelin March 2, 2020, 7:08 p.m. UTC
Patch "audio: change naming scheme of FLOAT_CONV macros" and
patch "audio: consistency changes" should have been a review
for ed2a4a7941 "audio: proper support for float samples in
mixeng", but I was too slow.

Patch "audio: change mixing engine float range to [-1.f, 1.f]"
definitely needs to be tested by macOS users. I verified
PulseAudio, SDL2 and ALSA (actually libasound) work, but I
don't want to introduce a regression for CoreAudio. I spent
some time on https://developer.apple.com but I couldn't find
the answer if CoreAudio uses the [-1.f, 1.f] range too. The
results from my favorite search engine suggest the answer is
yes.

@Howard:
I need your help once again. Can you please test if you can
hear (or see) clipping with my patches? Don't forget to set all
volume controls in the guest and on the host to 100% or 0dB to
get a reliable result. Compared to qemu without these patches I
expect the playback volume is a bit louder, but there's still
no clipping.

Volker Rümelin (5):
  qapi/audio: add documentation for AudioFormat
  audio: change naming scheme of FLOAT_CONV macros
  audio: consistency changes
  audio: change mixing engine float range to [-1.f, 1.f]
  audio: fix saturation nonlinearity in clip_* functions

 audio/mixeng.c          | 26 +++++++++++++-------------
 audio/mixeng_template.h | 22 ++++++++++------------
 qapi/audio.json         | 14 ++++++++++++++
 3 files changed, 37 insertions(+), 25 deletions(-)

Comments

Howard Spoelstra March 2, 2020, 11:30 p.m. UTC | #1
On Mon, Mar 2, 2020 at 8:08 PM Volker Rümelin <vr_qemu@t-online.de> wrote:

> Patch "audio: change naming scheme of FLOAT_CONV macros" and
> patch "audio: consistency changes" should have been a review
> for ed2a4a7941 "audio: proper support for float samples in
> mixeng", but I was too slow.
>
> Patch "audio: change mixing engine float range to [-1.f, 1.f]"
> definitely needs to be tested by macOS users. I verified
> PulseAudio, SDL2 and ALSA (actually libasound) work, but I
> don't want to introduce a regression for CoreAudio. I spent
> some time on https://developer.apple.com but I couldn't find
> the answer if CoreAudio uses the [-1.f, 1.f] range too. The
> results from my favorite search engine suggest the answer is
> yes.
>
> @Howard:
> I need your help once again. Can you please test if you can
> hear (or see) clipping with my patches? Don't forget to set all
> volume controls in the guest and on the host to 100% or 0dB to
> get a reliable result. Compared to qemu without these patches I
> expect the playback volume is a bit louder, but there's still
> no clipping.
>
> Volker Rümelin (5):
>   qapi/audio: add documentation for AudioFormat
>   audio: change naming scheme of FLOAT_CONV macros
>   audio: consistency changes
>   audio: change mixing engine float range to [-1.f, 1.f]
>   audio: fix saturation nonlinearity in clip_* functions
>
>  audio/mixeng.c          | 26 +++++++++++++-------------
>  audio/mixeng_template.h | 22 ++++++++++------------
>  qapi/audio.json         | 14 ++++++++++++++
>  3 files changed, 37 insertions(+), 25 deletions(-)
>
> --
> 2.16.4
>
> Hi,

I applied these to Mark's screamer branch to create a new OSX build.
Testing was done by playing system sounds, and an MP3/Internet radio with
QuickTime/iTunes. With or without 6dB, the max volume is way out of my
comfort zone. I hear no real difference in quality compared to a build from
the current screamer branch. If any, it might sound a bit better. That
means there still is some minimal crackling (clipping?) in the high volume
parts of the audio I played with OSX guests, not Mac OS 9.x guests.

So as there is no regression,
tested by: howard spoelstra <hsp.cat7@gmail.com>
Volker Rümelin March 8, 2020, 7:11 p.m. UTC | #2
Hi Howard,

thank you for testing the patches.

> Hi,
>
> I applied these to Mark's screamer branch to create a new OSX build. Testing was done by playing system sounds, and an MP3/Internet radio with QuickTime/iTunes. With or without 6dB, the max volume is way out of my comfort zone. I hear no real difference in quality compared to a build from the

It wasn't my intention to annoy your neighbours. On my computer I use an analog output for playback. Clipping happens before DA conversion, so I can use the volume control on the amplifier to have normal volume levels.

> current screamer branch. If any, it might sound a bit better. That means there still is some minimal crackling (clipping?) in the high volume parts of the

Crackling and clipping are two different things. Crackling is normally a timing problem where audio samples aren't delivered in time. Clipping produces harmonic distortions. For example a clipped sine wave will sound metallic because of the harmonic distortions. The difference between a clipped and a pure sine wave is clearly audible.

> audio I played with OSX guests, not Mac OS 9.x guests.  
>
> So as there is no regression,
> tested by: howard spoelstra <hsp.cat7@gmail.com <mailto:hsp.cat7@gmail.com>>

With best regards,
Volker