aboutsummaryrefslogtreecommitdiff
path: root/audio
AgeCommit message (Collapse)AuthorFilesLines
2020-03-16audio: fix saturation nonlinearity in clip_* functionsVolker Rümelin1-3/+2
The current positive limit for the saturation nonlinearity is only correct if the type of the result has 8 bits or less. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200308193321.20668-5-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-03-16audio: change mixing engine float range to [-1.f, 1.f]Volker Rümelin2-11/+10
Currently the internal float range of the mixing engine is [-.5f, .5f]. PulseAudio, SDL2 and libasound use a [-1.f, 1.f] range. This means with float samples the audio playback volume is 6dB too low and audio recording signals will be clipped in most cases. To avoid another scaling factor in the conv_natural_float_* and clip_natural_float_* functions with FLOAT_MIXENG defined this patch changes the mixing engine float range to [-1.f, 1.f]. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200308193321.20668-4-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-03-16audio: consistency changesVolker Rümelin1-1/+1
Change the clip_natural_float_from_mono() function in audio/mixeng.c to be consistent with the clip_*_from_mono() functions in audio/mixeng_template.h. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200308193321.20668-3-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-03-16audio: change naming scheme of FLOAT_CONV macrosVolker Rümelin1-11/+11
This patch changes the naming scheme of the FLOAT_CONV_TO and FLOAT_CONV_FROM macros to the scheme used in mixeng_template.h. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200308193321.20668-2-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-02-18audio/alsaaudio: Remove superfluous semicolonsPhilippe Mathieu-Daudé1-2/+2
Fixes: 286a5d201e4 Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200218094402.26625-3-philmd@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-02-06audio: proper support for float samples in mixengKővágó, Zoltán9-78/+179
This adds proper support for float samples in mixeng by adding a new audio format for it. Limitations: only native endianness is supported. None of the virtual sound cards support float samples (it looks like most of them only support 8 and 16 bit, only hda supports 32 bit), it is only used for the audio backends (i.e. host side). Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Acked-by: Markus Armbruster <armbru@redhat.com> Message-id: 8a8b0b5698401b78d3c4c8ec90aef83b95babb06.1580672076.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-02-06coreaudio: fix coreaudio playbackVolker Rümelin4-23/+69
There are reports that since commit 2ceb8240fa "coreaudio: port to the new audio backend api" audio playback with CoreAudio is broken. This patch reverts some parts the commit. Because of changes in the audio subsystem the audio clip function in v4.1.0 of coreaudio.c had to be moved to mixeng.c and the generic buffer management code needed a hint about the size of the float type. This patch is based on a patch from Zoltán Kővágó found at https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg02142.html. Fixes: 2ceb8240fa "coreaudio: port to the new audio backend api" Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200202140641.4737-1-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-02-06audio/dsound: fix invalid parameters errorKővágó, Zoltán3-8/+26
Windows (unlike wine) bails out when IDirectSoundBuffer8::Lock is called with zero length. Also, hw->pos_emul handling was incorrect when calling this function for the first time. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Reported-by: KJ Liew <liewkj@yahoo.com> Tested-by: Howard Spoelstra <hsp.cat7@gmail.com> Message-id: fe9744216d9d421a2dbb09bcf5fa0dbd18f77ac5.1580684275.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-01-31audio: audio_generic_get_buffer_in should honor *sizeVolker Rümelin1-1/+2
The function generic_get_buffer_in currently ignores the *size parameter and may return a buffer larger than *size. As a result the variable samples in function audio_pcm_hw_run_in may underflow. The while loop then most likely will never termiate. Buglink: http://bugs.debian.org/948658 Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-9-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-01-31ossaudio: disable poll mode can't be reachedVolker Rümelin1-9/+5
Currently there is no way to disable poll mode in oss_enable_out and oss_enable_in when it was enabled before. The enable code path always resets the poll mode state variable. Fixes: b027a538c6 "oss: Remove unused error handling of qemu_set_fd_handler" Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-8-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-01-31ossaudio: prevent SIGSEGV in oss_enable_outVolker Rümelin1-1/+1
With audiodev parameter out.mixing-engine=off hw->mix_buf is NULL. This patch reverts a small part of dc88e38fa7 "audio: unify input and output mixeng buffer management". To reproduce the problem start qemu with -audiodev oss,id=audio0,try-mmap=on,out.mixing-engine=off Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-6-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-01-31audio: fix bug 1858488Volker Rümelin8-37/+52
The combined generic buffer management code and buffer run out code in function audio_generic_put_buffer_out has a problematic behaviour. A few hundred milliseconds after playback starts the mixing buffer and the generic buffer are nearly full and the following pattern can be seen. On first call of audio_pcm_hw_run_out the buffer run code in audio_generic_put_buffer_out writes some data to the audio hardware but the generic buffer will fill faster and is full when audio_pcm_hw_run_out returns. This is because emulated audio devices can produce playback data at a higher rate than the audio backend hardware consumes this data. On next call of audio_pcm_hw_run_out the buffer run code in audio_generic_put_buffer_out writes some data to the audio hardware but no audio data is transferred to the generic buffer because the buffer is already full. Then the pattern repeats. For the emulated audio device this looks like the audio timer period has doubled. This patch splits the combined generic buffer management code and buffer run out code and calls the buffer run out code after buffer management code to break this pattern. The bug report is for the wav audio backend. But the problem is not limited to this backend. All audio backends which use the audio_generic_put_buffer_out function show this problem. Buglink: https://bugs.launchpad.net/qemu/+bug/1858488 Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-5-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-01-31audio: prevent SIGSEGV in AUD_get_buffer_size_outVolker Rümelin1-2/+2
With audiodev parameter out.mixing-engine=off hw->mix_buf is NULL. This leads to a segmentation fault in AUD_get_buffer_size_out. This patch reverts a small part of dc88e38fa7 "audio: unify input and output mixeng buffer management". To reproduce the problem start qemu with -soundhw adlib -audiodev pa,id=audio0,out.mixing-engine=off Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-4-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-01-31paaudio: remove unused variablesVolker Rümelin1-4/+2
The unused variables were last used before commit 49ddd7e122 "paaudio: port to the new audio backend api". Fixes: 49ddd7e122 Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-3-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-01-31audio: fix audio_generic_readVolker Rümelin1-5/+5
It seems the function audio_generic_read started as a copy of function audio_generic_write and some necessary changes were forgotten. Fix the mixed up source and destination pointers and rename misnamed variables. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-2-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-01-31audio: fix audio_generic_writeVolker Rümelin1-1/+1
The pcm_ops function put_buffer_out expects the returned pointer of function get_buffer_out as argument. Fix this. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-1-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-01-31audio/oss: fix buffer pos calculationGerd Hoffmann1-1/+1
Fixes: 3ba4066d085f ("ossaudio: port to the new audio backend api") Reported-by: ziming zhang <ezrakiez@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20200120101804.29578-1-kraxel@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2020-01-24audio/audio: Add missing fall through commentPhilippe Mathieu-Daudé1-0/+1
When building with GCC9 using CFLAG -Wimplicit-fallthrough=2 we get: audio/audio.c: In function ‘audio_pcm_init_info’: audio/audio.c:306:14: error: this statement may fall through [-Werror=implicit-fallthrough=] 306 | sign = 1; | ~~~~~^~~ audio/audio.c:307:5: note: here 307 | case AUDIO_FORMAT_U8: | ^~~~ cc1: all warnings being treated as errors Similarly to e46349414, add the missing fall through comment to hint GCC. Fixes: 2b9cce8c8c Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20191218192526.13845-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-01-06audio: fix integer overflowVolker Rümelin1-1/+1
Tell the compiler to do a 32bit * 32bit -> 64bit multiplication because period_ticks is a 64bit variable. The overflow occurs for audio timer periods larger than 4294967us. Fixes: be1092afa0 "audio: fix audio timer rate conversion bug" Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 8893a235-66a8-8fbe-7d95-862e29da90b1@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-01-06paaudio: wait until the recording stream is readyVolker Rümelin1-0/+5
Don't call pa_stream_peek before the recording stream is ready. Information to reproduce the problem. Start and stop Audacity in the guest several times because the problem is racy. libvirt log file: -audiodev pa,id=audio0,server=localhost,out.latency=30000, out.mixing-engine=off,in.mixing-engine=off \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny, resourcecontrol=deny \ -msg timestamp=on : Domain id=4 is tainted: custom-argv char device redirected to /dev/pts/1 (label charserial0) audio: Device pcspk: audiodev default parameter is deprecated, please specify audiodev=audio0 audio: Device hda: audiodev default parameter is deprecated, please specify audiodev=audio0 pulseaudio: pa_stream_peek failed pulseaudio: Reason: Bad state pulseaudio: pa_stream_peek failed pulseaudio: Reason: Bad state Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200104091122.13971-5-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-01-06paaudio: try to drain the recording streamVolker Rümelin1-16/+25
There is no guarantee a single call to pa_stream_peek every timer_period microseconds can read a recording stream faster than the data gets produced at the source. Let qpa_read try to drain the recording stream. To reproduce the problem: Start qemu with -audiodev pa,id=audio0,in.mixing-engine=off On the host connect the qemu recording stream to the monitor of a hardware output device. While the problem can also be seen with a hardware input device, it's obvious with the monitor of a hardware output device. In the guest start audio recording with audacity and notice the slow recording data rate. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200104091122.13971-4-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-01-06paaudio: drop recording stream in qpa_fini_inVolker Rümelin1-4/+18
Every call to pa_stream_peek which returns a data length > 0 should have a corresponding pa_stream_drop. A call to qpa_read does not necessarily call pa_stream_drop immediately after a call to pa_stream_peek. Test in qpa_fini_in if a last pa_stream_drop is needed. This prevents following messages in the libvirt log file after a recording stream gets closed and a new one opened. pulseaudio: pa_stream_drop failed pulseaudio: Reason: Bad state pulseaudio: pa_stream_drop failed pulseaudio: Reason: Bad state To reproduce start qemu with -audiodev pa,id=audio0,in.mixing-engine=off and in the guest start and stop Audacity several times. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200104091122.13971-3-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-11-20audio: fix audio recordingVolker Rümelin1-0/+1
With current code audio recording with all audio backends except PulseAudio and DirectSound is broken. The generic audio recording buffer management forgot to update the current read position after a read. Fixes: ff095e5231 "audio: api for mixeng code free backends" Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Zoltán Kővágó <DirtY.iCE.hu@gmail.com> Message-id: 2fc947cf-7b42-de68-3f11-cbcf1c096be9@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-10-26audio: fix missing breakPaolo Bonzini1-0/+1
Reported by Coverity (CID 1406449). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-10-18paaudio: fix channel order for usb-audio 5.1 and 7.1 streamsKővágó, Zoltán1-5/+45
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 2900e462d27bd73277ae083d037c32b1b4451ee2.1570996490.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-10-18audio: basic support for multichannel audioKővágó, Zoltán2-8/+1
Which currently only means removing some checks. Old code won't require more than two channels, but new code will need it. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 7e53be1f97e939ed3bb729ef39e76b775643118a.1570996490.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-10-18audio: replace shift in audio_pcm_info with bytes_per_frameKővágó, Zoltán10-65/+66
The bit shifting trick worked because the number of bytes per frame was always a power-of-two (since QEMU only supports mono, stereo and 8, 16 and 32 bit samples). But if we want to add support for surround sound, this no longer holds true. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 1351fd9bcce0ff20d81850c5292722194329de02.1570996490.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-10-18audio: support more than two channels in volume settingKővágó, Zoltán5-24/+54
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 5d3dd2ee3baaa62805e79c3901abb7415ae32461.1570996490.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-10-18paaudio: get/put_buffer functionsKővágó, Zoltán1-0/+83
This lets us avoid some buffer copying when using mixeng. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: d03d30138b9b5a9681cc90cbfbfec0a197cac88c.1570996490.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-10-18audio: make mixeng optionalKővágó, Zoltán2-14/+80
Implementation of the previously added mixing-engine option. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: c05bc258889ed289e8ee1bdbcc5e84174ec221e7.1570996490.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-10-18audio: paaudio: ability to specify stream nameKővágó, Zoltán1-2/+2
This can be used to identify stream in tools like pavucontrol when one creates multiple -audiodevs or runs multiple qemu instances. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Acked-by: Markus Armbruster <armbru@redhat.com> Message-id: 2d6e337c474ac84172d0809e6959c26b21d48120.1568157545.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-10-18audio: paaudio: fix connection and stream nameKővágó, Zoltán1-3/+6
Connection name was previously erroneously set to the server socket path, while connection names were simply "qemu". After this patch, the connection name will be the vm name (falling back to "qemu" if not specified), while stream names will be the audiodev's id. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 3d139426031a400a68d440608ba5e43f0e116cd8.1568157545.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-10-18audio: fix parameter dereference before NULL checkKővágó, Zoltán1-2/+5
This should fix Coverity issues CID 1405305 and 1405301. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 0eadcc88b8421bb86ce2d68ac70517f920c3ad6c.1568157545.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23audio: split ctl_* functions into enable_* and volume_*Kővágó, Zoltán12-321/+223
This way we no longer need vararg functions, improving compile time error detection. Also now it's possible to check actually what commands are supported, without needing to manually update ctl_caps. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 2b08b3773569c5be055d0a0fb2f29ff64e79f0f4.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23audio: common rate control code for timer based outputsKővágó, Zoltán5-81/+79
This commit removes the ad-hoc rate-limiting code from noaudio and wavaudio, and replaces them with a (slightly modified) code from spiceaudio. This way multiple write calls (for example when the circular buffer wraps around) do not cause problems. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: fd0fe5b95b13fa26d09ae77a72f99d0ea411de14.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23audio: unify input and output mixeng buffer managementKővágó, Zoltán4-76/+80
Usage notes: hw->samples became hw->{mix,conv}_buf->size, except before initialization (audio_pcm_hw_alloc_resources_*), hw->samples gives the initial size of the STSampleBuffer. The next commit tries to fix this inconsistency. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: a78caeb2eeb6348ecb45bb2c81709570ef8ac5b3.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23audio: remove remains of the old backend apiKővágó, Zoltán2-43/+6
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 497decab6d0f0fb9529bea63ec7ce0bd7b553038.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23wavaudio: port to the new audio backend apiKővágó, Zoltán1-45/+9
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: eede77aeb9c17b379948b0b6d2ac10f45d74fa62.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23spiceaudio: port to the new audio backend apiKővágó, Zoltán1-74/+42
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 4d3356df9ccbffee2f710b93d456443c81e3f011.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23sdlaudio: port to the new audio backend apiKővágó, Zoltán1-45/+42
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: ac1722a03fb1b530c2081f46585ce7fa80ebef6c.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23paaudio: port to the new audio backend apiKővágó, Zoltán4-523/+45
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 21fe8f2cf949039c8c40a0352590c593b104917d.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23ossaudio: port to the new audio backend apiKővágó, Zoltán1-176/+96
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 22ab335146acd8099779583edcf6ed46de836bd6.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23noaudio: port to the new audio backend apiKővágó, Zoltán1-26/+17
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 10eebdd2e1529c2bd403ef98dd9d346c6d4ca3d1.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23dsoundaudio: port to the new audio backend apiKővágó, Zoltán2-261/+91
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 2ca925ab551ea832c930fc2db213a9e73d8dab7f.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23coreaudio: port to the new audio backend apiKővágó, Zoltán1-61/+69
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 586a1e66de5cbc6c5234f9ae556d24befb6afada.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23alsaaudio: port to the new audio backend apiKővágó, Zoltán1-222/+80
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: ab9768e73dfe7b7305bd6a51629846e0d77622a5.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-09-23audio: api for mixeng code free backendsKővágó, Zoltán3-9/+251
This will make it possible to skip mixeng with audio playback and recording, allowing us to free ourselves from the limitations of the current mixeng (stereo, int64 samples only). In this case, HW and SW voices will be essentially the same, for every SW voice we will create a HW voice, since we can no longer mix multiple voices together. Some backends expect us to call a function when we have data ready write()/read() style, while others provide a buffer and expects us to directly write/read it, so for optimal performance audio_pcm_ops provide methods for both cases. Previously backends asked mixeng for more data in run_out/run_it, now instead mixeng or the frontends will call the backends, so that's why two sets of functions required. audio.c contains glue code between the two styles, so backends only ever have to implement one style and frontends are free to call whichever is more convenient for them. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 15a33c03a62228922d851f7324c52f73cb8d2414.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-08-28audio: omitting audiodev= parameter is only deprecatedKővágó, Zoltán1-4/+4
Unfortunately, changes introduced in af2041ed2d "audio: audiodev= parameters no longer optional when -audiodev present" breaks backward compatibility. This patch changes the error into a deprecation warning. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 02d4328c33455742d01e0b62395013e95293c3ba.1566847960.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-08-28audio: fix invalid malloc size in audio_create_pdosKővágó, Zoltán1-1/+1
The code used sizeof(AudiodevAlsaPerDirectionOptions) instead of the appropriate per direction options for the audio backend. If the size of the actual audiodev's per direction options are larger than alsa's, it could cause a buffer overflow. However, alsa has three fields in per direction options: a string, an uint32 and a bool. Oss has the same fields, coreaudio has a single uint32, paaudio has a string and an uint32, all other backends only use the common options, so currently no per direction options struct should be larger than alsa's. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-Id: <7808bc816ba7da8b8de8a214713444d85f7af3c6.1566847960.git.DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-08-21audio: fix memory leak reported by ASANKővágó, Zoltán1-0/+6
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: ed35e9e72aa77c9376e9c8a8f3a5443703fe6fbe.1566168923.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>