summaryrefslogtreecommitdiffstats
path: root/audio/ossaudio.c
Commit message (Collapse)AuthorAgeFilesLines
* audio: Clean up includesPeter Maydell2019-11-291-2/+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>
* ossaudio: fix memory leakGonglei2015-07-081-0/+1
| | | | | | | | | Variable "conf" going out of scope leaks the storage it points to in line 856. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Message-Id: <1435021270-7768-1-git-send-email-arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* ossaudio: use trace events instead of debug config flagKővágó, Zoltán2015-06-151-21/+4
| | | | | Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ossaudio: do not use global variablesKővágó, Zoltán2015-06-151-49/+61
| | | | | Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* audio: expose drv_opaque to init_out and init_inKővágó, Zoltán2015-06-151-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>
* oss: Remove unused error handling of qemu_set_fd_handlerFam Zheng2015-06-121-6/+8
| | | | | | | | The function cannot fail, so the check is superfluous. Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1433400324-7358-11-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* audio: Drop superfluous conditionals around g_free()Markus Armbruster2014-06-131-4/+2
| | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ossaudio: check for oss support in oss_audio_initGerd Hoffmann2013-11-071-0/+4
| | | | | | | | | Check whenever the device path (/dev/dsp by default) exists and qemu is allowed to access it. Return NULL if it isn't, so ossaudio will not be used on systems wihtout oss support (increasinly common on modern linux systems). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Revert "ossaudio: do not enable by default"Gerd Hoffmann2013-11-071-1/+1
| | | | | | | | This reverts commit c905c5012ac0c6fde3b8094d2206a3139deddba2. There is a better fix for the issue at hand. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ossaudio: do not enable by defaultAnthony Liguori2013-11-051-1/+1
| | | | | | | | | Modern Linux's no longer support /dev/dsp so enabling it by default causes audio failures on newer Linux distros. Signed-off-by: Anthony Liguori <aliguori@amazon.com> Tested-by: Andreas Färber <afaerber@suse.de> Message-id: 1383497154-9271-1-git-send-email-aliguori@amazon.com
* Remove OSS support for OpenBSDBrad Smith2013-05-261-4/+0
| | | | | | | | | | Remove the OSS support for OpenBSD. The OSS API has not been usable for 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> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* misc: move include files to include/qemu/Paolo Bonzini2012-12-191-2/+2
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* janitor: do not include qemu-char everywherePaolo Bonzini2012-12-191-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>
* janitor: do not rely on indirect inclusions of or from qemu-char.hPaolo Bonzini2012-12-191-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>
* Use glib memory allocation and free functionsAnthony Liguori2011-08-201-2/+2
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* audio: split sample conversion and volume mixingMichael Walle2011-01-121-2/+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>
* 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>
* 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>
* oss/alsa: Do not invoke UB described in 7.15.1.1 (this time for ADC)malc2009-10-031-9/+12
| | | | Signed-off-by: malc <av1474@comtv.ru>
* oss/alsa: Do not invoke UB described in 7.15.1.1malc2009-10-021-22/+25
| | | | | | | Additional argument (whether to try poll mode) is only passed with VOICE_ENABLE command. Thanks to Markus Armbruster for noticing the potential breakage.
* audio: use correct email addressmalc2009-09-181-1/+1
| | | | Signed-off-by: malc <av1474@comtv.ru>
* audio: internal API changemalc2009-09-181-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>
* oss: use audio_pcm_hw_clip_outmalc2009-09-181-47/+46
| | | | Signed-off-by: malc <av1474@comtv.ru>
* alsa/oss: Remove fd transfer handlers before closing oss/alsa fd/handlemalc2009-09-141-2/+4
| | | | Signed-off-by: malc <av1474@comtv.ru>
* oss: Simplify mmap codemalc2009-09-131-22/+5
| | | | Signed-off-by: malc <av1474@comtv.ru>
* oss: OSS v4 supportmalc2009-09-131-9/+50
| | | | | | | a. Use SNDCTL_DSP_POLICY instead of SNDCTL_DSP_SETFRAGMENT b. Add ability to open device in exclusive mode, thus bypassing vmix Signed-off-by: malc <av1474@comtv.ru>
* audio: remove lsbindex/popcount in favour of host-utils's ctz32malc2009-09-121-1/+2
| | | | Signed-off-by: malc <av1474@comtv.ru>
* oss: poll mode handlingmalc2009-09-121-5/+74
| | | | Signed-off-by: malc <av1474@comtv.ru>
* oss: Unbreak mmaping the ability to mmap oss fd on Linuxmalc2009-09-121-1/+4
| | | | Signed-off-by: malc <av1474@comtv.ru>
* Aestheticsmalc2009-08-111-28/+38
| | | | | | | Reformat to make item borders more visible Fix cases of stray tabs and vertical misalignments Signed-off-by: malc <av1474@comtv.ru>
* use C99 initializers for all audio/*Juan Quintela2009-08-111-2/+4
| | | | Signed-off-by: Juan Quintela <quintela@redhat.com>
* use C99 initializers for audio_pcm_opsJuan Quintela2009-08-111-11/+11
| | | | Signed-off-by: Juan Quintela <quintela@redhat.com>
* Use C99 initializers for audio_optionJuan Quintela2009-08-111-13/+25
| | | | Signed-off-by: Juan Quintela <quintela@redhat.com>
* Use proper struct initializers and remove INIT_FIELD() macroJuan Quintela2009-08-111-11/+11
| | | | Signed-off-by: Juan Quintela <quintela@redhat.com>
* Fix Sparse warnings: "Using plain integer as NULL pointer"Blue Swirl2009-07-311-1/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Make audio violate POSIX lessmalc2008-12-031-5/+5
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5864 c046a42c-6fe2-441c-8c8c-71466251a162
* Prepare for changing audio_pcm_ops dynamically (partially revert r5422)blueswir12008-10-061-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5435 c046a42c-6fe2-441c-8c8c-71466251a162
* Make audio_pcm_opsstatic constblueswir12008-10-051-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5422 c046a42c-6fe2-441c-8c8c-71466251a162
* Add NULL argument to SNDCTL_DSP_NONBLOCK ioctl callmalc2008-07-021-1/+1
| | | | | | | | | | Comes from here: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/emulators/qemu/patches/patch-am?rev=1.2&content-type=text/x-cvsweb-markup http://manuals.opensound.com/developer/SNDCTL_DSP_NONBLOCK.html No explanation for NULL given. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4825 c046a42c-6fe2-441c-8c8c-71466251a162
* Check the returned audio_buf_info fieldsmalc2008-06-081-0/+6
| | | | | | | | | | At least on one system zero is returned in either fragsize or fragstotal (reported by Dave Scott), this results in an audio_calloc failing the audio_bug check and another ominous error message. Fail early and blame the system. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4699 c046a42c-6fe2-441c-8c8c-71466251a162
* pthreads-based audio and miscellaneous audio clean-up (malc).balrog2008-01-141-1/+1
| | | | | | | ESD support (malc, Frederick Reeve). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3917 c046a42c-6fe2-441c-8c8c-71466251a162
* Break up vl.h.pbrook2007-11-171-1/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
* audio/ossaudio.c for OpenBSD, by Todd T. Fries.ths2007-04-021-0/+5
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2583 c046a42c-6fe2-441c-8c8c-71466251a162
* audio endianness API changes (malc)bellard2006-07-041-10/+4
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2042 c046a42c-6fe2-441c-8c8c-71466251a162
* audio fixes + initial audio capture support (malc)bellard2006-07-041-7/+19
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2040 c046a42c-6fe2-441c-8c8c-71466251a162
* audio merge (malc)bellard2005-11-201-2/+6
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1636 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud