summaryrefslogtreecommitdiffstats
path: root/audio
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix compilation warning due to missing header for sigaction (followup)Alexandre Raymond2011-06-082-3/+0
| | | | | | | | This patch removes all references to signal.h when qemu-common.h is included as they become redundant. Signed-off-by: Alexandre Raymond <cerbere@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* audio: fix integer overflow expressionJuha Riihim?ki2011-06-011-2/+2
| | | | | | | | | | | Fix an integer overflow that can happen for signed 32 bit types when using FLOAT_MIXENG. (Note that at the moment this is only true when using the MacOSX coreaudio audio driver.) Signed-off-by: Juha Riihim?ki <juha.riihimaki@nokia.com> [Peter Maydell: Removed unnecessary casts] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: malc <av1474@comtv.ru>
* Fix trivial "endianness bugs"Stefan Weil2011-04-031-10/+10
| | | | | | | Replace endianess -> endianness. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* change all other clock references to use nanosecond resolution accessorsPaolo Bonzini2011-03-214-7/+7
| | | | | | | | | | | | | | | | | | | | | | This was done with: sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' ) after checking that get_clock and new_timer never occur twice on the same line. There were no missed occurrences; however, even if there had been, they would have been caught by the compiler. There was exactly one false positive in qemu_run_timers: - current_time = qemu_get_clock (clock); + current_time = qemu_get_clock_ns (clock); which is of course not in this patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* pulseaudio: tweak configGerd Hoffmann2011-01-251-9/+1
| | | | | | | | Zap unused divisor field. Raise the buffer size default. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* pulseaudio: setup buffer attrsGerd Hoffmann2011-01-251-1/+11
| | | | | | | | | Request reasonable buffer sizes from pulseaudio. Without this pa_simple_write() can block quite long and lead to dropouts, especially with guests which use small audio ring buffers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* pulseaudio: process 1/4 buffer max at onceGerd Hoffmann2011-01-251-13/+9
| | | | | | | | | | | | | | | | | | | | | | | Limit the size of data pieces processed by the pulseaudio worker threads. Never ever process more than 1/4 of the buffer at once. Background: The buffer area currently processed by the pulseaudio thread is blocked, i.e. the main thread (or iothread) can't fill in more data there. The buffer processing time is roughly real-time due to the pa_simple_write() call blocking when the output queue to the pulse server is full. Thus processing big chunks at once means blocking a large part of the buffer for a long time. This brings high latency and can lead to dropouts. When processing the buffer in smaller chunks the rpos handling becomes a problem though. The thread reads hw->rpos without knowing whenever qpa_run_out has already seen the last (small) chunk processed and updated rpos accordingly. There is no point in reading hw->rpos though, pa->rpos can be used instead. We just need to take care to initialize pa->rpos before kicking the thread. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* audio: split sample conversion and volume mixingMichael Walle2011-01-1213-55/+52
| | | | | | | | | Refactor the volume mixing, so it can be reused for capturing devices. Additionally, it removes superfluous multiplications with the nominal volume within the hardware voice code path. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: malc <av1474@comtv.ru>
* alsaaudio: add endianness support for VoiceInMichael Walle2011-01-091-7/+27
| | | | | Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: malc <av1474@comtv.ru>
* ossaudio: add endianness support for VoiceInMichael Walle2011-01-091-5/+15
| | | | | Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: malc <av1474@comtv.ru>
* noaudio: correctly account acquired samplesMichael Walle2011-01-041-0/+3
| | | | | | | | | This will fix the return value of the function which otherwise returns too many samples because sw->total_hw_samples_acquired isn't correctly accounted. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: malc <av1474@comtv.ru>
* noaudio: fix return value for read()Michael Walle2010-12-101-1/+1
| | | | | | | Read should return bytes instead of samples. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: malc <av1474@comtv.ru>
* audio: Use GCC_FMT_ATTR (format checking)Stefan Weil2010-12-041-1/+2
| | | | | | Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* audio: Only use audio timer when necessarymalc2010-11-181-14/+10
| | | | | | | Originally proposed by Gerd Hoffmann. Signed-off-by: malc <av1474@comtv.ru> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* add copyright to spiceaudioGerd Hoffmann2010-11-111-0/+19
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* spice: add audioGerd Hoffmann2010-11-093-0/+331
| | | | | | | | | | | | | | | | | | | Add support for the spice audio interface. With this patch applied audio can be forwarded over the network from/to the spice client. Both recording and playback is supported. The driver is first in the driver list, but the can_be_default flag is set only in case spice is active. So if you have the spice protocol enabled the spice audio driver is the default one, otherwise whatever comes first after spice in the list. Overriding the default using QEMU_AUDIO_DRV works in any case. [ v2: audio codestyle: add spaces before open parenthesis ] [ v2: add const to silence array ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Cc: malc <av1474@comtv.ru> Signed-off-by: malc <av1474@comtv.ru>
* issue snd_pcm_start() when capturing audioJindrich Makovicka2010-10-181-6/+17
| | | | | | | | | snd_pcm_start() starts the capture process and ensures that the events are delivered to the poll handler. Without the call, capture can be started only when there is simultaneous playback running. Signed-off-by: Jindrich Makovicka <makovick@gmail.com> Signed-off-by: malc <av1474@comtv.ru>
* fix 100% CPU load when idle with ALSAJindrich Makovicka2010-10-181-0/+4
| | | | | | | | Playback control function did not disable polling when playback stops. Caused busy spinning of the main loop due to unprocessed events. Signed-off-by: Jindrich Makovicka <makovick@gmail.com> Signed-off-by: malc <av1474@comtv.ru>
* Use GCC_FMT_ATTR (format checking)Stefan Weil2010-10-031-1/+1
| | | | | Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Replace most gcc format attributes by macro GCC_FMT_ATTR (format checking)Stefan Weil2010-10-031-5/+1
| | | | | | | | | | | | | | | | | Since version 4.4.x, gcc supports additional format attributes. __attribute__ ((format (gnu_printf, 1, 2))) should be used instead of __attribute__ ((format (printf, 1, 2)) because QEMU always uses standard format strings (even with mingw32). The patch replaces format attribute printf / __printf__ by macro GCC_FMT_ATTR which uses gnu_printf if supported. It also removes an #ifdef __GNUC__ (not needed any longer). Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pulse-audio: fix bug on updating rposWu Fengguang2010-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a rpos coordination bug between qpa_run_out() and qpa_thread_out(), which shows up as playback noises. qpa_run_out() qpa_thread_out loop N critical section 1 qpa_run_out() qpa_thread_out loop N doing pa_simple_write() qpa_run_out() qpa_thread_out loop N doing pa_simple_write() qpa_thread_out loop N critical section 2 qpa_thread_out loop N+1 critical section 1 qpa_run_out() qpa_thread_out loop N+1 doing pa_simple_write() In the above scheme, "qpa_thread_out loop N+1 critical section 1" will get the same rpos as the one used by "qpa_thread_out loop N critical section 1". So it will be reading dead samples from the old rpos. The rpos can only be updated back to qpa_thread_out when there is a qpa_run_out() run between two qpa_thread_out loops. normal sequence: qpa_thread_out: hw->rpos (X0) => local rpos => pa->rpos (X1) qpa_run_out: pa->rpos (X1) => hw->rpos (X1) qpa_thread_out: hw->rpos (X1) => local rpos => pa->rpos (X2) buggy sequence: qpa_thread_out: hw->rpos (X0) => local rpos => pa->rpos (X1) qpa_thread_out: hw->rpos (X0) => local rpos => pa->rpos (X1') Obviously qpa_run_out() shall be called at least once between any two qpa_thread_out loops (after pa->rpos is set), in order for the new qpa_thread_out loop to see the updated rpos. Setting pa->live to 0 does the trick. The next loop will have to wait for one qpa_run_out() invocation in order to get a non-zero pa->live and proceed. Signed-off-by: malc <av1474@comtv.ru> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
* audio: Fix memory size for resampling buffer in DAC casemalc2010-09-281-4/+0
| | | | Signed-off-by: malc <av1474@comtv.ru>
* Move macros GCC_ATTR and GCC_FMT_ATTR to common header fileStefan Weil2010-09-221-8/+0
| | | | | | | | | | | | | | | | | By moving the definition of GCC_ATTR and GCC_FMT_ATTR from audio_int.h to qemu-common.h these macros are now generally available for further patches which add the gcc format attribute. Newer gcc versions support format gnu_printf which is better suited for use in QEMU than format printf (QEMU always uses standard format strings (even with mingw32)). V2: Use correct operator '==' (instead of '=') Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* audio/sdl: return on errormalc2010-08-071-0/+1
| | | | Signed-off-by: malc <av1474@comtv.ru>
* audio/sdl: be more anal about errorsmalc2010-08-061-3/+18
| | | | Signed-off-by: malc <av1474@comtv.ru>
* audio: make audio_pt_init block all signalsmalc2010-08-062-52/+31
| | | | Signed-off-by: malc <av1474@comtv.ru>
* savevm: Add DeviceState paramAlex Williamson2010-07-061-1/+1
| | | | | | | | | | When available, we'd like to be able to access the DeviceState when registering a savevm. For buses with a get_dev_path() function, this will allow us to create more unique savevm id strings. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix %lld or %llx printf format useBlue Swirl2010-05-221-1/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* audio/sdlaudio: remove unused variableSerge Ziryukin2010-04-221-9/+2
| | | | | | | | | Remove unused 'shift' variable spotted by clang. Also clean up aud_to_sdlfmt which used to get the value of shift. Signed-off-by: Serge Ziryukin <ftrvxmtrx@gmail.com> Signed-off-by: malc <av1474@comtv.ru>
* audio/alsa: Avoid snd_pcm_format_t vs audfmt_e mixupmalc2010-04-211-5/+6
| | | | | | Spotted by Serge Ziryukin and based on his patch, thanks. Signed-off-by: malc <av1474@comtv.ru>
* monitor: Separate "default monitor" and "current monitor" cleanlyMarkus Armbruster2010-03-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commits 376253ec..731b0364 introduced global variable cur_mon, which points to the "default monitor" (if any), except during execution of monitor_read() or monitor_control_read() it points to the monitor from which we're reading instead (the "current monitor"). Monitor command handlers run within monitor_read() or monitor_control_read(). Default monitor and current monitor are really separate things, and squashing them together is confusing and error-prone. For instance, usb_host_scan() can run both in "info usbhost" and periodically via usb_host_auto_check(). It prints to cur_mon, which is what we want in the former case: the monitor executing "info usbhost". But since that's the default monitor in the latter case, it periodically spams the default monitor there. A few places use cur_mon to log stuff to the default monitor. If we ever log something while cur_mon points to current monitor instead of default monitor, the log temporarily "jumps" to another monitor. Whether that can or cannot happen isn't always obvious. Maybe logging to the default monitor (which may not even exist) is a bad idea, and we should log to stderr or a logfile instead. But that's outside the scope of this commit. Change cur_mon to point to the current monitor. Create new default_mon to point to the default monitor. Update users of cur_mon accordingly. This fixes the periodical spamming of the default monitor by usb_host_scan(). It also stops "log jumping", should that problem exist.
* audio: fix commentmalc2010-03-111-1/+1
| | | | Signed-off-by: malc <av1474@comtv.ru>
* audio/alsa: Handle SND_PCM_STATE_SETUP in alsa_poll_handlermalc2010-02-281-0/+4
| | | | Signed-off-by: malc <av1474@comtv.ru>
* audio/alsa: Spelling typo (paramters)Vagrant Cascadian2010-02-281-1/+1
| | | | | | Trivial patch to fix the spelling of "parameters". Signed-off-by: malc <av1474@comtv.ru>
* audio: include more information into audio_bug's outputmalc2010-01-171-0/+9
| | | | Signed-off-by: malc <av1474@comtv.ru>
* Revert "sdlaudio: make it suck less"malc2010-01-171-30/+50
| | | | | | | | | | | | | | | | | This reverts commit 4839abe78fd466a3cf06faa7c362154afd5404f1. The commit was badly broken, Gentoo has sdl as the default driver, consequently 5 gentoo users have hit the breakage and were kind enough to report, so thank you: Claes Gyllenswrd vekin Chris But above all thanks to Toralf Foerster who actually provied enough information to pinpoint the breakage to sdlaudio. http://bugs.gentoo.org/show_bug.cgi?id=294269
* Workaround for broken OSS_GETVERSION on FreeBSD, part twoJuergen Lock2010-01-131-4/+26
| | | | | | | | | | | | | Turns out on those versions of FreeBSD (>= 7.x) that know OSS_GETVERSION the ioctl doesn't actually work yet (except in the Linuxolator), so if building on FreeBSD assume the sound drivers are new enough if the ioctl returns the errno it does currently on FreeBSD. (Rev 2 after private discussion with malc.) Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> Signed-off-by: malc <av1474@comtv.ru>
* oss: fix fragment settingmalc2010-01-091-13/+16
| | | | | | | | Previous patch introduced subtle regression, in cases when OSS_GETVERSION fails the code wasn't falling back to SNDCTL_DSP_SETFRAGMENT. Signed-off-by: malc <av1474@comtv.ru>
* oss: issue OSS_GETVERSION ioctl only when neededmalc2010-01-091-17/+17
| | | | Signed-off-by: malc <av1474@comtv.ru>
* oss: refactor code around policy settingmalc2010-01-091-12/+8
| | | | | | | This fixes a problem with a previous patch spotted by Juergen Lock, thanks to him again. Signed-off-by: malc <av1474@comtv.ru>
* oss: workaround for cases when OSS_GETVERSION is not definedmalc2010-01-081-1/+12
| | | | | | Thanks to Juergen Lock. Signed-off-by: malc <av1474@comtv.ru>
* audio: port to vmstateJuan Quintela2009-12-031-17/+9
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* audio: fix compilation of DEBUG_PLIVEJuan Quintela2009-12-031-3/+3
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* audio: Remove conditional around sw which can not be NULLmalc2009-11-181-17/+15
| | | | | | Noticed by Steve Grubb. Signed-off-by: malc <av1474@comtv.ru>
* winwave: ADC supportmalc2009-10-151-24/+336
| | | | Signed-off-by: malc <av1474@comtv.ru>
* audio: remove last remnants of _tmalc2009-10-153-5/+5
| | | | Signed-off-by: malc <av1474@comtv.ru>
* winwave: make error logging more consistentmalc2009-10-151-6/+7
| | | | Signed-off-by: malc <av1474@comtv.ru>
* winwave: follow the rules when closing the output devicemalc2009-10-151-0/+19
| | | | | | | a. call waveOutReset to drain the queue b. unprepare headers before freeing underlying memory Signed-off-by: malc <av1474@comtv.ru>
* qemu: allow pulseaudio to be the defaultMichael S. Tsirkin2009-10-131-1/+1
| | | | | | | | | | | | | | | | We're seeing various issues with the SDL audio backend and want to switch to the pulseaudio backend. See e.g. https://bugzilla.redhat.com/495964 https://bugzilla.redhat.com/519540 https://bugzilla.redhat.com/496627 The pulseaudio backend seems to work well, so we should allow it to be selected as the default. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* winwave: pause/restore playing upon seeing VOICE_DISABLE/ENABLEmalc2009-10-111-0/+18
| | | | Signed-off-by: malc <av1474@comtv.ru>
OpenPOWER on IntegriCloud