summaryrefslogtreecommitdiff
path: root/audio/coreaudio.c
AgeCommit message (Collapse)AuthorFilesLines
2018-03-12audio: add driver registryGerd Hoffmann1-1/+7
Add registry for audio drivers, using the existing audio_driver struct. Make all drivers register themself. The old list of audio_driver struct pointers is now a list of audio driver names, specifying the priority (aka probe order) in case no driver is explicitly asked for. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20180306074053.22856-2-kraxel@redhat.com
2016-08-08audio: clean up before monitor clean upMarc-André Lureau1-10/+2
Since aa5cb7f5e, the chardevs are being cleaned up when leaving qemu, before the atexit() handlers. audio_cleanup() may use the monitor to notify of changes. For compatibility reasons, let's clean up audio before the monitor so it keeps emitting monitor events. The audio_atexit() function is made idempotent (so it can be called multiple times), and renamed to audio_cleanup(). Since coreaudio backend is using a 'isAtexit' code path, change it to check audio_is_cleaning_up() instead, so the path is taken during normal exit. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20160801112343.29082-3-marcandre.lureau@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-02-02audio: Clean up includesPeter Maydell1-1/+1
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>
2015-12-15audio/coreaudio.c: Avoid deprecated AudioDeviceAdd/RemoveIOProc APIsPeter Maydell1-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>
2015-12-15audio/coreaudio.c: Use new-in-OSX-10.6 APIs when availablePeter Maydell1-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>
2015-12-15audio/coreaudio.c: Factor out uses of AudioDeviceGet/SetPropertyPeter Maydell1-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>
2015-12-15audio/coreaudio.c: Use new-in-OSX-10.6 API for getting default voicePeter Maydell1-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>
2015-12-15audio/coreaudio.c: Factor out use of AudioHardwareGetPropertyPeter Maydell1-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>
2015-06-15coreaudio: do not use global variables where possibleKővágó, Zoltán1-19/+24
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-06-15audio: expose drv_opaque to init_out and init_inKővágó, Zoltán1-1/+2
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>
2011-06-23coreaudio: Fix OSStatus format specifierAndreas Färber1-1/+1
OSStatus type is defined as SInt32. That's signed int on __LP64__ and signed long otherwise. Since it is an explicit 32-bit-width type, cast to corresponsing POSIX type and use PRId32 format specifier. This avoids a warning on ppc64. Cc: malc <av1474@comtv.ru> Signed-off-by: Andreas Faerber <andreas.faerber@web.de> Signed-off-by: malc <av1474@comtv.ru>
2011-06-23coreaudio: Avoid formatting UInt32 typeAndreas Färber1-2/+2
coreaudioVoiceOut's audioDevicePropertyBufferFrameSize is defined as UInt32 and 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. This avoids a warning on ppc64. Cc: malc <av1474@comtv.ru> Signed-off-by: Andreas Faerber <andreas.faerber@web.de> Signed-off-by: malc <av1474@comtv.ru>
2011-06-14Fix compilation warning due to incorrectly specified typeAlexandre Raymond1-1/+1
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 audio/coreaudio.c:63: warning: assignment discards qualifiers from pointer target type (...) -----8<----- Signed-off-by: Alexandre Raymond <cerbere@gmail.com> Acked-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
2009-09-18audio: internal API changemalc1-4/+2
pcm_ops.run_out now takes number of live samples (which will be always greater than zero) as a second argument, every driver was calling audio_pcm_hw_get_live_out anyway with exception of fmod which used audio_pcm_hw_get_live_out2 for no good reason. Signed-off-by: malc <av1474@comtv.ru>
2009-08-11Aestheticsmalc1-8/+12
Reformat to make item borders more visible Fix cases of stray tabs and vertical misalignments Signed-off-by: malc <av1474@comtv.ru>
2009-08-11use C99 initializers for audio_pcm_opsJuan Quintela1-11/+5
Signed-off-by: Juan Quintela <quintela@redhat.com>
2009-08-11Use C99 initializers for audio_optionJuan Quintela1-5/+9
Signed-off-by: Juan Quintela <quintela@redhat.com>
2009-08-11Use proper struct initializers and remove INIT_FIELD() macroJuan Quintela1-12/+11
Signed-off-by: Juan Quintela <quintela@redhat.com>
2008-12-03Make audio violate POSIX lessmalc1-2/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5864 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-06Prepare for changing audio_pcm_ops dynamically (partially revert r5422)blueswir11-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5435 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-05Make audio_pcm_opsstatic constblueswir11-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5422 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-17Remove stray uses of vl.h.pbrook1-1/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3675 c046a42c-6fe2-441c-8c8c-71466251a162
2007-02-17Qemu support for S32 and U32 alsa output, by Vassili Karpov.ths1-5/+0
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2427 c046a42c-6fe2-441c-8c8c-71466251a162
2006-07-04audio endianness API changes (malc)bellard1-9/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2042 c046a42c-6fe2-441c-8c8c-71466251a162
2006-07-04audio fixes + initial audio capture support (malc)bellard1-2/+0
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2040 c046a42c-6fe2-441c-8c8c-71466251a162
2005-11-20make the number of buffers settable (malc)bellard1-1/+5
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1638 c046a42c-6fe2-441c-8c8c-71466251a162
2005-11-20workaround for atexit - buffer size API changebellard1-44/+94
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1635 c046a42c-6fe2-441c-8c8c-71466251a162
2005-11-11compile fix (malc)bellard1-1/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1616 c046a42c-6fe2-441c-8c8c-71466251a162
2005-11-05audio merge (malc)bellard1-28/+24
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1601 c046a42c-6fe2-441c-8c8c-71466251a162
2005-10-30merged 15a_aqemu.patch audio patch (malc)bellard1-0/+513
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1584 c046a42c-6fe2-441c-8c8c-71466251a162