[PATCH 12/17] audio: rename variables in audio_pcm_sw_read()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin The audio_pcm_sw_read() function uses a few very unspecific variable names. Rename them for better readability. ret => total_out total => total_in size => buf_len samples => frames_out_max Signed-off-by: Volker Rümelin --- audio/audio.c | 18 +-

[PATCH 17/17] audio: remove sw->ratio

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Simplify the resample buffer size calculation. For audio playback we have sw->ratio = ((int64_t)sw->hw->info.freq << 32) / sw->info.freq; samples = ((int64_t)sw->HWBUF.size << 32) / sw->ratio; This can be simplified to samples = muldiv64(sw-

[PATCH 13/17] audio/mixeng: calculate number of output frames

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Calculate the exact number of audio output frames the resampling code can generate from a given number of audio input frames. When upsampling, this function returns the maximum number of output frames. This function will later replace the audio_frontend_frames_in() function

[PATCH 06/17] audio: rename variables in audio_pcm_sw_write()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin The audio_pcm_sw_write() function uses a lot of very unspecific variable names. Rename them for better readability. ret => total_in total => total_out size => buf_len hwsamples => hw->mix_buf.size samples => frames_in_max Signed-off-by: Volker Rümelin

[PATCH 10/17] audio: wire up st_rate_frames_in()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Wire up the st_rate_frames_in() function and replace audio_frontend_frames_out() to make audio packet length calculation exact. When upsampling, it's still possible that the audio frontends can't write the last audio frame. This will be fixed later. Signed-off-by: Volker

[PATCH 08/17] audio: remove unused noop_conv() function

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin The function audio_capture_mix_and_clear() no longer uses audio_pcm_sw_write() to resample audio frames from one internal buffer to another. For this reason, the noop_conv() function is now unused. Remove it. Signed-off-by: Volker Rümelin --- audio/audio.c | 8 1

[PATCH 11/17] audio: replace the resampling loop in audio_pcm_sw_read()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Replace the resampling loop in audio_pcm_sw_read() with the new function audio_pcm_sw_resample_in(). Unlike the old resample loop the new function will try to consume input frames even if the output buffer is full. This is necessary when downsampling to avoid reading less

[PATCH 05/17] audio: remove sw == NULL check

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin All call sites of audio_pcm_sw_write() guarantee that sw is not NULL. Remove the unnecessary NULL check. Signed-off-by: Volker Rümelin --- audio/audio.c | 4 1 file changed, 4 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index b0a270ba85..9d6ffa500a

[PATCH 14/17] audio: wire up st_rate_frames_out()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Wire up the st_rate_frames_out() function and replace audio_frontend_frames_in() to make audio packet length calculation exact. Signed-off-by: Volker Rümelin --- audio/audio.c | 29 - 1 file changed, 8 insertions(+), 21 deletions(-) diff --git

[PATCH 16/17] audio/audio_template: substitute sw->hw with hw

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Substitute sw->hw with hw in the audio_pcm_sw_alloc_resources_* functions. Signed-off-by: Volker Rümelin --- audio/audio_template.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/audio/audio_template.h b/audio/audio_template.h index a9a550a

[PATCH 04/17] audio: replace the resampling loop in audio_pcm_sw_write()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Replace the resampling loop in audio_pcm_sw_write() with the new function audio_pcm_sw_resample_out(). Unlike the old resample loop the new function will try to consume input frames even if the output buffer is full. This is necessary when downsampling to avoid reading less

[PATCH 07/17] audio: don't misuse audio_pcm_sw_write()

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin The audio_pcm_sw_write() function is intended to convert a PCM audio stream to the internal representation, adjust the volume, and then mix it with the other audio streams with a possibly changed sample rate in mix_buf. In order for the audio_capture_mix_and_clear() function

[PATCH 01/17] audio: change type of mix_buf and conv_buf

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Change the type of mix_buf in struct HWVoiceOut and conv_buf in struct HWVoiceIn from STSampleBuffer * to STSampleBuffer. However, a buffer pointer is still needed. For this reason in struct STSampleBuffer samples[] is changed to *buffer. This is a preparation for the next

[PATCH 03/17] audio: make the resampling code greedy

2023-01-15 Thread Volker Rümelin
From: Volker Rümelin Read the maximum possible number of audio frames instead of the minimum necessary number of frames when the audio stream is downsampled and the output buffer is limited. This makes the function symmetrical to upsampling when the input buffer is limited. The maximum possible

[PATCH 00/17] audio: improve callback interface for audio frontends

2023-01-15 Thread Volker Rümelin
en) { +    fprintf(stderr, "%s: could not write %u bytes\n", __func__, +    chunk - written); break; } } hda_timer_sync_adjust(st, (wpos - rpos) - (B_SIZE >> 1)); +    if (avail != total_written) { +    fprintf(stderr, "%s: to write %d,

Re: [PATCH] .gitlab-ci.d/windows: Work-around timeout and OpenGL problems of the MSYS2 jobs

2023-01-06 Thread Volker Rümelin
Am 04.01.23 um 13:35 schrieb Thomas Huth: The windows jobs (especially the 32-bit job) recently started to hit the timeout limit. Bump it a little bit to ease the situation (80 minutes is quite long already - OTOH, these jobs do not have to wait for a job from the container stage to finish, so

Re: [PATCH 10/11] alsaaudio: change default playback settings

2022-12-30 Thread Volker Rümelin
Am 28.12.22 um 14:52 schrieb Christian Schoenebeck: On Monday, December 26, 2022 4:08:37 PM CET Volker Rümelin wrote: Am 21.12.22 um 12:03 schrieb Christian Schoenebeck: On Sunday, December 18, 2022 6:15:38 PM CET Volker Rümelin wrote: The currently used default playback settings in the ALSA

Re: [PATCH 10/11] alsaaudio: change default playback settings

2022-12-29 Thread Volker Rümelin
Am 28.12.22 um 14:52 schrieb Christian Schoenebeck: On Monday, December 26, 2022 4:08:37 PM CET Volker Rümelin wrote: Am 21.12.22 um 12:03 schrieb Christian Schoenebeck: On Sunday, December 18, 2022 6:15:38 PM CET Volker Rümelin wrote: The currently used default playback settings in the ALSA

Re: [PATCH] hw/audio/c97: fix abort in audio_calloc()

2022-12-26 Thread Volker Rümelin
://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg03987.html I would support a patch to limit the VRA and VRM modes to the highest supported rate of 48kHz. This is a technical limit for single data rate. Before Volker Rümelin fixed it in 12f4abf6a245 and 0cbc8bd4694f, an adversary could leverage

Re: [PATCH 10/11] alsaaudio: change default playback settings

2022-12-26 Thread Volker Rümelin
diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 5f50dfa0bf..0cc982e61f 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -913,17 +913,14 @@ static void *alsa_audio_init(Audiodev *dev)   alsa_init_per_direction(aopts->in);   alsa_init_per_direction(aopts->out);   -   

Re: [PATCH 10/11] alsaaudio: change default playback settings

2022-12-26 Thread Volker Rümelin
Am 21.12.22 um 12:03 schrieb Christian Schoenebeck: On Sunday, December 18, 2022 6:15:38 PM CET Volker Rümelin wrote: The currently used default playback settings in the ALSA audio backend are a bit unfortunate. With a few emulated audio devices, audio playback does not work properly. Here

Re: [PATCH 01/11] audio: log unimplemented audio device sample rates

2022-12-18 Thread Volker Rümelin
Am 18.12.22 um 21:26 schrieb Christian Schoenebeck: On Sunday, December 18, 2022 6:15:29 PM CET Volker Rümelin wrote: Some emulated audio devices allow guests to select very low sample rates that the audio subsystem doesn't support. The lowest supported sample rate depends on the audio backend

Re: [PATCH 07/11] audio/audio_template: use g_malloc0() to replace audio_calloc()

2022-12-18 Thread Volker Rümelin
Am 18.12.22 um 18:26 schrieb Philippe Mathieu-Daudé: On 18/12/22 18:15, Volker Rümelin wrote: Use g_malloc0() as a direct replacement for audio_calloc(). Signed-off-by: Volker Rümelin ---   audio/audio_template.h | 2 +-   1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio

[PATCH 08/11] audio/audio_template: use g_new0() to replace audio_calloc()

2022-12-18 Thread Volker Rümelin
Replace audio_calloc() with the equivalent g_new0(). With a n_structs argument >= 1, g_new0() never returns NULL. Also remove the unnecessary NULL checks. Signed-off-by: Volker Rümelin --- audio/audio_template.h | 23 ++- 1 file changed, 6 insertions(+), 17 deleti

[PATCH 10/11] alsaaudio: change default playback settings

2022-12-18 Thread Volker Rümelin
since last alsa run (running): 0.006084 Signed-off-by: Volker Rümelin --- audio/alsaaudio.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 5f50dfa0bf..0cc982e61f 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c

[PATCH 02/11] audio: don't show unnecessary error messages

2022-12-18 Thread Volker Rümelin
Let the audio_pcm_create_voice_pair_* functions handle error reporting. This avoids an additional error message in case the guest selected an unimplemented sample rate. Signed-off-by: Volker Rümelin --- audio/audio_template.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 03/11] audio: rename hardware store to backend

2022-12-18 Thread Volker Rümelin
Use a consistent friendly name for the HWVoiceOut and HWVoiceIn structures. Signed-off-by: Volker Rümelin --- audio/audio_template.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/audio_template.h b/audio/audio_template.h index ee320a2e3f..ac744d3484 100644

[PATCH 09/11] audio: remove audio_calloc() function

2022-12-18 Thread Volker Rümelin
Now that the last call site of audio_calloc() was removed, remove the unused audio_calloc() function. Signed-off-by: Volker Rümelin --- audio/audio.c | 20 audio/audio_int.h | 1 - 2 files changed, 21 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index

[PATCH 11/11] alsaaudio: reintroduce default recording settings

2022-12-18 Thread Volker Rümelin
recording settings and use the same default settings for recording as for playback. The term "reintroduce" is correct because commit a93f328177 ("alsaaudio: port to -audiodev config") removed the default settings for recording. Signed-off-by: Volker Rümelin --- au

[PATCH 06/11] audio/alsaaudio: use g_new0() instead of audio_calloc()

2022-12-18 Thread Volker Rümelin
Replace audio_calloc() with the equivalent g_new0(). The value of the g_new0() argument count is >= 1, which means g_new0() will never return NULL. Also remove the unnecessary NULL check. Signed-off-by: Volker Rümelin --- audio/alsaaudio.c | 6 +- 1 file changed, 1 insertion(+)

[PATCH 04/11] audio: remove unused #define AUDIO_STRINGIFY

2022-12-18 Thread Volker Rümelin
Remove the unused #define AUDIO_STRINGIFY. It was last used before commit 470bcabd8f ("audio: Replace AUDIO_FUNC with __func__"). Signed-off-by: Volker Rümelin --- audio/audio_int.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index

[PATCH 05/11] audio/mixeng: use g_new0() instead of audio_calloc()

2022-12-18 Thread Volker Rümelin
Replace audio_calloc() with the equivalent g_new0(). With a n_structs argument of 1, g_new0() never returns NULL. Also remove the unnecessary NULL checks. Signed-off-by: Volker Rümelin --- audio/audio.c | 5 - audio/audio_template.h | 6 +- audio/mixeng.c | 7

[PATCH 07/11] audio/audio_template: use g_malloc0() to replace audio_calloc()

2022-12-18 Thread Volker Rümelin
Use g_malloc0() as a direct replacement for audio_calloc(). Signed-off-by: Volker Rümelin --- audio/audio_template.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/audio_template.h b/audio/audio_template.h index d343a1dcb3..5f51ef26b2 100644 --- a/audio

[PATCH 01/11] audio: log unimplemented audio device sample rates

2022-12-18 Thread Volker Rümelin
and AUD_write functions return early in this case. This is necessary because, for example, the Sound Blaster 16 emulation calls AUD_write from the DMA callback function. Signed-off-by: Volker Rümelin --- audio/audio.c | 1 + audio/audio_template.h | 13 + 2 files changed, 14

[PATCH 00/11] audio: more improvements

2022-12-18 Thread Volker Rümelin
- 11: Audio playback and recording with the ALSA audio backend currently doesn't work well with the default audio settings. Volker Rümelin (11):   audio: log unimplemented audio device sample rates   audio: don't show unnecessary error messages   audio: rename hardware store to backend   audio

Re: [PULL v4 46/83] acpi: pc/q35: drop ad-hoc PCI-ISA bridge AML routines and let bus ennumeration generate AML

2022-11-19 Thread Volker Rümelin
Am 18.11.22 um 15:55 schrieb Igor Mammedov: On Fri, 18 Nov 2022 14:08:36 +0100 Igor Mammedov wrote: On Thu, 17 Nov 2022 22:51:46 +0100 Volker Rümelin wrote: [...] since this patch SeaBIOS no longer detects the PS/2 keyboard. This means there's no keyboard in SeaBIOS, GRUB or FreeDOS. OVMF

Re: [PULL v4 46/83] acpi: pc/q35: drop ad-hoc PCI-ISA bridge AML routines and let bus ennumeration generate AML

2022-11-17 Thread Volker Rümelin
From: Igor Mammedov PCI-ISA bridges that are built in PIIX/Q35 are building its own AML using AcpiDevAmlIf interface. Now build_append_pci_bus_devices() gained AcpiDevAmlIf interface support to get AML of devices atached to PCI slots. So drop ad-hoc

Re: [PATCH] tests/qtest/ac97-test: add up-/downsampling tests

2022-11-06 Thread Volker Rümelin
Am 04.11.22 um 18:33 schrieb Thomas Huth: On 26/10/2022 21.34, Volker Rümelin wrote: Am 25.10.22 um 09:44 schrieb Marc-André Lureau: Hi On Tue, Oct 25, 2022 at 12:31 AM Volker Rümelin wrote: Am 24.10.22 um 10:13 schrieb Marc-André Lureau: Hi On Mon, Oct 24, 2022 at 9:28 AM Volker Rümelin

Re: [PATCH] tests/qtest/ac97-test: add up-/downsampling tests

2022-10-26 Thread Volker Rümelin
Am 25.10.22 um 09:44 schrieb Marc-André Lureau: Hi On Tue, Oct 25, 2022 at 12:31 AM Volker Rümelin wrote: Am 24.10.22 um 10:13 schrieb Marc-André Lureau: Hi On Mon, Oct 24, 2022 at 9:28 AM Volker Rümelin wrote: Test if the audio subsystem can handle extreme up- and down- sampling

Re: [PATCH] tests/qtest/ac97-test: add up-/downsampling tests

2022-10-24 Thread Volker Rümelin
Am 24.10.22 um 10:13 schrieb Marc-André Lureau: Hi On Mon, Oct 24, 2022 at 9:28 AM Volker Rümelin wrote: Test if the audio subsystem can handle extreme up- and down- sampling ratios like 44100/1 and 1/44100. For some time these used to trigger QEMU aborts. The test was taken

Re: [PATCH v3 2/4] hw/audio: fix tab indentation

2022-10-24 Thread Volker Rümelin
Am 21.10.22 um 18:59 schrieb Amarjargal Gundjalam: The TABs should be replaced with spaces, to make sure that we have a consistent coding style with an indentation of 4 spaces everywhere. Resolves:https://gitlab.com/qemu-project/qemu/-/issues/370 Reviewed-by: Daniel P. Berrangé Signed-off-by:

[PATCH] tests/qtest/ac97-test: add up-/downsampling tests

2022-10-23 Thread Volker Rümelin
-by: Marc-André Lureau Signed-off-by: Volker Rümelin --- tests/qtest/ac97-test.c | 40 +++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/tests/qtest/ac97-test.c b/tests/qtest/ac97-test.c index 74103efdfa..ce25f1d588 100644 --- a/tests/qtest/ac97

[PATCH] ui: remove useless typecasts

2022-10-23 Thread Volker Rümelin
qemu-triv...@nongnu.org Signed-off-by: Volker Rümelin --- ui/console.c | 2 +- ui/gtk.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/console.c b/ui/console.c index 49da6a91df..65c117874c 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1297,7 +1297,7 @@ static void kbd_

Re: [PATCH 11/12] audio: fix sw->buf size for audio recording

2022-10-01 Thread Volker Rümelin
Am 27.09.22 um 13:54 schrieb Marc-André Lureau: On Fri, Sep 23, 2022 at 10:48 PM Volker Rümelin wrote: The calculation of the buffer size needed to store audio samples after resampling is wrong for audio recording. For audio recording sw->ratio is calculated as sw->

[PATCH 06/12] spiceaudio: add a pcm_ops buffer_get_free function

2022-09-23 Thread Volker Rümelin
It seems there is a demand [1] for low latency playback over SPICE. Add a pcm_ops buffer_get_free function to reduce the playback latency. The mixing engine buffer becomes a temporary buffer. [1] https://lists.nongnu.org/archive/html/qemu-devel/2022-01/msg01644.html Signed-off-by: Volker Rümelin

[PATCH 12/12] audio: prevent an integer overflow in resampling code

2022-09-23 Thread Volker Rümelin
mment that an ipos overflow will result in an infinite loop has been removed, because in this case the resampling code only generates no more output samples and the audio stream stalls. However, there is no infinite loop. Signed-off-by: Volker Rümelin --- audio/rate_template.h | 11 ++-

[PATCH 08/12] audio: swap audio_rate_get_bytes() function parameters

2022-09-23 Thread Volker Rümelin
Swap the rate and info parameters of the audio_rate_get_bytes() function to align the parameter order with the rest of the audio_rate_*() functions. Signed-off-by: Volker Rümelin --- audio/audio.c | 2 +- audio/audio_int.h | 2 +- audio/dbusaudio.c | 4 ++-- audio/noaudio.c| 4

[PATCH 07/12] spiceaudio: update comment

2022-09-23 Thread Volker Rümelin
Replace a comment with a question with the answer. Signed-off-by: Volker Rümelin --- audio/spiceaudio.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c index 22892a7b9d..f52f3a8bbb 100644 --- a/audio/spiceaudio.c +++ b/audio

[PATCH 04/12] alsaaudio: reduce playback latency

2022-09-23 Thread Volker Rümelin
Change the buffer_get_free pcm_ops function to report the free ALSA playback buffer. The generic buffer becomes a temporary buffer and is empty after a call to audio_run_out(). Signed-off-by: Volker Rümelin --- audio/alsaaudio.c | 38 +- 1 file changed, 37

[PATCH 10/12] audio: refactor audio_get_avail()

2022-09-23 Thread Volker Rümelin
Split out the code in audio_get_avail() that calculates the buffer size that the audio frontend can read. This is similar to the code changes in audio_get_free(). Signed-off-by: Volker Rümelin --- audio/audio.c | 24 +++- 1 file changed, 19 insertions(+), 5 deletions

[PATCH 11/12] audio: fix sw->buf size for audio recording

2022-09-23 Thread Volker Rümelin
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/71 Signed-off-by: Volker Rümelin --- audio/audio.c | 2 +- audio/audio_template.h | 4 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/audio/audio.c b/audio/audio.c index ba0c62b120..60c7472d37 100644 --- a/audio/audi

[PATCH 03/12] audio: run downstream playback queue unconditionally

2022-09-23 Thread Volker Rümelin
ot;) fixed the out.mixing-engine=on case. Signed-off-by: Volker Rümelin --- audio/audio.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 343786243d..9e55834909 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1143,6 +1143,10 @@ static void aud

[PATCH 01/12] audio: refactor code in audio_run_out()

2022-09-23 Thread Volker Rümelin
Refactoring the code in audio_run_out() avoids code duplication in the next patch. There's no functional change. Signed-off-by: Volker Rümelin --- audio/audio.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index cfa4119c05

[PATCH 05/12] audio: add more audio rate control functions

2022-09-23 Thread Volker Rümelin
(). Signed-off-by: Volker Rümelin --- audio/audio.c | 35 --- audio/audio_int.h | 2 ++ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 9e55834909..557538a7b7 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -2250,26

[PATCH 02/12] audio: fix GUS audio playback with out.mixing-engine=off

2022-09-23 Thread Volker Rümelin
guest. The demo file is available on the download page of the GUSemu32 author. Signed-off-by: Volker Rümelin --- audio/audio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/audio/audio.c b/audio/audio.c index 04f685fe24..343786243d 100644 --- a/audio/audio.c +++ b/audio

[PATCH 00/12] audio: misc. improvements and bug fixes

2022-09-23 Thread Volker Rümelin
-devel/2022-09/msg02347.html, issue #71 triggers a QEMU abort. Patch 11/12 is nevertheless correct. Volker Rümelin (12):   audio: refactor code in audio_run_out()   audio: fix GUS audio playback with out.mixing-engine=off   audio: run downstream playback queue unconditionally   alsaaudio: reduce p

[PATCH 09/12] audio: rename audio_sw_bytes_free()

2022-09-23 Thread Volker Rümelin
Rename and refactor audio_sw_bytes_free(). This function is not limited to calculate the free audio buffer size. The renamed function returns the number of frames instead of bytes. Signed-off-by: Volker Rümelin --- audio/audio.c | 20 ++-- 1 file changed, 14 insertions(+), 6

[PATCH v2] ui/console: fix three double frees in png_save()

2022-09-19 Thread Volker Rümelin
double free. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1210 Fixes: 9a0a119a38 ("Added parameter to take screenshot with screendump as PNG") Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Volker Rümelin --- v2: There's no need to inititaliz

[PATCH] ui/console: fix three double frees in png_save()

2022-09-18 Thread Volker Rümelin
double free. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1210 Signed-off-by: Volker Rümelin --- ui/console.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/console.c b/ui/console.c index 765892f84f..030e75bc71 100644 --- a/ui/console.c +++ b/ui/console.c

[PATCH 2/2] audio: remove abort() in audio_bug()

2022-09-17 Thread Volker Rümelin
g #1910603 at https://bugs.launchpad.net/bugs/1910603. Fixes: ab32b78cd1 "audio: Simplify audio_bug() removing old code" Buglink: https://bugs.launchpad.net/bugs/1910603 Signed-off-by: Volker Rümelin --- audio/audio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/audio/audio.c b

[PATCH 1/2] Revert "audio: Log context for audio bug"

2022-09-17 Thread Volker Rümelin
This reverts commit 8e30d39bade3010387177ca23dbc2244352ed4a3. Revert commit 8e30d39bad "audio: Log context for audio bug" to make error propagation work again. Signed-off-by: Volker Rümelin --- audio/audio.c | 25 + audio/audio_templ

[PATCH 0/2] audio: prevent a class of guest-triggered aborts

2022-09-17 Thread Volker Rümelin
en=0) Aborted (core dumped) Remove the abort() in audio_bug() to avoid this class of guest-triggered aborts. Volker Rümelin (2):   Revert "audio: Log context for audio bug"   audio: remove abort() in audio_bug()  audio/audio.c  | 24  audio/audio_template.

