aboutsummaryrefslogtreecommitdiffhomepage
path: root/audio/out/ao_coreaudio.c
Commit message (Collapse)AuthorAge
* ao_coreaudio: change license to LGPLGravatar wm42017-05-08
| | | | | | | | | | | | | | | | All authors have agreed to the relicensing. The code was pretty much rewritten by Stefano Pigozzi. Since the rewrite happened incrementally, and seems to include refactored portions of older code, this relicensing was done on the pre-refactor code do. The original commit adding this AO (as ao_macosx.c) credits Timothy J. Wood as original author. He was asked and agreed to LGPL. It's not entirely sure from which project this code came from, but it's probably libao. In that project, Stanley Seibert made some changes to it (who as a major developer of libao was asked just to be sure), and also Ralph Giles and Ben Hines made two small changes. The latter were not asked, but none of their code survived anyway.
* options: remove deprecated sub-option handling for --vo and --aoGravatar wm42016-11-25
| | | | | | | | Long planned. Leads to some sanity. There still are some rather gross things. Especially g_groups is ugly, and a hack that can hopefully be removed. (There is a plan for it, but whether it's implemented depends on how much energy is left.)
* audio/out: deprecate "exclusive" sub-optionsGravatar wm42016-09-05
| | | | | | | And introduce a global option which does this. Or more precisely, this deprecates the global wasapi and coreaudio options, and adds a new one that merges their functionality. (Due to the way the sub-option deprecation mechanism works, this is simpler.)
* options: deprecate suboptions for the remaining AO/VOsGravatar wm42016-09-05
|
* ao_coreaudio: actually use stop callbackGravatar wm42016-08-09
| | | | | | The .pause callback is never used for pull.c-based AOs. This means this always streamed silence instead of deactivating audio.
* ao_coreaudio: remove detected_deviceGravatar wm42016-04-26
| | | | | | | | | | | Setting this here is a race condition. It's called from a CoreAudio callbacks, and there are no locks. It's a string, so this can be potentially severe. It's hard to fix and only CoreAudio supported it, so remove it. This causes the "audio-out-detected-device" property to return nothing on all platforms.
* ao_coreaudio: replace fourcc_repr()Gravatar wm42016-01-11
| | | | Replace with the more general mp_tag_str().
* ao_coreaudio: avoid unnecessary format changesGravatar wm42015-10-21
| | | | | Not particularly important; just being nice and potentially avoiding problems caused by format setting.
* ao_coreaudio: fix some minor memory leaksGravatar wm42015-10-21
|
* ao_coreaudio: fix device latency, share the codeGravatar wm42015-07-06
| | | | | | | | | ao_coreaudio (using AudioUnit) accounted only for part of the latency - move the code in ao_coreaudio_exclusive to utils, and use that for the AudioUnit code. (There's still the question why CoreAudio and AudioUnit require you to jump through hoops this much, but apparently that's how it is.)
* ao_coreaudio: add exclusive suboptionGravatar wm42015-07-03
|
* ao_coraudio: reject all non-PCM formatsGravatar wm42015-07-03
| | | | | Currently this is equivalent. On the other hand, all audio code should reject formats that is not in a category known to it.
* ao_coreaudio: restore physical format if it can't be set exactlyGravatar wm42015-06-30
| | | | | | | | May help with (supposedly) bad drivers, which can put the device into some sort of broken state when trying to set a different physical format. When the previous format is restored, it apparently recovers. This might make the change-physical-format suboption more robust.
* ao_coreaudio: log hotplug events explicitlyGravatar wm42015-06-29
|
* audio: fix format function consistency issuesGravatar wm42015-06-26
| | | | | | | | | | | Replace all the check macros with function calls. Give them all the same case and naming schema. Drop af_fmt2bits(). Only af_fmt2bps() survives as af_fmt_to_bytes(). Introduce af_fmt_is_pcm(), and use it in situations that used !AF_FORMAT_IS_SPECIAL. Nobody really knew what a "special" format was. It simply meant "not PCM".
* ao_coreaudio: support non-interleaved outputGravatar wm42015-06-26
| | | | | This saves us the trouble of interleaving the audio data for no reason.
* ao_coreaudio: explicitly skip input streamsGravatar wm42015-06-26
| | | | | | | This may or may not fix some issues with the format switching code. Actually, it seems somewhat unlikely, but then checking the stream type isn't incorrect either, and is probably something the API user should always be doing.
* ao_coreaudio: change physical stream format synchronouslyGravatar wm42015-06-09
|
* ao_coreaudio: log considered physical formatsGravatar wm42015-05-05
|
* ao_coreaudio: restore old physical format if format was changedGravatar wm42015-05-05
|
* ao_coreaudio: move channel mapping code to a separate fileGravatar wm42015-05-05
| | | | | | | | | | Move all of the channel map retrieval/negotiation code to a separate file. This will (probably) be helpful when extending ao_coreaudio_exclusive.c. Nothing else changes, other than some minor cosmetics and renaming, and changing some details for decoupling it from the ao_coreaudio.c internals.
* ao_coreaudio_utils: don't require talloc for fourcc_repr()Gravatar wm42015-05-05
| | | | | Instead, apply a trick to make the caller allocate enough space on the stack.
* ao_coreaudio: change physical format before channel negotiationGravatar wm42015-05-05
| | | | | | If for example the physical format is set to stereo, the reported multichannel layout will actually be stereo. It fixes itself only after the physical format is changed.
* ao_coreaudio: add an option for changing the physical formatGravatar wm42015-05-05
| | | | | | | | | | | | ao_coreaudio uses AudioUnit - the OSX software mixer. In theory, it supports multichannel audio just fine. But in practice, this might be disabled by default, and the user is supposed to select a multichannel base format in the "Audio MIDI Setup" utility. This option attempts to change this setting automatically. Some possible disadvantages and caveats are listed in the manpage additions. It is off by default, since changing this might be rather bad behavior for a normal application.
* ao_coreaudio: support padded channel layoutsGravatar wm42015-05-05
| | | | | | | If for example the audio settings are set to 5.1 output, but the hardware does 8 channels natively (HDMI), the reported channel layout will have 2 dummy channels. To avoid falling back to stereo, we have to write audio in this format to the device.
* ao_coreaudio: fix out of bounds accessGravatar wm42015-05-04
| | | | | | ca_label_to_mp_speaker_id() checked whether the last entry was >= 0, but actually this condition was never true, and MP_SPEAKER_ID_UNKNOWN0 is not negative.
* ao_coreaudio: do not signal per-app volumeGravatar wm42015-04-01
| | | | | CoreAudio doesn't seem to have this concept. The volume is reset the next time audio is opened.
* ao_coreaudio: move some helpers to utilsGravatar wm42015-03-10
| | | | Needed by ao_coreaudio_exclusive.c in the next commit.
* ao_coreaudio: add support for hotplug notificationsGravatar Stefano Pigozzi2015-02-14
| | | | | | | | | | This commit adds notifications for hot plugging of devices. It also extends the old behaviour of the `audio-out-detected-device` property which is now backed by the hotplugging code. This allows clients to be notified when the actual audio output device changes. Maybe hotplugging should be supported for ao_coreaudio_exclusive too, but it's device selection code is a bit fragile.
* ao_coreaudio: use device UID instead of ID for selectionGravatar Stefano Pigozzi2015-02-03
| | | | | | | | | | Previously we let the user use the audio device ID, but this is not persistent and can change when plugging in new devices. That of course made it quite worthless for storing it as a user setting for GUIs, or for user scripts. In theory getting the kAudioDevicePropertyDeviceUID can fail but it doesn't on any of my devices, so I'm leaving the error reporting quite high and see if someone complains.
* command: add property returning detected audio deviceGravatar Stefano Pigozzi2015-02-03
| | | | | This can be useful to adjust some other audio related properties at runtime depending on the audio device being used.
* ao_coreaudio: remove useless guardGravatar Stefano Pigozzi2014-12-27
| | | | useless after 069016fd6c
* ao_coreaudio: fix some naming conventionsGravatar Stefano Pigozzi2014-12-27
|
* ao_coreaudio: fix channel mappingGravatar Stefano Pigozzi2014-12-27
| | | | | | | | | | | | | | | There where 3 major errors in the previous code: 1) The kAudioDevicePropertyPreferredChannelLayout selector returns a single layout not an array. 2) The check for AudioChannelLayout allocation size was wrong (didn't account for variable sized struct). 3) Didn't query the kAudioDevicePropertyPreferredChannelsForStereo selector since I didn't know about it's existence. All of these are fixed. Might help with #1367
* ao_coreaudio: fix typoGravatar Stefano Pigozzi2014-12-27
|
* ao_coreaudio: move some code to make output readableGravatar Stefano Pigozzi2014-12-27
|
* ao_coreaudio: add more layout debug outputsGravatar Stefano Pigozzi2014-12-27
| | | Should help remote debugging #1367 with --msg-level=ao=debug
* ao_coreaudio: fix AudioChannelLayout allocationsGravatar Stefano Pigozzi2014-12-26
| | | | | | | | AudioChannelLayout uses a trailing variable sized array so we need to query CoreAudio for the size of the struct it is going to need (or the conversion of that particular layout would fail). Fixes #1366
* ao_coreaudio: fix mono/stereo channel mappingGravatar Stefano Pigozzi2014-12-16
| | | | | | Needed after af3bbb800d since now we use channel mapping all the time. Fixes #1357
* ao_coreaudio: add missing goto for error pathGravatar Stefano Pigozzi2014-12-16
|
* coreaudio: don't output too many channel descriptionsGravatar Stefano Pigozzi2014-12-05
| | | | for #1279 and #1249
* coreaudio: add missing \n in log lineGravatar Stefano Pigozzi2014-12-05
|
* coreaudio: don't print layout a second timeGravatar Stefano Pigozzi2014-12-05
| | | | For #1279
* coreaudio: reject descriptions with too many channelsGravatar Stefano Pigozzi2014-12-04
| | | | This is a fix attempt for #1279 and #1249.
* coreaudio: fix more layout printsGravatar Stefano Pigozzi2014-12-04
|
* coreaudio: fix prints of uint32_t in log_layoutGravatar Stefano Pigozzi2014-12-04
|
* audio: allow more than 20 channel map entriesGravatar wm42014-12-01
| | | | | | | | | | | | | This could trigger an assertion when using ao_alsa or ao_coreaudio. The code was simply assuming the number of channel maps was bounded statically (which was true at first in both AOs). Fix by using dynamic memory allocation. It needs to be explicitly enabled by the AOs by setting a temp context, because otherwise the memory couldn't be freed. (Or at least this seems to be the most elegant solution.) Fixes #1306.
* coreaudio: redirect IEC61937 to coreaudio_exclusiveGravatar Stefano Pigozzi2014-10-23
|
* coreaudio: use the new device selection APIGravatar Stefano Pigozzi2014-10-12
| | | | | The CoreAudio API is built around device IDs so we store the integer as string and read it back.
* audio/out: remove old thingsGravatar wm42014-09-06
| | | | | | | | 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.