aboutsummaryrefslogtreecommitdiffhomepage
path: root/audio/out
Commit message (Collapse)AuthorAge
...
* ao_coreaudio_exclusive: account for additional latencyGravatar wm42015-04-28
| | | | | | | Whether this is correct is unknown. This change tripples the latency from ~15ms to ~45ms. XBMC does this, VLC does not from what I could see.
* ao_null: add an option for testing channel layout selectionGravatar wm42015-04-27
|
* ao_alsa: fallback to stereo channel layout if everything else failsGravatar wm42015-04-14
| | | | | | mp_chmap_from_channels_alsa() doesn't always succeed - there are a bunch of channel counts for which no defined ALSA layout exists. Fallback to stereo in this case. (Normally, this code path shouldn't happen at all.)
* Update license headersGravatar Marcin Kurczewski2015-04-13
| | | | Signed-off-by: wm4 <wm4@nowhere>
* ao_coreaudio: fix inverted conditionGravatar wm42015-04-10
| | | | And also use the correct type for the printf call below.
* ao_alsa: change log outputGravatar wm42015-04-07
| | | | | | | | Silence the usually user-visible warning about unsupported channel maps. This might be an ALSA bug, but ALSA will never fix this behavior anyway. (Or maybe it's a feature.) Log some other information that might be useful.
* ao_coreaudio: do not error if retrieving info for verbose mode failsGravatar wm42015-04-07
| | | | | | The message log level shouldn't get to decide whether something fails or not. So replace the fatal error check on the verbose output code path with a warning.
* ao/wasapi: use atomic state variable instead of different eventsGravatar Kevin Mitchell2015-04-04
| | | | | | | | | Unfortunately, because we have proxy objects (pAudioVolumeProxy, pEndpointVolumeProxy, pSessionControlProxy) it looks like we still have to use MsgWaitForMultipleObjects and watch for and dispatch pending messages: https://msdn.microsoft.com/en-us/library/windows/desktop/ms680112%28v=vs.85%29.aspx
* ao/wasapi: reorder priv membersGravatar Kevin Mitchell2015-04-04
|
* ao_wasapi: code formatting and alignmentGravatar Kevin Mitchell2015-04-03
|
* audio: make all format query shortcuts macrosGravatar Kevin Mitchell2015-04-03
| | | | | af_fmt_is_float and af_fmt_is_planar were previously inconsistent with AF_FORAMT_IS_SPECIAL/AF_FORMAT_IS_IEC61937
* ao_wasapi: passthrough reworkGravatar Kevin Mitchell2015-04-03
| | | | | | | | | | | | | | | * unify passthrough and pcm exclusive mode format setting/testing * set passthrough format parameters correctly * support all of mpv's existing passthrough formats * automatically test passthrough with exclusive mode and enable exclusive if it succeeds, even if it was not explictly requested. this obviates the need for --ao=wasapi,wasapi=exclusive * if passthrough fails (such as the device doesn't support the format), fallback to either exclusive pcm or shared mode depending on what the user specified. Right now this isn't very useful as it still fails due to the decoder path remainin stuck on spdif. fixes #1742
* ao_wasapi: abstract HRESULT_to_strGravatar Kevin Mitchell2015-04-01
|
* 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_wasapi: remove redundant castsGravatar Kevin Mitchell2015-03-31
|
* ao_wasapi: simplify hotplugGravatar Kevin Mitchell2015-03-31
| | | | | | | | | Take advantage of the fact that list_devs is called with a hotplug_inited ao. Also eliminate unnecessary nested function abstraction of hotplug_(un)init and list_devs. However, keep list_devs in ao_wasapi_utils.c since it uses the private functions get_device_id, get_device_name and exposing these would require including headers for IMMDevice in ao_wasapi_utils.h.
* ao_wasapi: fix device listingGravatar Kevin Mitchell2015-03-31
| | | | | remove depricated and convoluted validation. refer instead to the --audio-device option.
* ao/wasapi: add ao hotplugGravatar Kevin Mitchell2015-03-31
| | | | | | | Create a second copy of the change_notify structure for the hotplug ao. change_notify->is_hotplug distinguishes the hotplug version from the regular one monitoring the currently playing ao. Also make the change notification less verbose now that there might be two of them around.
* ao_alsa: add an option to ignore ALSA channel map negotiationGravatar wm42015-03-28
| | | | This was requested, more or less.
* ao/wasapi: use built in KSDATAFORMATsGravatar Kevin Mitchell2015-03-27
| | | | | Rather than defining them ourselves. Thanks to rossy for figuring out the headers.
* ao/wasapi: add missing "if" bracesGravatar Kevin Mitchell2015-03-26
|
* ao/wasapi: rewrite format searchGravatar Kevin Mitchell2015-03-26
| | | | | | | More clearly separate the exclusive and shared mode format discovery. Make the exclusive mode search more systematic in particular about channel maps (i.e., use chmap_sel). Assume that the same sample format / sample rates work for all channels to narrow the search space.
* ao_sndio: open device in blocking mode, don't inflate buffer artificiallyGravatar Dmitrij D. Czarkoff2015-03-26
| | | | | | The code actually uses blocking mode, so opening sound device in non-blocking mode results in choppy sound. Also, inflating the buffer isn't necessary in blocking mode, so the function may simply return without doing anything.
* ao_pulse: drop video role; fixes random mutingGravatar wm42015-03-24
| | | | | | | | | The details are described in #1173. This "features" causes problems to users so often, it's better to remove it. Fixes #1173.
* ao: slightly extend debug messagesGravatar wm42015-03-16
| | | | | This function already got uglified with debug printing; might as well go all the way.
* ao: align audio buffer sizeGravatar wm42015-03-13
| | | | Might or might not matter.
* ao_coreaudio_exclusive: port to pull API, fix latency calculationsGravatar wm42015-03-10
| | | | | | | | | | | | | | Instead of maintaining a private ring buffer, use the generic support for audio APIs with pull callbacks (internally called AO pull API). This also fixes latency calculations: instead of just returning the ringbuffer status, the audio playback state is calculated better and includes interpolation. The main reason this wasn't done earlier was mid-stream format switching. The pull API can now handle it (in a way) by destroying and recreating the AO. This is a bit brutal, but quite simple. It's untested in this new AO, though. Some details might not be right, like how ot restores the old format when reloading.
* ao_coreaudio: move some helpers to utilsGravatar wm42015-03-10
| | | | Needed by ao_coreaudio_exclusive.c in the next commit.
* ao_coreaudio_exclusive: rip out pseudo volume controlGravatar wm42015-03-10
| | | | | | | | | | | | | | | | | This could mute a digital passthrough stream by writing zeros. All other volume values did nothing. The comment about MPlayer dying hasn't been true in mpv for quite a while. It's even possible that it's fixed in upstream MPlayer. mpv will print a scary error message when trying to change volume with spdif, and continue normally. If we really want to mute by writing zeros, we should do it in a separate filter. But I'm not overly fascinated by this approach; is it even guaranteed receivers will not be confused by a stream of zeros? The main reason to remove this is that it's in the way of further cleanups.
* ao/wasapi: move resume to audio threadGravatar Kevin Mitchell2015-02-23
| | | | | | | | | | | | | | This echanges the two events hForceFeed/hFeedDone for hResume. This like the last commit makes things more deterministic. Importantly, the forcefeed is only done if there is not already a full buffer yet to be played by the device. This should fix some of the problems with exclusive mode. This commit also removes the necessity to have a proxy to the AudioClient object in the main thread. fixes #1529
* ao_wasapi: move reset into audio threadGravatar Kevin Mitchell2015-02-23
| | | | | | | | | This makes things a bit more deterministic. It ensures that the audio thread isn't doing anything between IAudioClient_Stop(), IAudioClient_Reset() and setting the sample_count to 0. Buffer overfilling on resume is still a problem in exclusive mode (see next commit).
* ao: fix null dereferenceGravatar Stefano Pigozzi2015-02-14
|
* 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_pulse: listen for hotplug eventsGravatar wm42015-02-12
| | | | | | | | | | | | | | | This requires jumping through multiple hoops on fire. Since the PulseAudio API is virtually undocumented, I'm not sure if this is correct either. We only react to sink events, and only to the NEW/REMOVE events. CHANGE events are ignored, because PulseAudio fires them far too often - even if the system is completely idle! If pa_sink_info.name can change, we're in trouble. pa_sink_info.description is not so important, but it'd also be a bit un-nice if it can change, and we don't update it. The weird way how the actual AO and the hotplug context share the same struct (ao) comes in handy here, although context_success_cb() still had to be duplicated from success_cb() - the unused argument has a different type.
* audio: add device change notification for hotpluggingGravatar wm42015-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Not very important for the command line player; but GUI applications will want to know about this. This only adds the internal API; support for specific audio outputs comes later. This reuses the ao struct as context for the hotplug event listener, similar to how the "old" device listing API did. This is probably a bit unclean and confusing. One argument got reusing it is that otherwise rewriting parts of ao_pulse would be required (because the PulseAudio API requires so damn much boilerplate). Another is that --ao-defaults is applied to the hotplug dummy ao struct, which automatically applies such defaults even to the hotplug context. Notification works through the property observation mechanism in the client API. The notification chain is a bit complicated: the AO notifies the player, which in turn notifies the clients, which in turn will actually retrieve the device list. (It still has the advantage that it's slightly cleaner, since the AO stuff doesn't need to know about client API issues.) The weird handling of atomic flags in ao.c is because we still don't require real atomics from the compiler. Otherwise we'd just use atomic bitwise operations.
* ao: set correct client name when listing devicesGravatar wm42015-02-12
| | | | | | | | | | This is a small oversight. The client name (as set on command line options or, more importantly, the client API) was not set when listing devices e.g. via the "audio-device-list" property. Might or might not fix #1578. Also adjust the log level for an unrelated message.
* ao_coreaudio: fix small memory leakGravatar Stefano Pigozzi2015-02-03
|
* 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_null: add emulation for certain broken behaviorGravatar wm42015-01-30
| | | | | I'm not sure how common this behavior possibly is; well whatever. This option will allow reproducing such behavior, and help debugging it.
* ao_pulse: plug a memory leakGravatar Ben Boeckel2015-01-25
|
* ao_wasapi: fix try_format logic in shared modeGravatar James Ross-Gowan2015-01-23
| | | | | | | | | | | | | | | | | The MSDN documentation for IsFormatSupported says a return code of AUDCLNT_E_UNSUPPORTED_FORMAT means the function "succeeded but the specified format is not supported in exclusive mode." This seems to imply that the format is supported in shared mode, and that's what the old code assumed, however try_format would incorrectly return success with some drivers. The remarks section of the documentation contradicts that assumption. It says that in shared mode, if the audio engine does not support the caller-specified format or any similar format, ppClosestMatch is set to NULL and the function returns AUDCLNT_E_UNSUPPORTED_FORMAT. This is the same as in exclusive mode, so treat AUDCLNT_E_UNSUPPORTED_FORMAT the same regardless of opt_exclusive. In shared mode, the format selection code will fall back to the mix format, which should always be supported.
* ao_alsa: reinitialize if device got brokenGravatar wm42015-01-21
| | | | | | | | | Apparently, physically disconnecting the audio device (consider USB audio) breaks the ALSA device handle forever. It will signal ENODEV. Fortunately, it's easy for us to handle this, and we can just use existing mechanisms that will make the playback core close and reopen the AO. Whether the immediate reopening will actually succeeds really is ALSA's problem, though.
* ao_coreaudio: reset possibly random errno valueGravatar wm42015-01-20
| | | | | | | | | | In general, you need to check errno when using strtol(), but as far as I know, strtol() won't reset errno on success. This has to be done manually. The code could have failed sporadically if strtol() succeeded, and errno was already set to one of the checked values. (This strtol() still isn't fully error checked, but I don't know if it's intentional, e.g. for parsing a numeric prefix only.)
* ao: never autoselect ao_nullGravatar wm42015-01-20
| | | | | | | | | Before this commit, ao_null was used as last fallback. This doesn't make too much sense. Why would you decode audio just to discard it? Let audio initialization fail instead. This also handles the weird but possible corner-case that ao_null might fail initializing, in which case e.g. ao_pcm could be autoselected. (This happened once, and had to be fixed manually.)
* ao: refactor --audio-device selection codeGravatar wm42015-01-20
| | | | | | | | | | | | | | This removes the slightly duplicated code for picking the required AO driver if --audio-device forces one. Now --audio-device reuses the same code as --ao for this. As a consequence, ao_alloc_pb() and ao_create() can be merged into ao_init(). Although the ao_init() argument list, which is already pretty big, grows by one, it's better than having all these similar sounding functions around. Actually, I just wanted to do the change the following commit will do, but I found this code was more of a mess than it had to be.
* ao_alsa: fix a small memory leakGravatar wm42015-01-14
|
* ao_pcm: add append modeGravatar wm42015-01-14
| | | | | Pretty useful for debugging, although a bit useless or possibly misleading too (see comments in the manpage).
* ao_pulse: exit AO if stream failsGravatar wm42015-01-11
| | | | | | This can for example reproduced by killing the pulseaudio server. If this happens, just try to reload the AO, instead of breaking everything forever.
* ao_alsa: fix dtshd passthroughGravatar wm42015-01-09
| | | | | | | We must not try to remap channels with this. Whethever ALSA gives us, and whatever we do with it, the result will probably be nonsense. Untested, as I don't have the required hardware.