Re: [PATCH v2 3/5] msmouse: Use fifo8 instead of array

2022-09-11 Thread Volker Rümelin
Am 08.09.22 um 19:31 schrieb Arwed Meyer: @@ -54,21 +60,15 @@ DECLARE_INSTANCE_CHECKER(MouseChardev, MOUSE_CHARDEV, static void msmouse_chr_accept_input(Chardev *chr) { MouseChardev *mouse = MOUSE_CHARDEV(chr); -int len; +uint32_t len_out, len; -len =

Re: [PATCH v3] audio: Add sndio backend

2022-09-09 Thread Volker Rümelin
_options.txt | 4 +- qapi/audio.json | 25 +- qemu-options.hx | 16 + scripts/meson-buildoptions.sh | 7 +- 10 files changed, 632 insertions(+), 5 deletions(-) create mode 100644 audio/sndioaudio.c Tested again on Linux. Reviewed-by: Volker Rümelin Tested-by: Volker Rümelin

Re: [PATCH v2] audio: add help option for -audio and -audiodev

2022-09-07 Thread Volker Rümelin
Am 07.09.22 um 19:30 schrieb Claudio Fontana: add a simple help option for -audio and -audiodev to show the list of available drivers, and document them. Signed-off-by: Claudio Fontana --- audio/audio.c | 20 audio/audio.h | 1 + qemu-options.hx | 10 ++

Re: [PATCH] audio: exit(1) if audio backend failed to be found or initialized

2022-08-23 Thread Volker Rümelin
s); +return NULL; Hi Marc-André, I don't understand why you move the QTAILQ_INSERT_TAIL(_states, s, list) macro down. Without this you don't need the additional free_audio_state() call. audio_cleanup() takes care to free the audio state. The rest looks good. You can add my Revi

Re: [PULL 00/17] Kraxel 20220610 patches

2022-06-11 Thread Volker Rümelin
Am 10.06.22 um 22:16 schrieb Richard Henderson: On 6/10/22 02:20, Gerd Hoffmann wrote: The following changes since commit 9cc1bf1ebca550f8d90f967ccd2b6d2e00e81387:    Merge tag 'pull-xen-20220609' of https://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging (2022-06-09 08:25:17

[PATCH 1/2] ui/gtk-gl-area: implement GL context destruction

2022-06-05 Thread Volker Rümelin
The counterpart function for gd_gl_area_create_context() is currently empty. Implement the gd_gl_area_destroy_context() function to avoid GL context leaks. Signed-off-by: Volker Rümelin --- ui/gtk-gl-area.c | 8 +++- ui/trace-events | 1 + 2 files changed, 8 insertions(+), 1 deletion

[PATCH 2/2] ui/gtk-gl-area: create the requested GL context version

2022-06-05 Thread Volker Rümelin
ions fully implemented. An example for this is the Intel i965 driver on a Haswell processor. Signed-off-by: Volker Rümelin --- ui/gtk-gl-area.c | 31 ++- ui/trace-events | 1 + 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-ar

[PATCH 0/2] Fixes for ui/gtk-gl-area

2022-06-05 Thread Volker Rümelin
The first patch fixes a GL context leak. The second patch fixes a black guest screen on Wayland with OpenGL accelerated QEMU graphics devices. This bug doesn't seem to be related to issues #910, #865, #671 or #298. Volker Rümelin (2):   ui/gtk-gl-area: implement GL context destruction   ui

Re: [PATCH] target/i386: kvm: do not access uninitialized variable on older kernels

2022-03-18 Thread Volker Rümelin
Am 18.03.22 um 16:26 schrieb Paolo Bonzini: KVM support for AMX includes a new system attribute, KVM_X86_XCOMP_GUEST_SUPP. Commit 19db68ca68 ("x86: Grant AMX permission for guest", 2022-03-15) however did not fully consider the behavior on older kernels. First, it warns too aggressively.

Re: [PATCH v3 06/15] jackaudio: use more jack audio buffers

2022-03-02 Thread Volker Rümelin
On Dienstag, 1. März 2022 20:13:02 CET Volker Rümelin wrote: The next patch reduces the effective qemu playback buffer size by timer-period. Increase the number of jack audio buffers by one to preserve the total effective buffer size. The size of one jack audio buffer is 512 samples. With audio

[PATCH v3 13/15] ossaudio: reduce effective playback buffer size

2022-03-01 Thread Volker Rümelin
Return the free buffer size for the mmapped case in function oss_buffer_get_free() to reduce the effective playback buffer size. All intermediate audio playback buffers become temporary buffers. Signed-off-by: Volker Rümelin --- audio/ossaudio.c | 7 --- 1 file changed, 4 insertions(+), 3

[PATCH v3 12/15] dsoundaudio: reduce effective playback buffer size

2022-03-01 Thread Volker Rümelin
Add the buffer_get_free pcm_ops function to reduce the effective playback buffer size. All intermediate audio playback buffers become temporary buffers. Signed-off-by: Volker Rümelin --- audio/dsoundaudio.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions

[PATCH v3 04/15] audio: inline function audio_pcm_sw_get_rpos_in()

2022-03-01 Thread Volker Rümelin
Simplify code by inlining function audio_pcm_sw_get_rpos_in() at the only call site and remove the duplicated audio_bug() test. Signed-off-by: Volker Rümelin --- audio/audio.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/audio/audio.c b/audio

[PATCH v3 03/15] audio: add function audio_pcm_hw_conv_in()

2022-03-01 Thread Volker Rümelin
wraps around. Signed-off-by: Volker Rümelin --- audio/audio.c | 25 +++-- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index dfd32912da..f28e91853f 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -548,6 +548,24 @@ static

[PATCH v3 09/15] Revert "audio: fix wavcapture segfault"

2022-03-01 Thread Volker Rümelin
This reverts commit cbaf25d1f59ee13fc7542a06ea70784f2e000c04. Since previous commit every audio backend has a pcm_ops function table. It's no longer necessary to test if the table is available. Signed-off-by: Volker Rümelin --- audio/audio.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v3 15/15] sdlaudio: fix samples vs. frames mix-up

2022-03-01 Thread Volker Rümelin
Fix the same samples vs. frames mix-up that the previous commit fixed for the PulseAudio backend. Signed-off-by: Volker Rümelin --- audio/sdlaudio.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index e605c787ba..797b47bbdd 100644

[PATCH v3 11/15] paaudio: reduce effective playback buffer size

2022-03-01 Thread Volker Rümelin
Add the buffer_get_free pcm_ops function to reduce the effective playback buffer size. All intermediate audio playback buffers become temporary buffers. Signed-off-by: Volker Rümelin --- audio/paaudio.c | 33 - 1 file changed, 24 insertions(+), 9 deletions

[PATCH v3 14/15] paaudio: fix samples vs. frames mix-up

2022-03-01 Thread Volker Rümelin
Now that the mixing buffer size no longer adds to playback latency, fix the samples vs. frames mix-up in the mixing buffer size calculation. This change will go largely unnoticed as long as the user doesn't use a buffer-size smaller than timer-period. Signed-off-by: Volker Rümelin --- audio

[PATCH v3 08/15] audio: add pcm_ops function table for capture backend

2022-03-01 Thread Volker Rümelin
Add a pcm_ops function table for the capture backend. This avoids additional code in the next patches to test if the pcm_ops table is available. Signed-off-by: Volker Rümelin --- audio/audio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/audio/audio.c b/audio/audio.c index 9e2d7fb209

[PATCH v3 02/15] audio: move function audio_pcm_hw_clip_out()

2022-03-01 Thread Volker Rümelin
Move the function audio_pcm_hw_clip_out() into the correct section 'Hard voice (playback)'. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Volker Rümelin --- audio/audio.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/audio

[PATCH v3 01/15] audio: replace open-coded buffer arithmetic

2022-03-01 Thread Volker Rümelin
Replace open-coded buffer arithmetic with the new function audio_ring_posb(). That's the position in backward direction of a given point at a given distance. Signed-off-by: Volker Rümelin --- audio/audio.c | 25 +++-- audio/audio_int.h | 13 + audio

[PATCH v3 06/15] jackaudio: use more jack audio buffers

2022-03-01 Thread Volker Rümelin
that they can't access. Signed-off-by: Volker Rümelin --- audio/jackaudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/jackaudio.c b/audio/jackaudio.c index 317009e936..26246c3a8b 100644 --- a/audio/jackaudio.c +++ b/audio/jackaudio.c @@ -483,8 +483,8 @@ static int

[PATCH v3 10/15] audio: restore mixing-engine playback buffer size

2022-03-01 Thread Volker Rümelin
ueue which the downstream queue accepts. Signed-off-by: Volker Rümelin --- audio/alsaaudio.c | 1 + audio/audio.c | 69 +++ audio/audio_int.h | 7 - audio/coreaudio.c | 3 +++ audio/jackaudio.c | 1 + audio/noaudio.c | 1 + audio/ossaud

[PATCH v3 07/15] audio: copy playback stream in sequential order

2022-03-01 Thread Volker Rümelin
bufbackend buffer The effective total playback buffer size is reduced by timer_period. Signed-off-by: Volker Rümelin --- audio/audio.c | 24 +--- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 35437986d9..9e2d7fb209 1006

[PATCH v3 05/15] paaudio: increase default latency to 46ms

2022-03-01 Thread Volker Rümelin
is a quote from the PulseAudio Latency Control documentation: 'For the sake of (...) drop-out safety always make sure to pick the highest latency possible that fulfills your needs.' Signed-off-by: Volker Rümelin --- audio/paaudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v3 00/15] reduce audio playback latency

2022-03-01 Thread Volker Rümelin
e Improved commit message. v3: [PATCH v3 01/15] audio: replace open-coded buffer arithmetic Use kernel-doc comments to document the audio_ring_posb() function. Volker Rümelin (15):   audio: replace open-coded buffer arithmetic   audio: move function audio_pcm_hw_clip_out()   audio: add function audio_pc

Re: [PATCH v2 01/15] audio: replace open-coded buffer arithmetic

2022-03-01 Thread Volker Rümelin
Am 26.01.22 um 09:48 schrieb Gerd Hoffmann: Hi, --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -266,6 +266,12 @@ static inline size_t audio_ring_dist(size_t dst, size_t src, size_t len) return (dst >= src) ? (dst - src) : (len - src + dst); } You haven't touched this

Re: [PATCH v2 01/15] audio: replace open-coded buffer arithmetic

2022-01-25 Thread Volker Rümelin
On Samstag, 22. Januar 2022 13:57:31 CET Volker Rümelin wrote: Replace open-coded buffer arithmetic with the new function audio_ring_posb(). That's the position in backward direction of a given point at a given distance. Signed-off-by: Volker Rümelin --- First of all, getting rid of all those

[PATCH] hw/usb/dev-mtp: create directories with a+x mode mask

2022-01-22 Thread Volker Rümelin
Current code creates directories with mode 0644. Even the creator can't create files in the new directory. Set all x mode flags in variable mask and clear all x mode flags in function open() to preserve the current open mode. Signed-off-by: Volker Rümelin --- hw/usb/dev-mtp.c | 4 ++-- 1 file

