1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-03 01:31:53 +02:00
Commit Graph

1873 Commits

Author SHA1 Message Date
Thomas Guillem
e41b435304 audiotrack: don't use DynamicsProcessing with passthrough
Fixes #25921
2021-07-20 07:56:33 +00:00
Steve Lhomme
4e56e5cb16 aout: wasapi: fix variable shadowing
freq is also a global variable.
2021-06-27 20:24:34 +00:00
Thomas Guillem
50eaa2ad68 audiounit_ios: set the mute_set callback from start
Fixes inconsistency with the "mute" variable state.
2021-06-25 20:35:07 +00:00
Thomas Guillem
37af7083de coreaudio: fix channel reordering
The chans_to_reorder variable was reset after being set up. Channel
reordering was *not* needed for 5.1 and below, but was needed for upper
configurations.
2021-06-22 12:51:57 +00:00
Thomas Guillem
a9c6d33448 audiotrack: use DynamicsProcessing to increase the gain
This fixes a delay of up to 2 seconds when increasing the volume up to
100%.
2021-06-17 09:42:29 +00:00
Thomas Guillem
7315bc54f7 audiotrack: restore volume if audiotrack is restarted 2021-06-17 09:42:29 +00:00
Thomas Guillem
80d00edc0f audiotrack: save original volume
In order to re-apply the gain > 1.f when audiotrack is restarted.
Fixes #25833
2021-06-17 09:42:29 +00:00
Thomas Guillem
784a74bfb7 audiotrack: refactor AudioTrack_SetVolume 2021-06-17 09:42:29 +00:00
Thomas Guillem
1c9890f145 Revert "auhal: fix data race with VolumeSet"
This reverts commit dcb42685eb.

My bad ! This commit is useless, the code and the documentation were
perfectly clear:

"This callback may be called concurrently with time_get(), play(),
pause() or flush(). It will however be protected against concurrent
calls to start(), stop(), volume_set(), mute_set() or device_select()."
2021-06-17 08:13:53 +00:00
Zhao Zhili
06314d8c47 audio_output: Makefile.am: opensles_android depends on libandroid_utils 2021-06-11 07:47:35 +00:00
Zhao Zhili
43db858fbd opensles_android: conditional compile for native sample rate check
The android bug has been fixed since Android 5.0.
2021-06-11 07:47:35 +00:00
Romain Vimont
3716a7da5b config: remove remaining "advanced" flags
The config "advanced" flag was unused and has been removed by
6a7a137f7b.

It has been removed from many add_*() macros, but not all. Remove it
from the remaining macros.
2021-06-06 08:42:50 +00:00
Brad Smith
e94b04c8f8 sndio: fix crash when volume is adjusted while stopped
Set volume/mute function pointers when handle is freed, to ensure
sio_setvol() is not called on a freed handle. Fixes crashes when volume
is adjusted while playback is stopped.

Fixes #25796
2021-06-05 13:56:07 +00:00
Lyndon Brown
98a3ec2878 purge options made obsolete during v2.1 development 2021-05-29 11:02:18 +00:00
Thomas Guillem
dcb42685eb auhal: fix data race with VolumeSet
VolumeSet (called from any threads) was accessing the au_unit variable,
that is written and setup from the aout stream thread.

This also fixes possible crashes when changing the volume after a
failing Start().
2021-05-27 08:59:51 +00:00
Thomas Guillem
42937c984f auhal: reset au_unit in case of failure or when stopped 2021-05-27 08:59:51 +00:00
Thomas Guillem
f7c4d13f71 auhal: use ca_MuteSet
Fix data race with au_unit. Indeed, the aout can be muted from any
threads.

SPDIF playback can now be muted.
2021-05-27 08:59:51 +00:00
Thomas Guillem
929ce49097 audiounit_ios: use ca_MuteSet
Fix data race with au_init, leading to crashes, since the audiounit was
stopped from a different thread than the playback one. Indeed, mute
callback can be called from any threads.
2021-05-27 08:59:51 +00:00
Thomas Guillem
33a04f1c59 coreaudio: notify when the output is silence
It can be used as a hint to whether the buffer needs to be processed or
not.
2021-05-27 08:59:51 +00:00
Thomas Guillem
09de6e91d3 coreaudio: add ca_MuteSet()
This will write 0s from the render callback without touching at the
playback buffer state.
2021-05-27 08:59:51 +00:00
Lyndon Brown
d75459a35b remove unnecessary option longtext
where identical to shorttext, or near enough.

bad because:
 - wastes resources.
 - useless tooltips in prefs GUI (poor UX) - tooltip longtext should add
   something of value.
 - useless repetition of text in certain help output.

in some cases they differed only in full-stop, creating unnecessary extra
burden on translators.
2021-05-12 05:44:11 +00:00
Thomas Guillem
1d02d748ee coreaudio: fix sleep duration when the buffer is full
The previous calculation was wrong and could lead to two potential
issues:
 - Too much wake/sleep because the block remaining data is very small
 - Too long sleep, if the block is longer than the buffer size, that
   could lead to underrun

