summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_coreaudio.c
Commit message (Collapse)AuthorAgeFilesLines
* coreaudio: redirect IEC61937 to coreaudio_exclusiveStefano Pigozzi2014-10-231-0/+6
|
* coreaudio: use the new device selection APIStefano Pigozzi2014-10-121-15/+5
| | | | | The CoreAudio API is built around device IDs so we store the integer as string and read it back.
* audio/out: remove old thingswm42014-09-061-3/+4
| | | | | | | | Remove the unnecessary indirection through ao fields. Also fix the inverted result of AOCONTROL_HAS_TEMP_VOLUME. Hopefully the change is equivalent. But actually, it looks like the old code did it wrong.
* ao_coreaudio: report hardware latency to ao_read_dataStefano Pigozzi2014-07-031-3/+42
| | | | | Commit a6a4cd2c88 added reporting of playout latency, this commit also adds support for reporting hardware and constant audio unit latency.
* ao_coreaudio: report latency more correctlyStefano Pigozzi2014-07-021-1/+19
| | | | | | | | | | Previous code was completly wrong. This still doesn't report the device latency, but we report the buffer latency (as before the AO refactoring) and the AudioUnit's latency (this is a new 'feature'). Apparently we can also report the device actual latency and we should also calculate the actual sample rate of the audio device instead of using the nominal sample rate, but I'll leave this for a later commit.
* ao_coreaudio: move channel mapping away from utilsStefano Pigozzi2014-07-021-0/+128
| | | | | Channel mapping functions are only used in the AUHAL based coreaudio, so move them there.
* ao_coreaudio: use mpv's internal pull APIStefano Pigozzi2014-07-021-82/+9
|
* ao_coreaudio: remove useless commentsStefano Pigozzi2014-07-021-5/+3
|
* ao_coreaudio: rename init_lpcm -> init_audiounitStefano Pigozzi2014-07-021-6/+9
|
* ao_coreaudio: fill asbd with an helper functionStefano Pigozzi2014-07-021-20/+1
|
* ao_coreaudio: split control to helper functionsStefano Pigozzi2014-07-021-23/+30
|
* ao_coreaudio: remove useless call to print_asbdStefano Pigozzi2014-07-021-2/+0
|
* ao_coreaudio: move spdif code to a new AOStefano Pigozzi2014-07-021-433/+77
| | | | | | | | | | | | | | | | The mplayer1/2/mpv CoreAudio audio output historically contained both usage of AUHAL APIs (these go through the CoreAudio audio server) and the Device based APIs (used only for output of compressed formats in exclusive mode). The latter is a very unwieldy and low level API and pretty much forces us to write a lot of code for little workr. Also with the widespread of HDMI, the actual need for outputting compressed audio directly to the device is getting lower (it was very useful with S/PDIF for bandwidth constraints not allowing a number if channels transmitted in LPCM). Considering how invasive it is (uses hog/exclusive mode), the new AO (`ao_coreaudio_device`) is not going to be autoprobed but the user will have to select it.
* ao_coreaudio: remove useless codeStefano Pigozzi2014-05-101-15/+0
| | | | | This code doesn't actually makes much of a difference, and the AudioUnit mostly wants layout tags anyway.
* ao_coreaudio: don't fallback to full waveextStefano Pigozzi2014-05-101-4/+5
| | | | | | The code was falling back to the full waveext chmap_sel when less than 2 channels were detected. This new code is slightly more correct since it only fills the chmap_sel with the stereo or mono chmap in the fallback case.
* ao_coreaudio: print an error when channel mapping failsStefano Pigozzi2014-05-101-1/+5
|
* ao_coreaudio: use description-based channel layoutsStefano Pigozzi2014-05-101-12/+5
| | | | | | | | | | | | CoreAudio supports 3 kinds of layouts: bitmap based, tag based, and speaker description based (using either channel labels or positional data). Previously we tried to convert everything to bitmap based channel layouts, but it turns out description based ones are the most generic and there are built-in CoreAudio APIs to perform the conversion in this direction. Moreover description based layouts support waveext extensions (like SDL and SDR), and are easier to map to mp_chmaps.
* audio/out: make draining a separate operationwm42014-03-091-4/+1
| | | | | | | | | | | | Until now, this was always conflated with uninit. This was ugly, and also many AOs emulated this manually (or just ignored it). Make draining an explicit operation, so AOs which support it can provide it, and for all others generic code will emulate it. For ao_wasapi, we keep it simple and basically disable the internal draining implementation (maybe it should be restored later). Tested on Linux only.
* audio/out: make ao struct opaquewm42014-03-091-0/+1
| | | | | | We want to move the AO to its own thread. There's no technical reason for making the ao struct opaque to do this. But it helps us sleep at night, because we can control access to shared state better.
* msg: rename mp_msg_log -> mp_msgwm42013-12-211-1/+1
| | | | Same for companion functions.
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-171-2/+2
|
* Move options/config related files from mpvcore/ to options/wm42013-12-171-1/+1
| | | | | | | | | Since m_option.h and options.h are extremely often included, a lot of files have to be changed. Moving path.c/h to options/ is a bit questionable, but since this is mainly about access to config files (which are also handled in options/), it's probably ok.
* audio/out: prepare for non-interleaved audiowm42013-11-121-3/+5
| | | | | | | | | | | | | | | | | | | This comes with two internal AO API changes: 1. ao_driver.play now can take non-interleaved audio. For this purpose, the data pointer is changed to void **data, where data[0] corresponds to the pointer in the old API. Also, the len argument as well as the return value are now in samples, not bytes. "Sample" in this context means the unit of the smallest possible audio frame, i.e. sample_size * channels. 2. ao_driver.get_space now returns samples instead of bytes. (Similar to the play function.) Change all AOs to use the new API. The AO API as exposed to the rest of the player still uses the old API. It's emulated in ao.c. This is purely to split the commits changing all AOs and the commits adding actual support for outputting N-I audio.
* audio/out: reject non-interleaved formatswm42013-11-121-0/+2
| | | | | | | | | | No AO can handle these, so it would be a problem if they get added later, and non-interleaved formats get accepted erroneously. Let them gracefully fall back to other formats. Most AOs actually would fall back, but to an unrelated formats. This is covered by this commit too, and if possible they should pick the interleaved variant if a non-interleaved format is requested.
* osx: fix -Wshadow warnings on platform specific codeStefano Pigozzi2013-11-041-3/+3
|
* audio/out: remove useless info struct and redundant fieldswm42013-10-231-6/+5
|
* ao_coreaudio: clear output buffer on buffer underrunStefano Pigozzi2013-10-031-0/+1
| | | | | | | | Output silence to the output buffer during underruns. This removes small occasional glitches that happen before the AUHAL is actually paused from the `audio_pause` call. Fixes #269
* ao_coreaudio: fetch device name only for verbose log levelStefano Pigozzi2013-10-011-6/+8
| | | | | The previous code fetched the device name regardless of log level and then only printed it if log level was verbose.
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-061-3/+3
| | | | Followup commit. Fixes all the files references.
* ao_coreaudio: move to new log APIStefano Pigozzi2013-08-011-29/+27
|
* ao_coreaudio: use default output unit when no device is specifiedStefano Pigozzi2013-07-291-1/+3
| | | | | | Using the default output audio unit should provide a much better user exeperience since it changes automatically the output device based on which becomes the default one.
* ao_coreaudio: prevent buffer underruns to output garbageStefano Pigozzi2013-07-281-1/+6
| | | | | | This was removed in d427b4fd. I now found a sample that causes underruns when moving to a chapter and apparently this is also a problem when taking screenshots.
* audio/out: remove options argument from init()wm42013-07-221-1/+1
| | | | Same as with VOs in the previous commit.
* ao_coreaudio: fix ifdef'd conditionalStefano Pigozzi2013-07-221-1/+1
| | | | | The big endian case was not covered. Doesn't make much difference since mpv runs on Macs with x86 only, but for the sake of correctness.
* ao_coreaudio: use new option APIStefano Pigozzi2013-07-221-38/+22
|
* ao_coreaudio: switch properties getters to tallocStefano Pigozzi2013-07-221-12/+12
|
* ao_coreaudio: revert to original device format on digital uninitStefano Pigozzi2013-07-221-3/+11
| | | | | | This is not done automatically by CoreAudio. I am told that it would a PITA to have to switch back the format manually on the device (especially if the same device is used for lpcm output).
* ao_coreaudio: refactor chmap detectionStefano Pigozzi2013-07-221-88/+11
| | | | | | b2f9e0610 introduced this functionality with code that was quite 'monolithic'. Split the functionality over several functions and ose the new macros to get array properties.
* ao_coreaudio: refactor properties codeStefano Pigozzi2013-07-221-40/+26
| | | | | | | | Introduce some macros to deal with properties. These allow to work around the limitation of CoreAudio's API being `void **` based. The macros allow to keep their client's code DRY, by not asking size and other details which can be derived by the macro itself. I have no idea why Apple didn't design their API like this in the first place.
* ao_coreaudio: move utils functions to snake_caseStefano Pigozzi2013-07-221-6/+6
|
* ao_coreaudio: split ao_coreaudio_common in two filesStefano Pigozzi2013-07-221-10/+7
| | | | | | | | | * ao_coreaudio_utils: contains several utility function * ao_coreaudio_properties: contains functions to set and get audio object properties. Conflicts: audio/out/ao_coreaudio.c
* ao_coreaudio: store asbd only when selectedStefano Pigozzi2013-07-221-4/+1
| | | | | Previous code needlessly stored the input asbd before actually testing it's support against the hardware.
* ao_coreaudio: fallback to waveext on non surround inputsStefano Pigozzi2013-07-221-3/+3
|
* ao_coreaudio: set channel layout based on hardware queryStefano Pigozzi2013-07-221-2/+106
| | | | this is a wip
* ao_coreaudio: fix regression in digital stream selectionStefano Pigozzi2013-07-221-1/+1
| | | | | | The condition was checked wrongly on asbd which is the input format description. This lead to the condition always being true, thus selecting lpcm streams for digital input.
* ao_coreaudio: return errors instead false in init functionsStefano Pigozzi2013-07-221-3/+3
|
* ao_coreaudio: remove useless function declarationStefano Pigozzi2013-07-221-3/+0
|
* ao_coreaudio: only set chmap_sel info for lpcmStefano Pigozzi2013-07-221-5/+7
|
* ao_coreaudio: set channel layout bitmapStefano Pigozzi2013-07-221-1/+17
|
* ao_coreaudio: move digital detection before asbd creationStefano Pigozzi2013-07-221-10/+9
|
* ao_coreaudio: remove chmap selection if format is digitalStefano Pigozzi2013-07-221-1/+0
|
* ao_coreaudio: remove volume multiplication by 4Stefano Pigozzi2013-07-221-2/+2
| | | | | kHALOutputParam_Volume is the linear gain so it should be at maximum 1 to keep the audio quality good. No idea why it was more than that.
* ao_coreaudio: remove device property listener on uninitStefano Pigozzi2013-07-221-12/+6
| | | | Also extract this functionality inside a function in coreaudio_common
* ao_coreaudio: print help string in one goStefano Pigozzi2013-07-221-5/+11
|
* ao_coreaudio: change all ++var to var++Stefano Pigozzi2013-07-221-5/+3
| | | | | Luckily they all were inside for loops so the functionality does not actually change.
* ao_coreaudio: change private vars names to match mpv conventionsStefano Pigozzi2013-07-221-91/+101
|
* ao_coreaudio: remove packetSize private variableStefano Pigozzi2013-07-221-3/+3
|
* ao_coreaudio: refactor play/pauseStefano Pigozzi2013-07-221-27/+15
|
* ao_coreaudio: refactor uninitStefano Pigozzi2013-07-221-17/+6
|
* ao_coreaudio: remove a fixme since that seems fixedStefano Pigozzi2013-07-221-2/+0
|
* ao_coreaudio: ca_msg: add trailing \n where missingStefano Pigozzi2013-07-221-5/+5
|
* ao_coreaudio: refactor playStefano Pigozzi2013-07-221-16/+8
|
* ao_coreaudio: extract mixmode set/unset in utility functionsStefano Pigozzi2013-07-221-46/+7
|
* ao_coreaudio: move AudioStreamChangeFormat to common file and refactorStefano Pigozzi2013-07-221-86/+0
|
* ao_coreaudio: extract methods to lock/unlock device for digital outputStefano Pigozzi2013-07-221-28/+7
|
* ao_coreaudio: lpcm: remove buffer size calculation depending on audio unitStefano Pigozzi2013-07-221-8/+0
|
* ao_coreaudio: refactor initializationStefano Pigozzi2013-07-221-389/+267
| | | | | | | | | | | | | The initialization is split more clearly between compressed and lpcm case. For the compressed case, format selection is simplified a lot and negotiation removed. The way it was written it just passed back to the core the original requested format, not what was found available on hardware. Since this is most likely useless for the compressed case, I didn't bother with this. In the future I'd like to split this AO in two one that only uses the AUHAL and the other with direct access to the hardware so that even passthrough of lcpm can be possible. This would decrease the latency, audiophiles would like that.
* ao_coreaudio: refactor print_helpStefano Pigozzi2013-07-221-26/+21
|
* ao_coreaudio: split out some utility functions and refactor themStefano Pigozzi2013-07-221-310/+11
| | | | | | | Split out some utility functions that use the CoreAudio API but are not related the main task of the AOs (which is to move data correctly to the ringbuffer). These are mainly need for the verbosity of the CoreAudio API and are just obscuring the 'real' code.
* ao_coreaudio: make variable names shorterStefano Pigozzi2013-07-221-30/+30
| | | | property_address -> p_addr
* ao_coreaudio: add error check function and macroStefano Pigozzi2013-07-221-41/+68
| | | | WIP
* ao_coreaudio: dry up ca_msg and use it everywhereStefano Pigozzi2013-07-221-61/+57
| | | | | Change the ca_msg macro to pass along MSGT_AO automatically. Also use it for every output for consistency.
* ao_coreaudio: simplify digital render callbackStefano Pigozzi2013-07-221-4/+3
| | | | | It was reported that it also works by not setting the read size in the AudioBuffer (now idea how, but I will discover it later).
* ao_coreaudio: rewrite spdif render callbackStefano Pigozzi2013-07-221-39/+20
|
* ao_coreaudio: simplify render callbackStefano Pigozzi2013-07-221-23/+9
| | | | | | | Read only the requested amount by the AUHAL (instead of all the buffered data). No idea what the deal is with pausing the audio units if there is no audio to play, maybe to avoid underruns of some sort. Anyway from my tests this condition never occurred so I'm removing it all.
* audio/out: remove ao->outburst/buffersize fieldswm42013-06-161-6/+0
| | | | | | | | | | | | | | | The core didn't use these fields, and use of them was inconsistent accross AOs. Some didn't use them at all. Some only set them; the values were completely unused by the core. Some made full use of them. Remove these fields. In places where they are still needed, make them private AO state. Remove the --abs option. It set the buffer size for ao_oss and ao_dsound (being ignored by all other AOs), and was already marked as obsolete. If it turns out that it's still needed for ao_oss or ao_dsound, their default buffer sizes could be adjusted, and if even that doesn't help, AO suboptions could be added in these cases.
* audio: fix af_fmt_seconds_to_bytesStefano Pigozzi2013-06-161-4/+8
| | | | Was missing samplerate
* core: add a spsc ringbuffer implementationStefano Pigozzi2013-06-161-21/+22
| | | | | | | | | | | | | | | | | Currently every single AO was implementin