[PATCH v2 14/15] paaudio: fix samples vs. frames mix-up

2022-01-22 Thread Volker Rümelin
Now that the mixing buffer size no longer adds to playback latency, fix the samples vs. frames mix-up in the mixing buffer size calculation. This change will go largely unnoticed as long as the user doesn't use a buffer-size smaller than timer-period. Signed-off-by: Volker Rümelin --- audio

[PATCH v2 10/15] audio: restore mixing-engine playback buffer size

2022-01-22 Thread Volker Rümelin
ueue which the downstream queue accepts. Signed-off-by: Volker Rümelin --- audio/alsaaudio.c | 1 + audio/audio.c | 69 +++ audio/audio_int.h | 7 - audio/coreaudio.c | 3 +++ audio/jackaudio.c | 1 + audio/noaudio.c | 1 + audio/ossaud

[PATCH v2 15/15] sdlaudio: fix samples vs. frames mix-up

2022-01-22 Thread Volker Rümelin
Fix the same samples vs. frames mix-up that the previous commit fixed for the PulseAudio backend. Signed-off-by: Volker Rümelin --- audio/sdlaudio.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index e605c787ba..797b47bbdd 100644

[PATCH v2 06/15] jackaudio: use more jack audio buffers

2022-01-22 Thread Volker Rümelin
that they can't access. Signed-off-by: Volker Rümelin --- audio/jackaudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/jackaudio.c b/audio/jackaudio.c index 317009e936..26246c3a8b 100644 --- a/audio/jackaudio.c +++ b/audio/jackaudio.c @@ -483,8 +483,8 @@ static int

