| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When af_scaletempo2.c:process() detects a format change, it goes back
through mp_scaletempo2_init() to reinitialize everything. However,
mp_scaletempo2.input_buffer is not necessarily reallocated due to a
check in af_scaletempo2_internals.c:resize_input_buffer(). This is a
problem if the number of audio channels increases, since without
reallocating, the buffer for the new channel(s) will at best point to
NULL, and at worst uninitialized memory.
Since resize_input_buffer() is only called from two places, pull size
check out into mp_scaletempo2_fill_input_buffer(). This allows each
caller to decide whether they want to resize or not. We could be
smarter about when to reallocate, but that would add a lot of machinery
for a case I don't expect to be hit often in practice.
|
|
|
|
|
|
|
| |
Fixes 5.1/7.1 output mapping on tvOS 16,
and also makes the AC3-layout hack unnecessary.
Also adds some diagnostic log messages.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we would only call list_devs() on available AOs if an AO
*did not* have a hotplug_init() callback or for the first one that *did*
have it.
This is problematic when multiple fully functional hotplug-capable AOs
are available.
The second one would not be able to contribute discovered devices.
This problem prevents ao_pipewire from introducing full hotplug support
with hotplug_init().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a platform has multiple valid AOs that can provide hotplug events
we should try to use the one that also provides playback.
Concretely this will help when introducing hotplug support for
ao_pipewire.
Currently ao_pulse is probed by ao_hotplug_get_device_list() before
ao_pipewire and on the common setups where both AOs could work pulse
will be selected for hotplug handling.
This means that hotplug_init() of ao_pipewire will never be called and
list_devs() has to do its own initialization.
But if ao_pulse is non-functional or not compiled-in suddenly
ao_pipewire *must* implement hotplug_init() for hotplugging events to
work for all.
Also if the hotplug ao_pulse connects to a PulseAudio instance that is
not emulated by the same PipeWire instance as the playback ao_pipewire
the hotplug events are useless.
|
| |
|
|
|
|
|
|
| |
This is used to notify an AO about the type of media that is being
played.
Either a movie or music.
|
| |
|
|
|
|
|
|
|
| |
`opus` codec likes returning denormalized floats in some cases, causing
wacky issues.
Fixes #10290
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
uau did some investigation and noticed that we do not send a wakeup
event when we encounter end-of-stream in ao_read_data(), in contrast to
the equivalent logic for push AOs in ao_play_data().
Inserting that wakeup fixes the original problem of lack of
reinitialization on a format change without the problems we saw with
the previous attempted fix.
Fixes #10566
|
|
|
|
|
|
|
|
|
|
| |
The error description in #10545 could indicate that we are overflowing
we are corrupting the buffer metadata ourselves through out-of-bound
writes.
This check is also present in pw-cat so it seems to be expected for
b->requested to exceed the actual available buffer space.
Potential fix for #10545
|
| |
|
| |
|
|
|
|
|
| |
This allows the audio server better to make sense of the data instead of
having to use heuristics.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Don't use cube root volumes, pipewire uses linear volumes.
|
|
|
|
|
|
|
|
| |
pw_core_disconnect frees the core, so accessing it afterward to
destroy the context is not allowed.
Instead, just destroy the context, the first thing it does is disconnect
all cores for us.
|
|
|
|
|
| |
The listeners need to be cleared because removing them might invoke the
removed handler, which could otherwise point to invalid memory.
|
|
|
|
|
|
|
|
| |
mpv only remembers volume for two channels.
Always apply the same volume to all channels in case of
non-stereo layout similarly to ao_pulse.
Don't try to do anything smart when averaging volumes,
normally they are equal anyway.
|
|
|
|
|
| |
Mostly useful for unit tests in order to access the channel
layouts from chmap which have mapped channels.
|
| |
|
| |
|
|
|
|
| |
This simplifies ifdeffery with AVChannelLayouts.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This is the new FFmpeg channel layout structure, which now
combines channel count and layout into a single location.
Only unspecified (channel count only) and native (channel layout
mask based) layouts are currently supported for the initial move
towards non-deprecated APIs.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Stopping the thread is done using pw_thread_loop_stop(),
*which must be called without the lock held.*
Fixes #10033
|
|
|
|
|
|
|
| |
We have to destroy the core before destroying the loop.
Also we have to lock the mainloop for operations on its objects.
Fixes #10003
|
|
|
|
|
| |
No change in logic, but wrap the LT operator and the && in parentheses
to silence the compiler warning.
|
|
|
|
|
|
|
|
| |
Pass channel volumes to `pw_stream_set_control` as array.
This is correct calling conventions and prevents
right channel muting every time ao-volume property is changed.
Terminate `pw_stream_set_control` calls with 0.
|
|
|
|
|
| |
Our allocated buffers should be big enough, but add some errorhandling
just in case.
|
| |
|
|
|
|
|
|
|
|
| |
Changes:
* fixed hangups in the loop function and in some other cases
* refactoring according to @michaelforney's recommendations in #8314
* a few minor and/or cosmetic changes
* ability to build ao_sndio using meson
|
|
|
|
|
|
|
|
|
| |
Changes:
- rewrite to use new internal MPV API;
- code refactoring;
- fix buffers size calculations;
- buffer set to auto;
- reset() - clean/reinit device only after errors;
|
|
|
|
|
|
|
|
|
|
| |
Sometimes the most obvious things can be missed.
Reflects authorship described in the original commit.
* https://github.com/mpv-player/mpv/pull/7902
* https://github.com/Oschowa/mpv/commit/fddb143282fa74425a8a6f29c9566e51777759d0
* https://github.com/mpv-player/mpv/pull/9587
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
mark an array as static, a typo and a missing free
|
| |
|
|
|
|
|
|
|
|
|
| |
Simply returning out of this function leaks avpkt, need to always "goto
done".
Rewrite the logic a bit to make it more clear what's going on (IMO).
Fixes #9593
|
|
|
|
| |
Prevent audio distortions caused by OpenAL's 3D effects.
|
|
|
|
|
|
| |
regression introduced in b74c09efbf7c6969fc053265f72cc0501b840ce1
Signed-off-by: Aman Karmani <aman@tmm1.net>
|
|
|
|
|
|
| |
Upstream "Wilhelm" (the Android OpenSLES implementation) supports
only 8000 <= rate <= 192000. Make sure mpv resamples the audio
when necessary.
|
|
|
|
|
|
|
| |
Ever instance of m_obj_list is a constant and for all of them, the field
is true. Just remove the field all together.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
|
|
|
|
|
|
|
|
| |
This fixes a mismatch between configure working and build time
failing with Linux + OSSv4, enabling compilation on Debian based
Linux systems with the oss4-dev package.
Fixes #9378
|
| |
|
|
|
|
|
|
|
|
| |
Previously number of channels was being ignored.
The buffer will now be between 75ms and 150ms
Signed-off-by: Aman Karmani <aman@tmm1.net>
|
|
|
|
| |
Signed-off-by: Aman Karmani <aman@tmm1.net>
|
|
|
|
|
|
| |
Fixes issues streaming to echo speaker pair from firetv devices.
Signed-off-by: Aman Karmani <aman@tmm1.net>
|
|
|
|
| |
Signed-off-by: Aman Karmani <aman@tmm1.net>
|
|
|
|
|
|
| |
Fixes deprecation warnings printed when using this driver.
Signed-off-by: Aman Karmani <aman@tmm1.net>
|
|
|
|
|
| |
In hindsight this is obviously broken.
This reverts commit fb5d976cb070020e35501685c9f84b9435b248e6.
|
|
|
|
|
| |
This would happen when switching from playback stuck in cache wait
(underrun) to another file.
|
|
|
|
|
|
|
|
|
|
| |
This brings my scaletempo2 benchmark down from ~22s to ~7s on my machine
(-march=native), and down to ~11s with a generic compile.
Guarded behind an appropriate #ifdef to avoid being ableist against
people who have the clinical need to run obscure platforms.
Closes #8848
|
|
|
|
| |
FFmpeg recently changed these to be const on their side.
|
|
|
|
| |
fixes #8768
|
|
|
|
|
|
|
|
| |
This fixes audio encoding crashing under ASan.
When extended_data != data, FFmpeg copies more pointers from
extended_data (= the number of channels) than there really
are for non-planar formats (= exactly 1), but that's not our fault.
Regardless, this commit makes it work in all common cases.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
Without the explicit signal the call to pa_threaded_mainloop_wait()
will not return as soon as possible.
Fixes 4f07607888541e6eb40fc5c3a1edfeb84aacb0f7
See #8633
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes the behavior of all control messages consistent,
fixing an inconsistency that has been with us since
4d8266c739915184d3787d7ab727ac03378b341b - which is the initial
rework of the polyaudio AO into the pulseaudio AO.
Muting the stream also directly triggers an update to the OSD.
When not waiting for the command completion this read of the mute
property may read the old state. A stale read.
Note that this somehow was not triggered on native Pulseaudio, but it is
an issue on Pipewire.
See https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/868
|
|
|
|
|
|
|
| |
The input buffer size was fixed, but the required size depends on the
speed. Now the buffer will be resized dynamically.
Fixes #8081
|
|
|
|
|
|
|
|
|
| |
Set pcm state to SND_PCM_STATE_XRUN in case -EPIPE is received,
and handle this state as per the usual logic.
This way snd_pcm_prepare gets called, and the loop continued.
Inspired by a patch posted by malc_ on #mpv.
|
|
|
|
|
| |
Based on ao_play_data's assert, we are always expected to give
non-default values back from an AO's get_state.
|
|
|
|
|
| |
It makes no sense to instruct the AO to start the pull callbacks
when we know there's nothing to play (only affects pull AOs).
|
|
|
|
|
| |
Pull based AOs might want to call ao_read_data() inside start().
This fixes ao_opensles deadlocking.
|
|
|
|
| |
And I think "partial write" is easier to understand than "short write".
|
|
|
|
|
|
|
|
|
|
|
|
|
| |