<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bwlp/qemu.git/audio, branch master</title>
<subtitle>Experimental fork of QEMU with video encoding patches</subtitle>
<id>https://git.openslx.org/bwlp/qemu.git/atom/audio?h=master</id>
<link rel='self' href='https://git.openslx.org/bwlp/qemu.git/atom/audio?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/'/>
<updated>2022-11-06T08:48:50+00:00</updated>
<entry>
<title>module: add Error arguments to module_load and module_load_qom</title>
<updated>2022-11-06T08:48:50+00:00</updated>
<author>
<name>Claudio Fontana</name>
</author>
<published>2022-09-29T09:30:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=c551fb0b53db5d9a1f0116e8cce12f994605c9ea'/>
<id>urn:sha1:c551fb0b53db5d9a1f0116e8cce12f994605c9ea</id>
<content type='text'>
improve error handling during module load, by changing:

bool module_load(const char *prefix, const char *lib_name);
void module_load_qom(const char *type);

to:

int module_load(const char *prefix, const char *name, Error **errp);
int module_load_qom(const char *type, Error **errp);

where the return value is:

 -1 on module load error, and errp is set with the error
  0 on module or one of its dependencies are not installed
  1 on module load success
  2 on module load success (module already loaded or built-in)

module_load_qom_one has been introduced in:

commit 28457744c345 ("module: qom module support"), which built on top of
module_load_one, but discarded the bool return value. Restore it.

Adapt all callers to emit errors, or ignore them, or fail hard,
as appropriate in each context.

Replace the previous emission of errors via fprintf in _some_ error
conditions with Error and error_report, so as to emit to the appropriate
target.

A memory leak is also fixed as part of the module_load changes.

audio: when attempting to load an audio module, report module load errors.
Note that still for some callers, a single issue may generate multiple
error reports, and this could be improved further.
Regarding the audio code itself, audio_add() seems to ignore errors,
and this should probably be improved.

block: when attempting to load a block module, report module load errors.
For the code paths that already use the Error API, take advantage of those
to report module load errors into the Error parameter.
For the other code paths, we currently emit the error, but this could be
improved further by adding Error parameters to all possible code paths.

console: when attempting to load a display module, report module load errors.

qdev: when creating a new qdev Device object (DeviceState), report load errors.
      If a module cannot be loaded to create that device, now abort execution
      (if no CONFIG_MODULE) or exit (if CONFIG_MODULE).

qom/object.c: when initializing a QOM object, or looking up class_by_name,
              report module load errors.

qtest: when processing the "module_load" qtest command, report errors
       in the load of the module.

Signed-off-by: Claudio Fontana &lt;cfontana@suse.de&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20220929093035.4231-4-cfontana@suse.de&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>module: rename module_load_one to module_load</title>
<updated>2022-11-06T08:48:50+00:00</updated>
<author>
<name>Claudio Fontana</name>
</author>
<published>2022-09-29T09:30:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=dbc0e80553c067f56cb236d9de2cd0d50f3c6131'/>
<id>urn:sha1:dbc0e80553c067f56cb236d9de2cd0d50f3c6131</id>
<content type='text'>
Signed-off-by: Claudio Fontana &lt;cfontana@suse.de&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;f4bug@amsat.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20220929093035.4231-3-cfontana@suse.de&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>audio: improve out.voices test</title>
<updated>2022-10-12T18:36:17+00:00</updated>
<author>
<name>Helge Konetzka</name>
</author>
<published>2022-10-12T11:49:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=61ddafbcfac4975ee245cd3453be86b0632a5605'/>
<id>urn:sha1:61ddafbcfac4975ee245cd3453be86b0632a5605</id>
<content type='text'>
Improve readability of audio out.voices test:
If 1 is logged and set after positive test, 1 should be tested.

Signed-off-by: Helge Konetzka &lt;hk@zapateado.de&gt;
Reviewed-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Message-Id: &lt;20221012114925.5084-3-hk@zapateado.de&gt;
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>audio: fix in.voices test</title>
<updated>2022-10-12T18:36:17+00:00</updated>
<author>
<name>Helge Konetzka</name>
</author>
<published>2022-10-12T11:49:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=a7b7802bfe971b1b33cf85b328a521333e68ce97'/>
<id>urn:sha1:a7b7802bfe971b1b33cf85b328a521333e68ce97</id>
<content type='text'>
Calling qemu with valid -audiodev ...,in.voices=0 results in an obsolete
warning:
  audio: Bogus number of capture voices 0, setting to 0
This patch fixes the in.voices test.