[PATCH v2 08/15] audio: add pcm_ops function table for capture backend

2022-01-22 Thread Volker Rümelin
Add a pcm_ops function table for the capture backend. This avoids additional code in the next patches to test if the pcm_ops table is available. Signed-off-by: Volker Rümelin --- audio/audio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/audio/audio.c b/audio/audio.c index 9e2d7fb209

[PATCH v2 07/15] audio: copy playback stream in sequential order

2022-01-22 Thread Volker Rümelin
bufbackend buffer The effective total playback buffer size is reduced by timer_period. Signed-off-by: Volker Rümelin --- audio/audio.c | 24 +--- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 35437986d9..9e2d7fb209 1006

[PATCH v2 05/15] paaudio: increase default latency to 46ms

2022-01-22 Thread Volker Rümelin
is a quote from the PulseAudio Latency Control documentation: 'For the sake of (...) drop-out safety always make sure to pick the highest latency possible that fulfills your needs.' Signed-off-by: Volker Rümelin --- audio/paaudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2 01/15] audio: replace open-coded buffer arithmetic

2022-01-22 Thread Volker Rümelin
Replace open-coded buffer arithmetic with the new function audio_ring_posb(). That's the position in backward direction of a given point at a given distance. Signed-off-by: Volker Rümelin --- audio/audio.c | 25 +++-- audio/audio_int.h | 6 ++ audio/coreaudio.c | 10

[PATCH v2 04/15] audio: inline function audio_pcm_sw_get_rpos_in()

2022-01-22 Thread Volker Rümelin
Simplify code by inlining function audio_pcm_sw_get_rpos_in() at the only call site and remove the duplicated audio_bug() test. Signed-off-by: Volker Rümelin --- audio/audio.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/audio/audio.c b/audio

<    1   2   3   4   5   6   >