summaryrefslogtreecommitdiff
path: root/audio/sdlaudio.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
2018-02-06audio: Replace AUDIO_FUNC with __func__Alistair Francis1-1/+1
Apparently we don't use __MSC_VER as a compiler anymore and we always require a C99 compiler (which means we always have __func__) so we don't need a special AUDIO_FUNC macro. We can just replace AUDIO_FUNC with __func__ instead. Checkpatch failures were manually fixed. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180203084315.20497-2-armbru@redhat.com>
2017-03-01audio/sdlaudio: Allow audio playback with SDL2Thomas Huth1-0/+48
When compiling with SDL2, the semaphore trick used in sdlaudio.c does not work - QEMU locks up completely in this case. To avoid the hang and get at least some audio playback up and running (it's a little bit crackling, but better than nothing), we can use the SDL locking functions SDL_LockAudio() and SDL_UnlockAudio() to sync with the sound playback thread instead. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-id: 1485852398-2327-1-git-send-email-thuth@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-02-02audio: Clean up includesPeter Maydell1-0/+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-06-15sdlaudio: do not allow multiple instancesKővágó, Zoltán1-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>
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-08Fix compilation warning due to missing header for sigaction (followup)Alexandre Raymond1-1/+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>
2011-04-03Fix trivial "endianness bugs"Stefan Weil1-10/+10
Replace endianess -> endianness. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-08-07audio/sdl: return on errormalc1-0/+1
Signed-off-by: malc <av1474@comtv.ru>
2010-08-06audio/sdl: be more anal about errorsmalc1-3/+18
Signed-off-by: malc <av1474@comtv.ru>
2010-04-22audio/sdlaudio: remove unused variableSerge Ziryukin1-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>
2010-01-17Revert "sdlaudio: make it suck less"malc1-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
2009-09-30sdlaudio: make it suck lessmalc1-50/+30
Signed-off-by: malc <av1474@comtv.ru>
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-09-18sdlaudio: use correct function names in sdl_XXX callsmalc1-3/+3
Signed-off-by: malc <av1474@comtv.ru>
2009-08-11Aestheticsmalc1-4/+6
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 all audio/*Juan Quintela1-1/+1
Signed-off-by: Juan Quintela <quintela@redhat.com>
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-3/+5
Signed-off-by: Juan Quintela <quintela@redhat.com>
2009-08-11Use proper struct initializers and remove INIT_FIELD() macroJuan Quintela1-11/+11
Signed-off-by: Juan Quintela <quintela@redhat.com>
2009-07-31Fix Sparse warnings: "Using plain integer as NULL pointer"Blue Swirl1-1/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-03-07Support for DragonFly BSD (Hasso Tepper)blueswir11-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6746 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-03Make audio violate POSIX lessmalc1-3/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5864 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-26Fix undeclared symbol warnings from sparseblueswir11-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5539 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-26Fix undefined pthread_sigmask warning on FreeBSD (Juergen Lock)blueswir11-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5537 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-25Fix undefined pthread_sigmask warning on OpenBSDblueswir11-0/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5530 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-17Break up vl.h.pbrook1-1/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
2007-07-11Ensure signals are properly masked for new SDL Audio threads, by Andrzejths1-0/+18
Zaborowski. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3069 c046a42c-6fe2-441c-8c8c-71466251a162
2006-07-04audio endianness API changes (malc)bellard1-5/+2
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-1/+0
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2040 c046a42c-6fe2-441c-8c8c-71466251a162
2005-11-05audio merge (malc)bellard1-14/+12
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-110/+217
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1584 c046a42c-6fe2-441c-8c8c-71466251a162
2005-04-26debug fixbellard1-2/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1398 c046a42c-6fe2-441c-8c8c-71466251a162
2004-11-14win32/SDL build fixesbellard1-2/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1144 c046a42c-6fe2-441c-8c8c-71466251a162
2004-11-09audio clean up (initial patch by malc)bellard1-3/+12
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1131 c046a42c-6fe2-441c-8c8c-71466251a162
2004-11-07audio merge (malc)bellard1-0/+323
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1125 c046a42c-6fe2-441c-8c8c-71466251a162