Signed-off-by: Helge Konetzka &lt;hk@zapateado.de&gt;
Reviewed-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Message-Id: &lt;20221012114925.5084-2-hk@zapateado.de&gt;
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>audio: prevent an integer overflow in resampling code</title>
<updated>2022-10-11T08:17:08+00:00</updated>
<author>
<name>Volker Rümelin</name>
</author>
<published>2022-09-23T18:36:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=b6d93282ccac79e42d87d02652db353894cd1db9'/>
<id>urn:sha1:b6d93282ccac79e42d87d02652db353894cd1db9</id>
<content type='text'>
There are corner cases where rate-&gt;opos can overflow. For
example, if QEMU is started with -audiodev pa,id=audio0,
out.frequency=11025 -device ich9-intel-hda -device hda-duplex,
audiodev=audio0 and the guest plays audio with a sampling
frequency of 44100Hz, rate-&gt;opos will overflow after 27.05h
and the audio stream will be silent for a long time.

To prevent a rate-&gt;opos and also a rate-&gt;ipos overflow, both
are wrapped around after a short time. The wrap around point
rate-&gt;ipos &gt;= 0x10001 is an arbitrarily selected value and can
be any small value, 0 and 1 included.

The comment 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 &lt;vr_qemu@t-online.de&gt;
Message-Id: &lt;20220923183640.8314-12-vr_qemu@t-online.de&gt;
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>audio: fix sw-&gt;buf size for audio recording</title>
<updated>2022-10-11T08:17:08+00:00</updated>
<author>
<name>Volker Rümelin</name>
</author>
<published>2022-09-23T18:36:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=b73ef11ff68f05418c8b60945b1e1783a72bd822'/>
<id>urn:sha1:b73ef11ff68f05418c8b60945b1e1783a72bd822</id>
<content type='text'>
The calculation of the buffer size needed to store audio samples
after resampling is wrong for audio recording. For audio recording
sw-&gt;ratio is calculated as

sw-&gt;ratio = frontend sample rate / backend sample rate.

From this follows

frontend samples = frontend sample rate / backend sample rate
 * backend samples
frontend samples = sw-&gt;ratio * backend samples

In 2 of 3 places in the audio recording code where sw-&gt;ratio
is used in a calculation to get the number of frontend frames,
the calculation is wrong. Fix this. The 3rd formula in
audio_pcm_sw_read() is correct.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/71
Signed-off-by: Volker Rümelin &lt;vr_qemu@t-online.de&gt;
Acked-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Message-Id: &lt;20220923183640.8314-11-vr_qemu@t-online.de&gt;
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>audio: refactor audio_get_avail()</title>
<updated>2022-10-11T08:17:08+00:00</updated>
<author>
<name>Volker Rümelin</name>
</author>
<published>2022-09-23T18:36:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=0724c57988f4ad826b02f12093ace5ef657cec21'/>
<id>urn:sha1:0724c57988f4ad826b02f12093ace5ef657cec21</id>
<content type='text'>
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 &lt;vr_qemu@t-online.de&gt;
Reviewed-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Message-Id: &lt;20220923183640.8314-10-vr_qemu@t-online.de&gt;
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>audio: rename audio_sw_bytes_free()</title>
<updated>2022-10-11T08:17:08+00:00</updated>
<author>
<name>Volker Rümelin</name>
</author>
<published>2022-09-23T18:36:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=c4e592647e161fe23adc3eccd8743b285e4b342b'/>
<id>urn:sha1:c4e592647e161fe23adc3eccd8743b285e4b342b</id>
<content type='text'>
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 &lt;vr_qemu@t-online.de&gt;
Reviewed-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Message-Id: &lt;20220923183640.8314-9-vr_qemu@t-online.de&gt;
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>audio: swap audio_rate_get_bytes() function parameters</title>
<updated>2022-10-11T08:17:08+00:00</updated>
<author>
<name>Volker Rümelin</name>
</author>
<published>2022-09-23T18:36:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=613fe02b2a127d921b37843cb514e919ecbe53f5'/>
<id>urn:sha1:613fe02b2a127d921b37843cb514e919ecbe53f5</id>
<content type='text'>
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 &lt;vr_qemu@t-online.de&gt;
Reviewed-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Message-Id: &lt;20220923183640.8314-8-vr_qemu@t-online.de&gt;
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>spiceaudio: update comment</title>
<updated>2022-10-11T08:17:08+00:00</updated>
<author>
<name>Volker Rümelin</name>
</author>
<published>2022-09-23T18:36:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=70ded68b45b90cf43a9a757df6483503055485f2'/>
<id>urn:sha1:70ded68b45b90cf43a9a757df6483503055485f2</id>
<content type='text'>
Replace a comment with a question with the answer.

Signed-off-by: Volker Rümelin &lt;vr_qemu@t-online.de&gt;
Reviewed-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Message-Id: &lt;20220923183640.8314-7-vr_qemu@t-online.de&gt;
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
</feed>