To fix this issue, use the same sleep calculation than wasapi.
2021-05-06 08:15:56 +00:00
Marvin Scholz
6ad7ac4c4b auhal: rename i_dev_latency_us to i_dev_latency_ticks
The type is actually vlc_tick_t, so in order to prevent
confusion, it should be named accordingly.
2021-04-27 17:32:05 +00:00
Marvin Scholz
90d73cd561 auhal: remove useless assignment 2021-04-27 17:32:05 +00:00
Marvin Scholz
c66ac48588 auhal: clarify usage for tick/host conversion helpers 2021-04-27 17:32:05 +00:00
Marvin Scholz
91e8de2ce8 auhal: fix types and names of frames to ticks conversion 2021-04-27 17:32:05 +00:00
Marvin Scholz
e1ca9f5a6e auhal: minor code-style changes 2021-04-27 17:32:05 +00:00
Marvin Scholz
d5eea6d206 auhal: do not return OSStatus directly from VolumeSet
We can't assume OSStatus is always an int.
2021-04-27 17:32:05 +00:00
Marvin Scholz
65eb38f15b auhal: use constants instead of magic fourccs 2021-04-27 17:32:05 +00:00
Marvin Scholz
050c788d2b auhal: use #include instead of #import in C files 2021-04-27 17:32:05 +00:00
Francois Cartegnie
408a9547db vlc_codecs: fix twocc mmreg.h collisions 2021-02-09 18:51:29 +01:00
Rémi Denis-Courmont
bab6469b0a Revert "pulse: use pa_stream_begin_write()" (fixes #25187)
Contrary to claims in the commit message, it introduces an extra memory
copy of all audio samples for no apparent reasons.

This reverts commit 0bdc7268dc.
2021-02-08 17:14:13 +02:00
Zhao Zhili
e4ff5993e2 android: utils: build utils as a lib
Make other targets depend on libandroid_utils instead of duplicate
the source code.

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2021-02-01 11:50:47 +01:00
Zhao Zhili
088c787680 opensles_android: report mute state
Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2021-02-01 11:39:40 +01:00
Thomas Guillem
9c3fe6ad2e audiotrack: refactor
Move special hack and deadline handling just after the write call.

No functional changes.
2020-12-01 12:16:05 +01:00
Thomas Guillem
ee40cfa0fa audiotrack: remove special handling of spurious wakeup
All code surrounding cond vars already handle spurious wakeup, there is
no need for that extra variable.
2020-12-01 12:16:05 +01:00
Thomas Guillem
66cfbf1f9d audiotrack: rename Play*() to Write*() 2020-12-01 12:16:05 +01:00
Thomas Guillem
1172edd04e audiotrack: remove useless play_time
This was mainly used for a previous hack.
2020-12-01 12:16:05 +01:00
Thomas Guillem
aa5eb1e02f audiotrack: clip the buffer size 2020-12-01 12:16:05 +01:00
Thomas Guillem
ce763c7541 audiotracy: always request the timestamp during the syncing phase
Don't wait 500ms between 2 requests if we don't have a valid timestamp.
2020-12-01 12:16:05 +01:00
Thomas Guillem
a726098adb audiotrack: wrap arround AudioTimestamp.framePosition
cf. https://developer.android.com/reference/android/media/AudioTimestamp#framePosition
2020-12-01 12:16:05 +01:00
Thomas Guillem
fef7f47672 audiotrack: rename function 2020-12-01 12:16:05 +01:00
Thomas Guillem
9d7e1825be audiotrack: avoid cast, use proper type 2020-12-01 12:16:05 +01:00
Thomas Guillem
61aca1f240 audiotrack: use an up to date buffer size
The size returned by this new method should not be different than the
one when used to configure audiotrack. Theoretically, it can be bigger.
2020-12-01 12:16:05 +01:00
Thomas Guillem
bf960b3679 audiotrack: handle getPlaybackheadPosition() invalid values 2020-12-01 12:16:05 +01:00
Thomas Guillem
560221d662 audiotrack: use AudioTrack.getLatency()
Instead of AudioSystem.getOutputLatency().

That way, we are sure the get the latency of the current output device.

Note: both methods are hidden and should not be used in favor or
AudioTrack.getTimestamp(). Unfortunately, getTimestamp() returns a valid
timestamp too late (after few seconds) or doesn't work with some phones.
Therefore, the usage of the hidden API is still needed as a backup plan.

cf. https://github.com/google/ExoPlayer/issues/5763

The android team allow the usage of this hidden API, waiting for a new
method in next Android versions.
2020-12-01 12:16:05 +01:00
Thomas Guillem
77ddd210ba audiotrack: rework delay logs 2020-12-01 12:16:05 +01:00
Thomas Guillem
9257d8a3f4 mmdevice: don't request gain from Open()
If "--volume-save" == false, then the volume is set from Open(),
therefore a gain is requested causing the vlc_mutex_assert() in
aout_GainNotify().

The gain should be notified from any aout callbacks, but not from the
Open().
2020-11-30 09:35:49 +01:00
Steve Lhomme
5d14661389 audio_output/mmdevice: report the mute status after it is set 2020-11-25 07:19:13 +01:00
Steve Lhomme
a300249e98 audio_output/winstore: report the default device to the core
For now we don't list other devices
2020-11-25 07:19:13 +01:00