audio: Replace static functions in header file by macros, remove GCC_ATTR
Using macros instead of static functions for dolog and for ldebugsimplifies 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...
Remove OSS support for OpenBSD
Remove the OSS support for OpenBSD. The OSS API has not been usablefor 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>...
remove some double-includes
Some source files #include the same header more thanonce for no good reason. Remove second #includes insuch cases.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
audio: Replace non-portable asprintf in debug code by g_strdup_printf
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>
softmmu: move include files to include/sysemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
misc: move include files to include/qemu/
monitor: move include files to include/monitor/
janitor: do not include qemu-char everywhere
Touching char/char.h basically causes the whole of QEMU tobe rebuilt. Avoid this, it is usually unnecessary.
janitor: do not rely on indirect inclusions of or from qemu-char.h
Various header files rely on qemu-char.h including qemu-config.h ormain-loop.h, but they really do not need qemu-char.h at all (particularlyinteresting is the case of the block layer!). Clean this up, and also...
build: move rules from Makefile to */Makefile.objs
Revert "audio/wavcapture: Clarify licensing"
This reverts commit 456a84d156a7c42f18b1da176dd6219e2dffd043.
This patch wasn't submitted to the list and did not get Acked by othercopyright holders in the file.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Revert "audio/audio_pt_int: Clarify licensing"
This reverts commit 72bc6f1bf710e205f175af9b1fc8bbd83e8da71f.
audio/audio_pt_int: Clarify licensing
Signed-off-by: malc <av1474@comtv.ru>
audio/wavcapture: Clarify licensing
audio: Fix warning from static code analysis
smatch report:audio/audio_template.h:416 AUD_open_out(18) warn: variable dereferenced before check 'as' (see line 414)
Moving the ldebug statement after the statement which checks 'as'fixes that warning.
Signed-off-by: Stefan Weil <sw@weilnetz.de>...
audio/winwave: previous audio buffer should be flushed
Winwave audio backend has problem with pausing and restart audio out.Unlike other backends, Winwave pausing API does not flush audio buffer.As a result, the previous audio data are played in front of...
audio: Unbreak capturing in mixemu case
audio/winwave: Fix typo
build: move audio/ objects to nested Makefile.objs
audio: Always call fini on exit
Not only clean up enabled voices but any registered one. Backends likepulsaudio rely on unconditional fini handler invocations.
This fixes "Memory pool destroyed but not all memory blocks freed!" warnings on VM shutdowns when pa is used and lockups of QEMU on shutdown...
audio: split IN_T into two separate constants
Split IN_T into BSIZE and ITYPE, to avoid expansion if the OS hasdefined macros for the intX_t and uintX_t types. The IN_T constant isthen defined in mixeng_template.h so it can be used by thefunctions/macros on this header file....
fix build with pulseaudio versions older than 0.9.11
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: malc <av1474@comtv.ru>
fix paaudio.c warnings
audio/spice: add support for volume control
Use Spice server volume control API when available.
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>Signed-off-by: malc <av1474@comtv.ru>
Do not use pa_simple PulseAudio API
Unfortunately, pa_simple is a limited API which doesn't let usretrieve the associated pa_stream. It is needed to control the volumeof the stream.
In v4:- add missing braces
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>...
Allow controlling volume with PulseAudio backend
audio: add VOICE_VOLUME ctl
Add a new PCM control operation to update the stream volume on theaudio backend. The argument given is a SWVoiceOut/SWVoiceIn.
v4:- verified other backends didn't fail/assert on this new control they randomly return 0 or -1, but we ignore return value....
audio: don't apply volume effect if backend has VOICE_VOLUME_CAP
If the audio backend is capable of volume control, don't applysoftware volume (mixeng_volume ()), but instead, rely on backendvolume control. This will allow guest to have full range volume...
audio: Add some fall through comments
Static code analysers expect these comments for case statements withouta break statement.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: malc <av1474@comtv.ru>
Fix spelling in comments, documentation and messages
accidently->accidentallyannother->anotherchoosen->chosenconsideres->considersdecriptor->descriptordevelopement->developmentparamter->parameterpreceed->precedepreceeding->precedingpriviledge->privilege...
fmodaudio: Remove unused variable 'bits16' (reported by cppcheck)
The variable is assigned a value which is never used,so remove variable and assignment.
Merge remote-tracking branch 'qmp/queue/qmp' into staging
wavaudio: Use stdio instead of QEMUFile
QEMUFile * is only intended for migration nowadays. Using it foranything else just adds pain and a layer of buffers for no goodreason.
Signed-off-by: Juan Quintela <quintela@redhat.com>CC: malc <av1474@comtv.ru>...
wavcapture: Use stdio instead of QEMUFile
Replace the VMSTOP macros with a proper state type
Today, when notifying a VM state change with vm_state_notify(),we pass a VMSTOP macro as the 'reason' argument. This is not idealbecause the VMSTOP macros tell why qemu stopped and not exactlywhat the current VM state is....
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
coreaudio: Fix OSStatus format specifier
OSStatus type is defined as SInt32. That's signed int on LP64 andsigned long otherwise.Since it is an explicit 32-bit-width type, cast to corresponsing POSIX typeand use PRId32 format specifier. This avoids a warning on ppc64....
coreaudio: Avoid formatting UInt32 type
coreaudioVoiceOut's audioDevicePropertyBufferFrameSize is defined as UInt32and is being used by reference for AudioDevice{Get,Set}Property().UInt32 is unsigned int on LP64 but unsigned long otherwise.
Cast to POSIX type and use PRIu32 format specifier to hide the details....
Fix compilation warning due to incorrectly specified type
In audio/coreaudio.c, a variable named "str" was assigned "const char" values,which resulted in the following warnings:
-----8<-----audio/coreaudio.c: In function ‘coreaudio_logstatus’:audio/coreaudio.c:59: warning: initialization discards qualifiers from pointer target type...
Fix compilation warning due to missing header for sigaction (followup)
This patch removes all references to signal.h when qemu-common.h is includedas 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 expression
Fix an integer overflow that can happen for signed 32 bit typeswhen using FLOAT_MIXENG. (Note that at the moment this is only truewhen using the MacOSX coreaudio audio driver.)
Signed-off-by: Juha Riihim?ki <juha.riihimaki@nokia.com>...
Fix trivial "endianness bugs"
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 accessors
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\>' )...
pulseaudio: tweak config
Zap unused divisor field.Raise the buffer size default.
pulseaudio: setup buffer attrs
Request reasonable buffer sizes from pulseaudio. Without thispa_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>...
pulseaudio: process 1/4 buffer max at once
Limit the size of data pieces processed by the pulseaudio workerthreads. Never ever process more than 1/4 of the buffer at once.
Background: The buffer area currently processed by the pulseaudio threadis blocked, i.e. the main thread (or iothread) can't fill in more data...
audio: split sample conversion and volume mixing
Refactor the volume mixing, so it can be reused for capturing devices.Additionally, it removes superfluous multiplications with the nominalvolume within the hardware voice code path.
Signed-off-by: Michael Walle <michael@walle.cc>...
alsaaudio: add endianness support for VoiceIn
Signed-off-by: Michael Walle <michael@walle.cc>Signed-off-by: malc <av1474@comtv.ru>
ossaudio: add endianness support for VoiceIn
noaudio: correctly account acquired samples
This will fix the return value of the function which otherwise returns toomany samples because sw->total_hw_samples_acquired isn't correctlyaccounted.
noaudio: fix return value for read()
Read should return bytes instead of samples.
audio: Use GCC_FMT_ATTR (format checking)
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 necessary
Originally proposed by Gerd Hoffmann.
Signed-off-by: malc <av1474@comtv.ru>Acked-by: Gerd Hoffmann <kraxel@redhat.com>
add copyright to spiceaudio
spice: add audio
Add support for the spice audio interface. With this patch appliedaudio can be forwarded over the network from/to the spice client. Bothrecording and playback is supported.
The driver is first in the driver list, but the can_be_default flag is...
issue snd_pcm_start() when capturing audio
snd_pcm_start() starts the capture process and ensures that the eventsare delivered to the poll handler. Without the call, capture can be startedonly when there is simultaneous playback running.
Signed-off-by: Jindrich Makovicka <makovick@gmail.com>...
fix 100% CPU load when idle with ALSA
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)
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)
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))...
pulse-audio: fix bug on updating rpos
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()...
audio: Fix memory size for resampling buffer in DAC case
Move macros GCC_ATTR and GCC_FMT_ATTR to common header file
By moving the definition of GCC_ATTR and GCC_FMT_ATTRfrom audio_int.h to qemu-common.h these macros arenow generally available for further patches which addthe gcc format attribute.
Newer gcc versions support format gnu_printf which is...
audio/sdl: return on error
audio/sdl: be more anal about errors
audio: make audio_pt_init block all signals
savevm: Add DeviceState param
When available, we'd like to be able to access the DeviceStatewhen registering a savevm. For buses with a get_dev_path()function, this will allow us to create more unique savevmid strings.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>...
Fix %lld or %llx printf format use
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
audio/sdlaudio: remove unused variable
Remove unused 'shift' variable spotted by clang.Also clean up aud_to_sdlfmt which used to get the valueof 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 mixup
Spotted by Serge Ziryukin and based on his patch, thanks.
monitor: Separate "default monitor" and "current monitor" cleanly
Commits 376253ec..731b0364 introduced global variable cur_mon, whichpoints to the "default monitor" (if any), except during execution ofmonitor_read() or monitor_control_read() it points to the monitor from...
audio: fix comment
audio/alsa: Handle SND_PCM_STATE_SETUP in alsa_poll_handler
audio/alsa: Spelling typo (paramters)
Trivial patch to fix the spelling of "parameters".
audio: include more information into audio_bug's output
Revert "sdlaudio: make it suck less"
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 enoughto report, so thank you:...
Workaround for broken OSS_GETVERSION on FreeBSD, part two
Turns out on those versions of FreeBSD (>= 7.x) that know OSS_GETVERSIONthe ioctl doesn't actually work yet (except in the Linuxolator), so ifbuilding on FreeBSD assume the sound drivers are new enough if the ioctl...
oss: fix fragment setting
Previous patch introduced subtle regression, in cases whenOSS_GETVERSION fails the code wasn't falling back toSNDCTL_DSP_SETFRAGMENT.
oss: issue OSS_GETVERSION ioctl only when needed
oss: refactor code around policy setting
This fixes a problem with a previous patch spotted by Juergen Lock,thanks to him again.
oss: workaround for cases when OSS_GETVERSION is not defined
Thanks to Juergen Lock.
audio: fix compilation of DEBUG_PLIVE
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
audio: port to vmstate
audio: Remove conditional around sw which can not be NULL
Noticed by Steve Grubb.
winwave: ADC support
audio: remove last remnants of _t
winwave: make error logging more consistent
winwave: follow the rules when closing the output device
a. call waveOutReset to drain the queueb. unprepare headers before freeing underlying memory
qemu: allow pulseaudio to be the default
We're seeing various issues with the SDL audio backend and want toswitch to the pulseaudio backend. See e.g.
https://bugzilla.redhat.com/495964 https://bugzilla.redhat.com/519540 https://bugzilla.redhat.com/496627...
winwave: pause/restore playing upon seeing VOICE_DISABLE/ENABLE
winwave: close event handle and delete wait object after closing HWAVEOUT
To avoid possibly being called back and thus racing.
winwave: remove wait object when finalizing DAC voice
winwave: poll mode
Windows Waveform Audio driver (no ADC support yet)
oss/alsa: Do not invoke UB described in 7.15.1.1 (this time for ADC)
alsa: Change default buffer/period size
Increase buffer size but do not rely on ALSA picking up default periodsize.
oss/alsa: Do not invoke UB described in 7.15.1.1
Additional argument (whether to try poll mode) is only passed withVOICE_ENABLE command.
Thanks to Markus Armbruster for noticing the potential breakage.
sdlaudio: make it suck less
sdlaudio: use correct function names in sdl_XXX calls
audio: internal API change
pcm_ops.run_out now takes number of live samples (which will be alwaysgreater than zero) as a second argument, every driver was callingaudio_pcm_hw_get_live_out anyway with exception of fmod which usedaudio_pcm_hw_get_live_out2 for no good reason....
audio: use correct email address