Commit Graph

56 Commits

Author SHA1 Message Date
Thomas Weißschuh 87aba146ed ao_pipewire: Add PipeWire audio backend
The AO provides a way for mpv to directly submit audio to the PipeWire
audio server.
Doing this directly instead of going through the various compatibility
layers provided by PipeWire has the following advantages:

* It reduces complexity of going through the compatibility layers
* It allows a richer integration between mpv and PipeWire
  (for example for metadata)
* Some users report issues with the compatibility layers that to not
  occur with the native AO

For now the AO is ordered after all the other relevant AOs, so it will
most probably not be picked up by default.
This is for the following reasons:

* Currently it is not possible to detect if the PipeWire daemon that mpv
  connects to is actually driving the system audio.
  (https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1835)
* It gives the AO time to stabilize before it is used by everyone.

Based-on-patch-by: Oschowa <oschowa@web.de>
Based-on-patch-by: Andreas Kempf <aakempf@gmail.com>
Helped-by: Ivan <etircopyhdot@gmail.com>
2022-01-17 11:43:02 -08:00
Ivan 87ce3b31a9 ao_openal: enable AL_SOFT_direct_channels_remix extension by default
Prevent audio distortions caused by OpenAL's 3D effects.
2021-11-29 11:27:39 +01:00
Dudemanguy 59898331dd DOCS/ao: remove incorrect note about openal
The audio rewrite in d27ad96542 originally
broke this ao. However, 0ac724f002 fixed
and the documentation was never updated to reflect that. OpenAL has
worked fine for a while not. Just remove this sentence.
2021-11-19 16:57:37 -06:00
rim 1b2e5137e0 ao_oss: add this audio output again
Changes:
- code refactored;
- mixer options removed;
- new mpv sound API used;
- add sound devices detect (mpv --audio-device=help will show all available devices);
- only OSSv4 supported now;

Tested on FreeBSD 12.2 amd64.
2021-03-15 12:42:35 +01:00
Leo Izen 1251f7bbf9 manpage: rename OS X references to macOS
Apple has decided that Mac OS X is now named macOS for the time
being. For consistency, it makes sense to use the same name for the
operating system in all places where it occurs. This commit renames
OS X to macOS in the documentation in places where it was otherwise
still using the old name.
2021-01-03 12:05:30 -05:00
Jan Beich f89c7404d1 manpage: drop --sdl-bufcnt after 346c687d5a 2020-07-21 15:08:47 +02:00
wm4 d27ad96542 audio: redo internal AO API
This affects "pull" AOs only: ao_alsa, ao_pulse, ao_openal, ao_pcm,
ao_lavc. There are changes to the other AOs too, but that's only about
renaming ao_driver.resume to ao_driver.start.

ao_openal is broken because I didn't manage to fix it, so it exits with
an error message. If you want it, why don't _you_ put effort into it? I
see no reason to waste my own precious lifetime over this (I realize the
irony).

ao_alsa loses the poll() mechanism, but it was mostly broken and didn't
really do what it was supposed to. There doesn't seem to be anything in
the ALSA API to watch the playback status without polling (unless you
want to use raw UNIX signals).

No idea if ao_pulse is correct, or whether it's subtly broken now. There
is no documentation, so I can't tell what is correct, without reverse
engineering the whole project. I recommend using ALSA.

