summaryrefslogtreecommitdiffstats
path: root/audio
Commit message (Collapse)AuthorAgeFilesLines
* all: Clean up includesPeter Maydell2019-11-291-1/+0
| | | | | | | | | | Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com>
* audio: Clean up includesPeter Maydell2019-11-2914-3/+14
| | | | | | | | | | | Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1453138432-8324-1-git-send-email-peter.maydell@linaro.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio: Clean up inappropriate and unreachable use of hw_error()Markus Armbruster2019-11-291-9/+2
| | | | | | | | | | | | | | | | | | | audio_init() should not use hw_error(), because dumping CPU registers is unhelpful there, and aborting is wrong, because it can be called called from an audio device's realize() method. The two uses of hw_error() come from commit 0d9acba: * When qemu_new_timer() fails. It couldn't fail back then, and it can't fail now. Drop the unreachable error handling. * When no_audio_driver can't be initialized. It couldn't fail back then, and it can't fail now. Replace the error handling by an assertion. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Markus Armbruster <armbru@pond.sub.org> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
* audio/coreaudio.c: Avoid deprecated AudioDeviceAdd/RemoveIOProc APIsPeter Maydell2019-11-291-9/+15
| | | | | | | | | | | The AudioDeviceAddIOProc() and AudioDeviceRemoveIOProc() functions were deprecated in OSX 10.5. Since we don't support any earlier versions of OSX, we can simply replace them with the new APIs AudioDeviceCreateIOProcID() and AudioDeviceRemoveIOProcID(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1448747724-15572-6-git-send-email-peter.maydell@linaro.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio/coreaudio.c: Use new-in-OSX-10.6 APIs when availablePeter Maydell2019-11-291-1/+106
| | | | | | | | | | Use the new-in-OSX 10.6 API AudioObjectGetPropertyData() instead of the deprecated AudioDeviceGetProperty() and AudioDeviceSetProperty() functions when possible. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1448747724-15572-5-git-send-email-peter.maydell@linaro.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio/coreaudio.c: Factor out uses of AudioDeviceGet/SetPropertyPeter Maydell2019-11-291-47/+94
| | | | | | | | | | The CoreAudio APIs AudioDeviceGetProperty and AudioDeviceSetProperty are deprecated from OSX 10.6, so factor out our calls to them so we can provide versions which use the replacement APIs on OSX newer than 10.5. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1448747724-15572-4-git-send-email-peter.maydell@linaro.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio/coreaudio.c: Use new-in-OSX-10.6 API for getting default voicePeter Maydell2019-11-291-0/+27
| | | | | | | | | If we're building for OSX 10.6 or better, use the new API AudioObjectGetPropertyData for getting the default voice. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1448747724-15572-3-git-send-email-peter.maydell@linaro.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio/coreaudio.c: Factor out use of AudioHardwareGetPropertyPeter Maydell2019-11-291-6/+11
| | | | | | | | | | The CoreAudio function AudioHardwareGetProperty has been deprecated starting with OSX 10.6, so factor out our call to it so we can provide an equivalent with the new APIs when they exist. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1448747724-15572-2-git-send-email-peter.maydell@linaro.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ossaudio: fix memory leakGonglei2015-07-081-0/+1
| | | | | | | | | Variable "conf" going out of scope leaks the storage it points to in line 856. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Message-Id: <1435021270-7768-1-git-send-email-arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qerror: Move #include out of qerror.hMarkus Armbruster2015-06-222-0/+2
| | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
* ossaudio: use trace events instead of debug config flagKővágó, Zoltán2015-06-151-21/+4
| | | | | Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* alsaaudio: use trace events instead of verboseKővágó, Zoltán2015-06-151-46/+14
| | | | | Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* dsoundaudio: remove primary bufferKővágó, Zoltán2015-06-151-104/+0
| | | | | | | | | | | Enabling this option just creates a playback buffer with the specified settings, and then ignores it. It's probably some outdated hack to set audio formats on windows. (The first created stream dictates all other streams settings, at least on some Windows versions). Setting DAC_FIXED_SETTINGS should have the same effect as setting (the now removed) primary buffer. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* dsoundaudio: remove *_retries kludgesKővágó, Zoltán2015-06-152-83/+20
| | | | | | | | | | According to MSDN this may happen when the window is not in the foreground, but the default is 1 since a long time (which means no retries), so it should be ok. I've found no problems during testing it on Windows 7 and wine, so this was probably only the case with some old Windows versions. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio: remove pliveKővágó, Zoltán2015-06-152-53/+0
| | | | | | | | It was useless even 3 years ago, so it can probably safely go away: https://lists.nongnu.org/archive/html/qemu-devel/2012-03/msg02427.html Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio: remove LOG_TO_MONITOR along with default_monKővágó, Zoltán2015-06-151-20/+3
| | | | | | | | | | | | Setting QEMU_AUDIO_LOG_TO_MONITOR=1 can crash qemu (if qemu tries to log to the monitor before it's being initialized), and also nothing else in qemu logs to the monitor. This log to monitor feature was the last thing that used the default_mon variable, so I removed it too (as using it can cause problems). Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* sdlaudio: do not allow multiple instancesKővágó, Zoltán2015-06-151-0/+7
| | | | | | | | Since SDL uses a lot of global data, we can't create independent instances of sdl audio backend. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* coreaudio: do not use global variables where possibleKővágó, Zoltán2015-06-151-19/+24
| | | | | Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* dsoundaudio: do not use global variablesKővágó, Zoltán2015-06-152-50/+74
| | | | | Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* paaudio: fix possible resource leakKővágó, Zoltán2015-06-151-1/+5
| | | | | | | | qpa_audio_init did not clean up resources properly if the initialization failed. This hopefully fixes it. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* wavaudio: do not use global variablesKővágó, Zoltán2015-06-151-16/+21
| | | | | Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ossaudio: do not use global variablesKővágó, Zoltán2015-06-151-49/+61
| | | | | Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* alsaaudio: do not use global variablesKővágó, Zoltán2015-06-151-68/+82
| | | | | Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* paaudio: do not use global variablesKővágó, Zoltán2015-06-151-46/+52
| | | | | Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio: expose drv_opaque to init_out and init_inKővágó, Zoltán2015-06-1511-20/+27
| | | | | | | | | | | Currently the opaque pointer returned by audio_driver's init is only exposed to the driver's fini, but not to audio_pcm_ops. This way if someone wants to share a variable with the driver and the pcm, he must use global variables. This patch fixes it by adding a third parameter to audio_pcm_op's init_out and init_in. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio: remove winwave audio driverKővágó, Zoltán2015-06-153-719/+0
| | | | | | | DirectSound should be a superior choice on Windows. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio: remove fmod backendKővágó, Zoltán2015-06-153-688/+0
| | | | | Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio: remove esd backendKővágó, Zoltán2015-06-153-559/+0
| | | | | | | ESD is no longer developed and replaced by PulseAudio. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* oss: Remove unused error handling of qemu_set_fd_handlerFam Zheng2015-06-121-6/+8
| | | | | | | | The function cannot fail, so the check is superfluous. Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1433400324-7358-11-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* alsaaudio: Remove unused error handling of qemu_set_fd_handlerFam Zheng2015-06-121-14/+2
| | | | | | | | The function cannot fail, so the check is superfluous. Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1433400324-7358-10-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* audio: Don't free hw resources until after hw backend is stoppedPeter Maydell2014-12-221-1/+1
| | | | | | | | | | | | | | When stopping an audio voice, call the audio backend's fini method before calling audio_pcm_hw_free_resources_ rather than afterwards. This allows backends which use helper threads (like pulseaudio) to terminate those threads before the conv_buf or mix_buf are freed and avoids race conditions where the helper may access a NULL pointer or freed memory. Cc: qemu-stable@nongnu.org Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1418406239-9838-1-git-send-email-peter.maydell@linaro.org
* audio: Drop superfluous conditionals around g_free()Markus Armbruster2014-06-133-23/+10
| | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio: replace fprintf(stderr, ...) with error_report() in audioLe Tan2014-05-262-3/+2
| | | | | | | | | Replace fprintf(stderr,...) with error_report() in files audio/*. The trailing "\n"s of the @fmt argument have been removed because @fmt of error_report() should not contain newline. Signed-off-by: Le Tan <tamlokveer@gmail.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* savevm: Remove all the unneeded version_minimum_id_old (rest)Juan Quintela2014-05-141-2/+1
| | | | | | | | | | | | | | | | | | | | After previous Peter patch, they are redundant. This way we don't assign them except when needed. Once there, there were lots of case where the ".fields" indentation was wrong: .fields = (VMStateField []) { and .fields = (VMStateField []) { Change all the combinations to: .fields = (VMStateField[]){ The biggest problem (appart from aesthetics) was that checkpatch complained when we copy&pasted the code from one place to another. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
* build: convert some obj-specific CFLAGS to use new foo.o-cflags syntaxMichael Tokarev2014-05-081-1/+1
| | | | | | | | | | | Current Makefile system allows using foo.o-cflags variables to store object-specific CFLAGS. Convert some usages of old syntax (using QEMU_CFLAGS += construct) to the new syntax. Do not touch multifile modules for now, as build system isn't ready for this. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Add the ability to vary Spice playback and record rates, to facilitate Opus ↵Jeremy White2014-02-031-2/+25
| | | | | | | support. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio: adjust pulse to 100Hz wakeup rateGerd Hoffmann2013-12-091-4/+4
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio: Lower default wakeup rate to 100 times / secondHans de Goede2013-12-091-1/+1
| | | | | | | | | | This is more then plenty to keep audio card fifos filles / emptied. This drops host cpu-load for audio playback inside a linux vm from 13% to 9%. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ossaudio: check for oss support in oss_audio_initGerd Hoffmann2013-11-071-0/+4
| | | | | | | | | Check whenever the device path (/dev/dsp by default) exists and qemu is allowed to access it. Return NULL if it isn't, so ossaudio will not be used on systems wihtout oss support (increasinly common on modern linux systems). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Revert "ossaudio: do not enable by default"Gerd Hoffmann2013-11-071-1/+1
| | | | | | | | This reverts commit c905c5012ac0c6fde3b8094d2206a3139deddba2. There is a better fix for the issue at hand. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ossaudio: do not enable by defaultAnthony Liguori2013-11-051-1/+1
| | | | | | | | | Modern Linux's no longer support /dev/dsp so enabling it by default causes audio failures on newer Linux distros. Signed-off-by: Anthony Liguori <aliguori@amazon.com> Tested-by: Andreas Färber <afaerber@suse.de> Message-id: 1383497154-9271-1-git-send-email-aliguori@amazon.com
* Merge remote-tracking branch 'mjt/trivial-patches' into stagingAnthony Liguori2013-10-311-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | * mjt/trivial-patches: audio/mixeng_template.h: fix inline declaration misc: Spelling and grammar fixes in comments docs/ccid.txt: fix the typo qapi: fix documentation example .gitignore: ignore qmp-commands.txt misc: New spelling fixes in comments configure: create fsdev/ directory Message-id: 1382779887-15971-1-git-send-email-mjt@msgid.tls.msk.ru Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
| * audio/mixeng_template.h: fix inline declarationAlex Bligh2013-10-261-2/+2
| | | | | | | | | | | | | | | | Fix error: ‘inline’ is not at beginning of declaration [-Werror=old-style-declaration] Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* | audio: honor QEMU_AUDIO_TIMER_PERIOD instead of waking up every *nano* secondHans de Goede2013-10-231-1/+2
|/ | | | | | | | | | | | | | | | | Now that we no longer have MIN_REARM_TIMER_NS a bug in the audio subsys has clearly shown it self by trying to make a timer fire every nano second. Note we have a similar problem in 1.6, 1.5 and older but there MIN_REARM_TIMER_NS limits the wakeups caused by audio being active to 4000 times / second. This still causes a host cpu load of 50 % for simply playing audio, where as with this patch git master is at 13%, so we should backport this to 1.5 and 1.6 too. Note this will not apply to 1.5 and 1.6 as is. Cc: qemu-stable@nongnu.org Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio: remove CONFIG_MIXEMU configure optionBandan Das2013-09-241-6/+0
| | | | | Signed-off-by: Bandan Das <bsd@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* aio / timers: Switch entire codebase to the new timer APIAlex Bligh2013-08-224-8/+8
| | | | | | | | | | | This is an autogenerated patch using scripts/switch-timer-api. Switch the entire code base to using the new timer API. Note this patch may introduce some line length issues. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* audio: Replace static functions in header file by macros, remove GCC_ATTRStefan Weil2013-06-211-28/+3
| | | | | | | | | | | Using macros instead of static functions for dolog and for ldebug simplifies the code and can also reduce the total code size. GCC_ATTR was only used in audio_int.h, so it is now unused and the definition can be removed from compiler.h. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* Remove OSS support for OpenBSDBrad Smith2013-05-261-4/+0
| | | | | | | | | | Remove the OSS support for OpenBSD. The OSS API has not been usable for quite some time. Signed-off-by: Brad Smith <brad@comstyle.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* remove some double-includesMichael Tokarev2013-05-181-1/+0
| | | | | | | | Some source files #include the same header more than once for no good reason. Remove second #includes in such cases. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* audio: Replace non-portable asprintf in debug code by g_strdup_printfStefan Weil2013-01-161-2/+3
| | | | | | | sw->name already uses the correct g_free to free the allocated memory. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud