summaryrefslogtreecommitdiff
path: root/audio/alsaaudio.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-2/+2
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>
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-15alsaaudio: use trace events instead of verboseKővágó, Zoltán1-46/+14
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-06-15alsaaudio: do not use global variablesKővágó, Zoltán1-68/+82
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-2/+3
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>
2015-06-12alsaaudio: Remove unused error handling of qemu_set_fd_handlerFam Zheng1-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>
2014-06-13audio: Drop superfluous conditionals around g_free()Markus Armbruster1-8/+4
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-19misc: move include files to include/qemu/Paolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19janitor: do not include qemu-char everywherePaolo Bonzini1-1/+0
Touching char/char.h basically causes the whole of QEMU to be rebuilt. Avoid this, it is usually unnecessary. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19janitor: do not rely on indirect inclusions of or from qemu-char.hPaolo Bonzini1-0/+1
Various header files rely on qemu-char.h including qemu-config.h or main-loop.h, but they really do not need qemu-char.h at all (particularly interesting is the case of the block layer!). Clean this up, and also add missing inclusions of qemu-char.h itself. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2011-08-20Use glib memory allocation and free functionsAnthony Liguori1-5/+5
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-01-12audio: split sample conversion and volume mixingMichael Walle1-1/+1
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>
2011-01-09alsaaudio: add endianness support for VoiceInMichael Walle1-7/+27
Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: malc <av1474@comtv.ru>
2010-10-18issue snd_pcm_start() when capturing audioJindrich Makovicka1-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>
2010-10-18fix 100% CPU load when idle with ALSAJindrich Makovicka1-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>
2010-04-21audio/alsa: Avoid snd_pcm_format_t vs audfmt_e mixupmalc1-5/+6
Spotted by Serge Ziryukin and based on his patch, thanks. Signed-off-by: malc <av1474@comtv.ru>
2010-02-28audio/alsa: Handle SND_PCM_STATE_SETUP in alsa_poll_handlermalc1-0/+4
Signed-off-by: malc <av1474@comtv.ru>
2010-02-28audio/alsa: Spelling typo (paramters)Vagrant Cascadian1-1/+1
Trivial patch to fix the spelling of "parameters". Signed-off-by: malc <av1474@comtv.ru>
2009-10-03oss/alsa: Do not invoke UB described in 7.15.1.1 (this time for ADC)malc1-12/+15
Signed-off-by: malc <av1474@comtv.ru>
2009-10-02alsa: Change default buffer/period sizemalc1-1/+2
Increase buffer size but do not rely on ALSA picking up default period size. Signed-off-by: malc <av1474@comtv.ru>
2009-10-02oss/alsa: Do not invoke UB described in 7.15.1.1malc1-11/+14
Additional argument (whether to try poll mode) is only passed with VOICE_ENABLE command. Thanks to Markus Armbruster for noticing the potential breakage.
2009-09-18audio: internal API changemalc1-7/+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-18alsa: use audio_pcm_hw_clip_outmalc1-45/+43
Signed-off-by: malc <av1474@comtv.ru>
2009-09-14alsa: Use proper value when testing returned events in alsa_poll_handlermalc1-4/+6
Signed-off-by: malc <av1474@comtv.ru>
2009-09-14alsa/oss: Remove fd transfer handlers before closing oss/alsa fd/handlemalc1-25/+28
Signed-off-by: malc <av1474@comtv.ru>
2009-09-12alsa: poll mode handlingmalc1-21/+204
Signed-off-by: malc <av1474@comtv.ru>
2009-08-11Aestheticsmalc1-48/+67
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-2/+4
Signed-off-by: Juan Quintela <quintela@redhat.com>
2009-08-11use C99 initializers for audio_pcm_opsJuan Quintela1-11/+11
Signed-off-by: Juan Quintela <quintela@redhat.com>
2009-08-11Use C99 initializers for audio_optionJuan Quintela1-31/+45
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-30alsa: add host suspend/resume supportBjørn Mork1-2/+47
Both input and output streams may be in SND_PCM_STATE_SUSPENDED after the host is suspended and resumed, meaning "Hardware is suspended". snd_pcm_readi() and snd_pcm_writei() will return -ESTRPIPE if called while the stream is in this state. Call snd_pcm_resume() to enable audio output and capture after host resume. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: malc <av1474@comtv.ru>
2009-07-17Ignore -Waddress for alsaaudio.cmalc1-0/+4
/usr/include/alsa/pcm.h contains: #define snd_pcm_sw_params_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_sw_params_t *) alloca(snd_pcm_sw_params_sizeof()); memset(*ptr, 0, snd_pcm_sw_params_sizeof()); } while (0) The assert generates: "error: the address of 'sw_params' will always evaluate as 'true'" which combined with -Werror prevents alsaaudio.o from being built with certain versions of GCC.
2009-06-18alsa: fix warningGerd Hoffmann1-4/+6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2008-12-03Make audio violate POSIX lessmalc1-6/+6
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
2008-07-09Restore old value of buffer_sizemalc1-0/+1
This brings latency down to acceptable levels when using dmix git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4865 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-09Warn about rejected buffer/period size/time when it was specified by the usermalc1-2/+7
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4864 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-09Call proper function when trying to set period sizemalc1-2/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4863 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-03Fix typomalc1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4835 c046a42c-6fe2-441c-8c8c-71466251a162
2008-06-21Emit warning message if user supplied buffer/period size/time was rejectedmalc1-0/+16
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4773 c046a42c-6fe2-441c-8c8c-71466251a162
2008-06-21Rework period/buffer size settingmalc1-138/+52
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4768 c046a42c-6fe2-441c-8c8c-71466251a162
2008-01-14pthreads-based audio and miscellaneous audio clean-up (malc).balrog1-41/+47
ESD support (malc, Frederick Reeve). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3917 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-16Fix wrong signedness, by Andre Przywara.ths1-3/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3815 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-07-12Spelling fix, by Stuart Brady.ths1-16/+16
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3076 c046a42c-6fe2-441c-8c8c-71466251a162
2007-05-02Don't define HIGH_LATENCY for ARM, this was a workaround for an ALSA problem.balrog1-2/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2766 c046a42c-6fe2-441c-8c8c-71466251a162
2007-02-17Qemu support for S32 and U32 alsa output, by Vassili Karpov.ths1-0/+26
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2427 c046a42c-6fe2-441c-8c8c-71466251a162