This was supposed to be just a simple fix, but somehow it expanded scope
like a train wreck. Very high chance of regressions, but probably only
for the AOs listed above. The rest you can figure out from reading the
diff.
2020-06-01 01:08:16 +02:00
wm4 bca917f6d2 ao_oss: remove this audio output
Ancient Linux audio output. Apparently it survived until now, because
some BSDs (but not all) had use of this. But these should work with
ao_sdl or ao_openal too (that's why these AOs exist after all). ao_oss
itself has the problem that it's virtually unmaintainable from my point
of view due to all the subtle (or non-subtle) difference. Look at the
ifdef mess and the multiple code paths (that shouldn't exist) in the
removed source code.
2020-03-28 20:59:31 +01:00
wm4 4583bd8cc7 ao_rsound: remove this audio output
I wonder what this even is. I've never heard of anyone using it, and
can't find a corresponding library that actually builds with it. Good
enough to remove.
2020-03-28 20:59:00 +01:00
wm4 71d218eae4 ao_sndio: remove this audio output
It was always marked as "experimental", and had inherent problems that
were never fixed. It was disabled by default, and I don't think anyone
is using it.
2020-03-28 20:58:56 +01:00
Térence Clastres 41f4e8d73a ao_pulse: add --pulse-allow-suspended
This flag makes mpv continue using the PulseAudio driver even if the
sink is suspended.
This can be useful if JACK is running with PulseAudio in bridge mode and
the sink-input assigned to mpv is the one JACK controls, thus being
suspended.
By forcing mpv to still use PulseAudio in this case, the user can now
adjust the sink to an unsuspended one.
2019-09-21 12:54:36 +02:00
wm4 66810c1550 ao_pulse: reduce requested device buffer size
Same deal as with the previous commit for ALSA.

Untested.
2018-04-15 23:11:33 +03:00
LAGonauta e00ca83006 ao/openal: Remove notes on experimentality from the documentation
Also, multi-channel audio should be fast now with the use of the MC
extensions.
2018-04-15 00:57:34 +03:00
LAGonauta 614ad62f89 ao/openal: Add option to set buffering characteristics
One can now set the number of buffers and the buffer size.
This can reduce the CPU usage and the total latency stays mostly the same.
As there are sync mechanisms the A/V sync continue intact and working.

It also modifies 6.1 channel order, as per OpenAL spec
and add AOPLAY_FINAL_CHUNK support
2018-04-15 00:57:01 +03:00
LAGonauta dd357a7d53 ao/openal: Add support for direct channels output
Uses OpenAL Soft's AL_DIRECT_CHANNELS_SOFT extension and can be controlled through
a new CLI option, --openal-direct-channels.
This allows one to send the audio data direrctly to the desired channel without
effects applied.
2018-04-15 00:57:01 +03:00
wm4 054c02ad64 ao_null: add --ao-null-format option for debugging
Helpful especially to test spdif fallback and so on.
2018-01-30 03:10:27 -08:00
Bisaloo 8a2db0c4b1 manpage: fix typo in warning 2017-12-27 13:16:30 -07:00
wm4 b21e0746f6 ao_rsound: allow setting the host
Completely untested (rsound dev libs unavailable on my system). Trivial
enough that it's very likely that it'll just work. No port selection,
but could be added by parsing it as part of the device name.

Should fix #4714.
2017-08-21 15:46:00 +02:00
wm4 d0e8d6114b ao_coreaudio: insane hack for passing through AC3 as float PCM
This uses the same hack as Kodi uses, and I suspect MPlayer/ancient mpv
also did this (but didn't research that).
2017-06-30 09:06:01 +02:00
wm4 809d160c1e options: remove remaining deprecated audio device selection options 2017-04-23 17:51:55 +02:00
wm4 1a2319f3e4 options: remove deprecated sub-option handling for --vo and --ao
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.)
2016-11-25 21:17:25 +01:00
wm4 355361e1e3 manpage: remove more references to deprecated sub-option syntax
Fixes #3497.
2016-09-07 12:55:21 +02:00
wm4 1d9032f011 audio/out: deprecate "exclusive" sub-options
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.)
2016-09-05 21:26:39 +02:00
wm4 13786dc643 audio/out: deprecate device sub-options
We have --audio-device, which can force the device. Also add something
describing to this extent to the manpage.
2016-09-05 21:26:39 +02:00
wm4 69283bc0f8 options: deprecate suboptions for the remaining AO/VOs 2016-09-05 21:26:39 +02:00
wm4 726ef35aa8 ao_jack: move to global options 2016-09-05 21:04:41 +02:00
wm4 4ab860cddc options: add a mechanism to make sub-option replacement slightly easier
Instead of requiring each VO or AO to manually add members to MPOpts and
the global option table, make it possible to register them automatically
via vo_driver/ao_driver.global_opts members. This avoids modifying
options.c/options.h every time, including having to duplicate the exact
ifdeffery used to enable a driver.
2016-09-05 21:04:17 +02:00
wm4 a85eecfe40 ao_alsa: change sub-options to global options
Same deal as with vo_opengl.

Also edit the outdated information about multichannel output a little.
2016-09-02 21:21:47 +02:00
wm4 6b4f560f3c vo, ao: disable positional parameter suboptions
Positional parameters cause problems because they can be ambiguous with
flag options. If a flag option is removed or turned into a non-flag
option, it'll usually be interpreted as value for the first sub-option
(as positional parameter), resulting in very confusing error messages.
This changes it into a simple "option not found" error.

I don't expect that anyone really used positional parameters with --vo
or --ao. Although the docs for --ao=pulse seem to encourage positional
parameters for the host/sink options, which means it could possibly
annoy some PulseAudio users.

--vf and --af are still mostly used with positional parameters, so this
must be a configurable option in the option parser.
2016-09-01 14:21:32 +02:00
wm4 3e90a5fe81 ao_dsound: remove this audio output
It existed for XP-compatibility only. There was also a time where
ao_wasapi caused issues, but we're relatively confident that ao_wasapi
works better or at least as good as ao_dsound on Windows Vista and
later.
2016-01-06 13:52:15 +01:00
Martin Herkt fc9eef3b81
man: fix grammar issues 2015-12-19 09:26:41 +01:00
wm4 a7f51f8fd4 ao_jack: remove "alsa" std-channel-layout choice
Same deal as with previous commit. "waveext" is less arbitrary and at
least supports 3/7 channels.
2015-11-07 15:20:34 +01:00
Ellis Berner 0e2024ef2b docs: correct typo for 'ingore-chmap'
ingore-chmap -> ignore-chmap
2015-08-22 11:50:33 +02:00
wm4 514af9fbd1 ao_coreaudio: add exclusive suboption 2015-07-03 19:28:00 +02:00
wm4 e9e323f35d ao_coreaudio_exclusive: support PCM
Until now, this was for AC3 only. For PCM, we used AudioUnit in
ao_coreaudio, and the only reason ao_coreaudio_exclusive exists
is that there is no other way to passthrough AC3.

PCM support is actually rather simple. The most complicated
issue is that modern OS X versions actually do not support
copying through the data; instead everything must go through
float. So we have to deal with virtual and physical format
being different, which causes some complications.

This possibly also doesn't support some other things correctly.
For one, if the device allows non-interleaved output only, we
will probably fail. (I couldn't test it, so I don't even know
what is required. Supporting it would probably be rather
simple, and we already do it with AudioUnit.)
2015-07-03 19:28:00 +02:00
wm4 22455b2961 manpage: fix typo 2015-05-05 14:40:26 +02:00
wm4 8121529a6c ao_coreaudio: add an option for changing the physical format
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.
2015-05-05 01:11:16 +02:00
wm4 570f4b136f ao_null: add an option for testing channel layout selection 2015-04-27 23:21:58 +02:00
Martin Herkt bf0cb27489
man: fix PDF build
The build failed because rst2pdf apparently has problems with
page breaks. In this case, the link to the ALSA upmix guide was
causing a page break in an admonition block. My guess is that
rst2pdf screws up when it can’t fill at least one line of text
following a page break, so I worked around this by making that
paragraph a little longer. Seems to do the trick.

I also shortened the URL using GitHub’s service because it was
causing some rather unsightly formatting in the manpage output.

Maybe we should just build HTML instead of a PDF.
2015-04-24 03:37:43 +02:00
Kevin Mitchell ea00fe0eeb ao_wasapi: fix device listing
remove depricated and convoluted validation. refer instead to the
--audio-device option.
2015-03-31 12:28:41 -07:00
wm4 b561ec99ff ao_alsa: add an option to ignore ALSA channel map negotiation
This was requested, more or less.
2015-03-28 23:53:49 +01:00
wm4 12d822ce44 ao_null: add emulation for certain broken behavior
I'm not sure how common this behavior possibly is; well whatever. This
option will allow reproducing such behavior, and help debugging it.
2015-01-30 21:30:54 +01:00
wm4 c8ecb66269 ao_pcm: add append mode
Pretty useful for debugging, although a bit useless or possibly
misleading too (see comments in the manpage).
2015-01-14 22:14:56 +01:00
wm4 dc2d0539c7 ao_pulse: disable latency calculation hacks by default
This used to be required to workaround PulseAudio bugs. Even later, when
the bugs were (partially?) fixed in PulseAudio, I had the feeling the
hacks gave better behavior. On the other hand, I couldn't actually
reproduce any bad behavior without the hacks lately. On top of this, it
seems our hacks sometimes perform much worse than PulseAudio's native
implementation (see #1430).

So disable the hacks by default, but still leave the code and the option
in case it still helps somewhere. Also, being able to blame PulseAudio's
code by using its native API is much easier than trying to debug our own
(mplayer2-derived) hacks.
2015-01-07 22:23:38 +01:00
wm4 4075518011 ao_portaudio: remove this audio output
It's just completely useless. We have good native support for all 3
desktop platforms, and ao_sdl or ao_openal as fallbacks.
2014-12-29 18:53:12 +01:00
wm4 f81748c4e4 manpage: ao_alsa: link upmix wiki entry
Also clarify the statement about what we expect to happen by default.
It's well possible that distros at some point will fix their ALSA
configuration, and e.g. enable the upmix plugin by default.
2014-12-16 05:11:14 +01:00
wm4 af3bbb800d audio: make native channel count the default instead of stereo downmix
This should work well with most audio APIs, except ALSA. A long-winded
explanation is provided how to make ALSA multichannel output work.

All other AOs should have no such problems. Of course it's possible
that previously unknown issues arise, because I assume that enabling
multichannel audio is actually relatively rare.

This also disables codec downmix by default, which could change the
audio output due to different mixing in the codec and libavresample.

Fixes #1313.
2014-12-15 17:14:23 +01:00
wm4 f6d7230a6f manpage: update the ao_alsa example (no-block was removed)
Also, don't use the "hw" device, but "plughw". ALSA docs say never to
use "hw".
2014-12-09 22:57:25 +01:00
wm4 d6606bcfff ao_alsa: simplify, remove no-block suboption
If no-block was given, the device would be opened with SND_PCM_NOBLOCK.
Also, after opening, blocking mode was unconditionally enabled anyway
with snd_pcm_nonblock(). Further, if opening with SND_PCM_NOBLOCK
failed, opening was retried without this flag.

This doesn't make any sense to me, and I've never heard of someone using
this suboption. I suspect it has to do with ancient ALSA bugs or API
caveats. Remove it and simplify the code.
2014-12-05 01:23:09 +01:00
Stefano Pigozzi c5366dd337 reflect recent coreaudio changes in the manual 2014-10-23 09:50:54 +02:00