Commit Graph

13 Commits

Author SHA1 Message Date
Tom Yan
e1b5587e9c libpulseaudio: further cleanup in the sles sink
s32le output is also now allowed
2018-08-16 14:40:57 +02:00
Tom Yan
fbc0d7ee54 libpulseaudio/mpv: set numBuffers to 8 for SLES
Apparently some Android builds/forks need it for Bluetooth audio.
It's a hardcoded default in the upstream AAudio implementation
anyway.

See the following for reference:
https://android.googlesource.com/platform/frameworks/av/+/android-8.0.0_r1/media/libaaudio/src/legacy/AudioStreamTrack.cpp#109
https://android.googlesource.com/platform/frameworks/wilhelm/+/android-8.0.0_r1/src/android/AudioPlayer_to_android.cpp#1680
https://android.googlesource.com/platform/frameworks/av/+/android-8.0.0_r1/media/libaudioclient/AudioTrack.cpp#488
2018-08-07 12:17:32 +02:00
tomty89
6be3fd61e0 libpulseaudio: handle unlink properly (#2693)
Also clean up some more garbage.
2018-07-31 21:19:39 +02:00
Tom Yan
8025f606e9 libpulseaudio: always use u for userdata 2018-07-26 11:47:20 +02:00
Tom Yan
9006223783 libpulseaudio: avoid some assertion failures due to race condition 2018-07-26 11:47:20 +02:00
Tom Yan
36c4ffb4bf libpulseaudio: make latency configurable 2018-07-26 11:47:20 +02:00
Tom Yan
83ba79c105 libpulseaudio: support suspend on idle
Turns out it's pretty easy to implement. Now the buffer queue will
stop requesting for data once the sink is suspended on idle. No
more power wasted.

Note that it is natural that there would be a bit of extra delay
when resume playback after the sink is suspended. In case it is
wanted to be avoided, make sure the module-suspend-on-idle is not
loaded.
2018-07-26 11:47:20 +02:00
Tom Yan
6144f8653f libpulseaudio: fix distortions occur with multiple sink inputs 2018-07-26 11:47:20 +02:00
Tom Yan
fd69382e37 libpulseaudio: rewrite sles sink
This should work way better than the old code, as it makes use of
the buffer queue callback to do Enqueue(), which might be the only
nice/right way to use OpenSLES on Android. CPU usage is low and
RAM usage seems reasonable. No memory leak noticed. Tested with
mpv on my Oreo phone (wired and Bluetooth).

The latency was chosen base on Bluetooth audio requirement on Oreo.
Shouldn't be hard to make it configurable as a module param in the
future.

The new code has a known downside though, that is it doesn't really
support sink suspension, as in, silence will kept being written
to the audio device even when the sink is suspended, which may have
certain impact to battery time.

It's probably possible to catch the state change of the sink and
notify the buffer queue about it. It's just I don't want to bother
digging further at the moment.
2018-07-26 11:47:20 +02:00
Fredrik Fornwall
09b12bba65 libpulseaudio: Update from 11.1 to 12.0 2018-06-21 22:31:58 +02:00
its-pointless
2e68ba7f34 pulse segfault fixed and changed default config (#2044) 2018-02-01 22:24:34 +01:00
its-pointless
1218ccc6c1 updated sles module 2018-01-16 14:15:04 +01:00
its-pointless
ffdcb8fc0e opensles output for libpulseaudio from @twaik (#1968) 2017-12-29 00:52:17 +01:00