During the transition to Treble, "device connect" / "disconnect"
parameter was erroneously attributed to audio streams. This
issue got fixed in Audio HAL V4.0, but AudioParameter file
was still using incorrect name for the constant.
Test: make
Change-Id: I4056ad9e98af6dadd017d22bc4bde031cac75631
Merged-In: I4056ad9e98af6dadd017d22bc4bde031cac75631
This allows to replace direct reading from HAL with obtaining
audio data from another source.
It should be possible to encapsulate reading from FastCapture
in the same manner, but it's not required for direct inputs.
Test: make
Change-Id: I3f005583410cc9c5d4b07c127d95e236abb4a85f
This code logically belongs to PatchRecord because it emulates
obtaining recorded data from a client.
Test: make
Change-Id: Icba4e33d9d0ca57e6ad964aaf3209e7db766f284
Enable static check for audio arrays so that it can be earlier to catch
if there is any error within the audio arrays.
Bug: 135621476
Test: make
Change-Id: I598311e0853ca77dff83fb97974e534adb238567
Fix issue where RecordTrack silencing didn't silence the
full buffer: the memset to 0 was using the RecordThread frame
size, not the RecordTrack frame size.
OP_RECORD_AUDIO was only enforced at the start of a recording
which would fail if not granted. This patch silences the recording
(i.e. silence is recorded instead) when it is lost, and undoes that
when granted again. This requires:
- propagating the package name of the client to the RecordTrack class
- registering an appOp callback in RecordTrack (through a new
OpRecordAudioMonitor class) to (un)silence the recording
- update the isSilenced() method to take into account the appOp.
Bug: 138968594
Bug: 138636979
Test: run app that records audio, then "adb shell appops __pack_name__ 27 2"
and verify recording is silent after that.
Change-Id: Ib33f5b592185a67204997213bab1ac2594d90d37
(cherry picked from commit ddf87effa4)
Merged-In: Ib33f5b592185a67204997213bab1ac2594d90d37
This change renames the IMemory raw pointer accessors to
unsecure*() to make it apparent to coders and code reviewers
that the returned buffer may potentially be shared with
untrusted processes, who may, after the fact, attempt to
read and/or modify the contents. This may lead to hard to
find security bugs and hopefully the rename makes it harder
to forget.
The change also attempts to fix all the callsites to make
everything build correctly, but in the processes, wherever the
callsite code was not obviously secure, I added a TODO requesting
the owners to either document why it's secure or to change the
code. Apologies in advance to the owners if there are some false
positives here - I don't have enough context to reason about all
the different callsites.
Test: Completely syntactic change. Made sure code still builds.
Change-Id: I5fb99aa797c488406083178a6b05355d98710d3b
Seeing requested / obtained buffer frame counts in trace
helps to identify discontinuities in software patch pipeline.
There is no need to trace requested frame count for PatchRecord
as it always requests as much as possible ("-1" frameCount).
Bug: 117564323
Test: with software patch active,
external/chromium-trace/systrace.py audio
Change-Id: I78400f6cc1d1940b3290fb23bb1aacfbffe042e5
Add the possibility to silence a particular AudioRecord
client rather than silencing all clients sharing the same UID.
Test: AudioRecordTest#testRecordNoDataForIdleUids
Change-Id: Ic472045cd45c7222ca3a88ccf131435fd1e26475
Fix issue where RecordTrack silencing didn't silence the
full buffer: the memset to 0 was using the RecordThread frame
size, not the RecordTrack frame size.
OP_RECORD_AUDIO was only enforced at the start of a recording
which would fail if not granted. This patch silences the recording
(i.e. silence is recorded instead) when it is lost, and undoes that
when granted again. This requires:
- propagating the package name of the client to the RecordTrack class
- registering an appOp callback in RecordTrack (through a new
OpRecordAudioMonitor class) to (un)silence the recording
- update the isSilenced() method to take into account the appOp.
Bug: 138968594
Test: run app that records audio, then "adb shell appops __pack_name__ 27 2"
and verify recording is silent after that.
Change-Id: Ib33f5b592185a67204997213bab1ac2594d90d37
Bug: 134042971
Test: NTS case AUDIO-026-DDP51-TC3-NonTunnel / Tunnel verify volume starts at 0 when fading in
Change-Id: I8ee4444e3ceb2d8a0ceb979fada10c644b5db35c
Add missing calls to ATRACE for direct writes and frames ready
on direct thread.
Test: <start direct output>
external/chromium-trace/systrace.py audio
Change-Id: Iee6ea72442f9902819628735e19cce0ba1546165
Split AudioMixer into the base part which doesn't rely on
the framework and can be used in vendor code and the derived part
which is intended to be used by Audioflinger.
Test: A/B compare output from test scripts, manual testing on the phone
Change-Id: I24c390f67f20baa8109902099359ca6e34eebcfd
- Remove unused dependencies on libnbaio and libnblog;
- Move dependencies on libaudiohal and libsonic to libaudioprocessing
as AudioMixer implementation does not use them.
Test: make
Change-Id: I258a450725bdacb4fcf437b6f86582d51d40e622
During the transition to Treble, "device connect" / "disconnect"
parameter was erroneously attributed to audio streams. This
issue got fixed in Audio HAL V4.0, but AudioParameter file
was still using incorrect name for the constant.
Test: make
Change-Id: I4056ad9e98af6dadd017d22bc4bde031cac75631
Also use audio HAL volume APIs for fast tracks opened on a
specific VoIP RX output. Previous implementation was only
considering regular tracks.
Fix regular track implementation to send volume before it is altered by
effect volume controller if present.
Also only reflect stream and master volume in volume sent to HAL:
track and shaper volumes are still applied by mixer.
Bug: 133829194
Test: VoIP call
Change-Id: Id5025a1f67df0eab7391056715047a23429e0f02
Prior to this patch, VolumeShaper state for direct
and offloaded tracks did not appear to advance for master mute
and all tracks did not appear to advance for stream mute.
Test: atest android.media.cts.VolumeShaperTest with and without muting
Bug: 133354056
Change-Id: I589f4e0837124a185509718f1175e06102a1be96
Do not check app ops for audio playback for services in
general, not just for audioserver or root user.
Bug: 133178934
Test: audio smoke tests
Change-Id: I3a34e6418dc750cc12ed35d465ca8874b0ce0f73
Add check for privileged permission if attributes
flags BYPASS_INTERRUPTION_POLICY or BYPASS_MUTE are set.
Bug: 131873101
Test: Manual smoke tests for audio playback.
Test: Emergency cell broadcast in
Change-Id: I073cf669f606f0d081ff5c8d19f39b5e12efe297
commit 74e01fa7 did not bypass app ops policy when flag
AUDIO_FLAG_BYPASS_INTERRUPTION_POLICY is set.
Bug: 131873101
Test: repro steps in bug
Change-Id: Idbce26cfdcddbb7a2ae8702ce3d135ef5a69f047
1. Return error when remote submix device is null. Remote submix device
could be null in some case, such as device address error. Returning
error to avoid native crash.
2. Unregister policy mix if set device connection fails. In that case,
get input device could fail when policy mix is not found.
Bug: 131906484
Test: Manually
Change-Id: I03ab2bf217341b672c14adfba96d92ad9b453b01
When the mixer status was MIXER_ENABLED twice in a row
zeroes were forced to the audio sink.
Test: aaudio test write_sine_callback -pl -n1 -r44100 -s20
and then use rapid volume changes.
Bug: 131767115
Change-Id: I24b41084138210c63e8c551ae4a5f3adddb9e607
Do not force audio device changed callback when the client
(AudioTrack or AudioRecord) registers to AudioFlinger but only when
it starts playback or capture. Doing so prevents a spurious callback
happing at registration time where a stale device
(previously selected by AudioFlinger thread) but irrelevant to this
client is indicated. This causes a disconnection of AAudio streams
despite no real device change.
Bug: 128630993
Test: CTS: android.nativemedia.aaudio.AAudioTests, android.media.cts.RoutingTest
CTS Verifier: Audio Input/Output Routing Notifications Test
Change-Id: Ia7f1d11490989b0287c97479466c1c07a223aab3
The client must provide a unique Record ID (RIID) when creating
an AudioRecord. This RIID is passed down to AudioInputDescriptor
in AudioPolicyManager which sends configuration updates
via IAudioPolicyServiceClient callback.
By supplying RIID, the Audio Service can coalesce start / stop
events coming from clients (apps) with recording configuration
update events.
For AAudio MMap clients everything is handled at the server
side because they correspond directly to audioserver objects.
Bug: 123312504
Test: android.media.cts.AudioRecordingConfigurationTest
AudioRecordTest#testAudioRecordInfoCallback
MediaRecorderTest#testAudioRecordInfoCallback
manual testing using Oboe and Solo test apps
Change-Id: I3d32241752d9a747736606dc4cb1e068e6b7aa3b
OpPlayAudioMonitor was constructing a weak pointer to itself
in the constructor. This practice can lead to crashes due to
race conditions vs object destruction. This code is now moved
to onFirstRef method which is called when at least one strong
reference exists.
This change also reduces the number of created OpPlayAudioMonitor
objects by using a factory method.
Bug: 130038586
Test: enable / disable DND mode
Change-Id: I22e63a883ebaa25b9c96e79271bb9693b5ed75cd
AudioFlinger used to reject requests for the low latency FAST
path when the capacity was != mPipeFramesP2.
But if the caller requests < mPipeFramesP2 than we can just bump it
up to mPipeFramesP2 because the API allows that.
For example, on Pixel, mPipeFramesP2 is 4096
Bug: 80308183
Test: adb shell input_monitor_callback -pl -b4000 -m1
Test: should see performance mode 12 for LOW_LATENCY
Change-Id: I987067910de3194fb52370d0ea1626cffad6248c
Add pre processing effect management for concurrent capture scenarii.
When several clients on the same input stream have enabled audio effects,
only the effects attached to the top priotity client are active.
Other effects are suspended.
Add AudioFlinger API to suspend/restore audio effects build on top
of exisiting internal effect suspend mechanism.
RecordThread now supports more than one effect chain.
AOSP pre processing implementation supports more than one effect session
per input.
Refactor AudioPolicyManager::closeAllInputs() to call closeInput() on
all inputs instead of partially duplicated code.
Bug: 128419018
Test: make
Change-Id: I685286da4c2905a8894a4354679f9787b1400621
AudioPolicy used to hide activity of stream patch to prevent changing
the volume.
This CL replaces the filtering of the stream patch activity on the policy
by a full volume range within audio flinger.
It updates also product strategies example for automotive to add associated
strategy and full range volume.
Bug: 130284799
Test: make
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Change-Id: I6e77dc2cbed0289f0a1341f7597b1c25abee5f7d
Remove effect specific mutex (mEffectLock) in AudioPolicyService: Due to
concurrent capture (among other reasons), it is necessary that the audio
policy manager state preserved by mLock includes audio effects
registration and enabling.
Moved all audio policy API calls from audio flinger out of locked regions
for audio flinger, thread and effects mutexes to avoid cross deadlocks
between audioflinger and audio policy manager:
- centralized audio policy API calls in EffectModule::updatePolicyState()
- the enabled state now reflects the state requested by the controlling
handle, not the actual effect processing state: a suspended effect is
now considered enabled.
A new audio policy manager API moveEffectsToIo() is added to atomically
handle moving effects to a new input or output without having to call
unregister > register > enable sequence.
Also fix assert in setStreamVolume to match volume group refactoring
in audio policy manager.
Bug: 128419018
Test: CTS tests for audio effects.
Test: manual tests with Duo calls, Play Music, Youtube, notifications
with and without Bluetooth and wired headset.
Change-Id: I8bd3af81026c55b6be283b3a9b41fe4998e060fd
Allow at most one effect chain with same sessionId on mPlaybackThreads.
Test: poc, CTS effect tests
Bug: 123237974
Merged-In: Ide46cd23b0a9f4295f0dca2fea23379a76b836ee
Change-Id: Ide46cd23b0a9f4295f0dca2fea23379a76b836ee
(cherry picked from commit 1631f06feb)
(cherry picked from commit f963b2bfda)
It's possible that tracks with the same session id running on various
playback outputs, which causes effect chain being created on the same
session twice. As a result, the same effect engine will be released
twice as the same context is reused.
Output that has effect chain with same session id is more preferable.
Test: No regression with Play Music and Effects
Bug: 123082420
Bug: 123237974
Merged-In: I690ea3cb942d1fdc96b46048e271557d48000f43
Change-Id: I690ea3cb942d1fdc96b46048e271557d48000f43
(cherry picked from commit 9aeb1770d4)
(cherry picked from commit 5945746bca)
The haptic intensity for fast track should be initialized, or it will be
HAPTIC_SCALE_MUTE by default, which may result in no haptics.
Bug: 130312331
Test: play haptics stream with FastMixer enabled
Change-Id: If5a1ea12c563c4af1422b2e32451b80e69d2ef58
The haptic data will be partially interleaved at the end of the buffer
after processing audio mixing. When processing audio effect, only audio
data will be handled. In that case, haptic data will be missed if there
is any audio effect. Copying haptic data directly from audio effect in
buffer to out buffer could help solve the problem.
Bug: 129956425
Test: play haptic with audio effect.
Change-Id: I2b48bb43bec10167d4eacbcaa5c27959e0d44c32
Fix a cross deadlock between thread and effect chain mutex introduced by
commit 446f4df5.
Bug: 130044136
Test: start/stop audio capture for voice communication in 2 different apps
Change-Id: I23bdbd203476d2bc0b3d8d87ab66e1a9c00f7bcd
Mute/unmute tracks according to changes in OP_PLAY_AUDIO for
the current usage.
In audio policy: always assign AUDIO_STREAM_ENFORCED_AUDIBLE
to sonification tracks with AUDIBILITY_ENFORCED flag.
Do not mute tracks from root / audio server.
Do not mute UI sounds on AUDIO_STREAM_ENFORCED_AUDIBLE
stream type.
Bug: 112339570
Test: enter DnD, play notifications, verify not heard
Change-Id: Ia5f1118481cf0573101acf2092fbd0ce2cf8c038
Previously, ThreadBase::mLock was only acquired inside
ThreadBase::dumpBase method. That means, dumping of fields of
descendant classes, tracks, and effect chains was performed
without holding ThreadBase::mLock.
This patch changes the way of how dumping is driven. Now only
ThreadBase has a public 'dump' method which is non-virtual.
This method takes the lock and dumps all the fields, tracks, and
effect chains. It calls virtual methods for dumping the contents
of descendant classes.
Bug: 118842894
Test: compare audioflinger dumps A/B
Change-Id: Iaafc75d13935a6a92ca37f9567b7ac7c31374b3e
Fix missing log line in the case when there are no effects in
the chain.
Bug: 118842894
Test: adb shell dumpsys media.audio_flinger
Change-Id: I31fe4760caa61610de4f143b3a6ae185efb55baa
The technique of bouncing lock attempts does not work well
in the case when another lock has higher priority and acquires
the lock frequently. Timed lock works better in this case
because the acquiring thread is then put in a queue and gets
the lock as soon as another thread releases it. The wait time
in the worst case (deadlock) is the same.
Bug: 118842894
Test: Run VOICE_COMMUNICATION capture + AEC effect, dump audioflinger
Change-Id: Idc4fc2b6f5faf6988979f9354dd92441af33e600
This makes the libaudioflinger build deterministic between
devices.
A few notes:
- the include-path-for include is obsolete, so it was removed
- the AUDIOSERVER_MULTILIB use was removed, as I believe it's
unused
Bug: 121208203
Test: make
Change-Id: I08eb0d7f53f1fbcef3e14faa3ea75b5326383ef8
Not required and do not assume it.
Test: no regression with atest CtsNativeMediaAAudioTestCases
Bug: 128615806
Change-Id: I29d77d01aad417cc6aa6f882b7bc0812775e13c6
Output error messages on failure.
Test: CTS effects, dedicated test with bad sessionId
Bug: 128528126
Change-Id: Icdd306c30e8eb818b0a27d6463fa785bac2fb707
Allow at most one effect chain with same sessionId on mPlaybackThreads.
Test: poc, CTS effect tests
Bug: 123237974
Change-Id: Ide46cd23b0a9f4295f0dca2fea23379a76b836ee
The code for clearing software patch connections was missing
a check for a null track pointer.
Bug: 126789266
Bug: 128269566
Test: see repro steps in b/128269566
Change-Id: Ice6887622d5fa2fa3198ce15146bff3cb05f7451
This was not efficient and leaded to an assert in obtainBuffer.
I'm not sure which condition can lead to a getNextBuffer of size 0,
but it has been observed and is not forbidden by getNextBuffer
documentation.
Test: atest android.media.cts.AudioPlaybackCaptureTest#testCaptureMediaUsage
Bug: 111453086
Change-Id: I5accf7c1d488ff4686272588329bab71d64f67cd
Signed-off-by: Kevin Rocard <krocard@google.com>
Otherwise incorrect state might be hidden.
Also: Unify devicesToString() and deviceToString() to toString().
Miscellaneous cleanup of replicated functionality.
Test: Basic audio sanity, AF and APM dumpsys check
Change-Id: Ic81167e2d2dbfcca881f0898764cf886215c217c
Implemented for threads that read/write PCM.
Test: audioflinger dumpsys Play Music, Movies, Video Recording
Bug: 114112762
Change-Id: I866a8b639d18426633088d6a03d9135f4ee09fd3
The implementation uses IBase::debug() method which can write
debugging info into the provided file descriptor (same model
as used for devices and streams).
Bug: 69939533
Test: adb shell dumpsys media.audio_flinger
Change-Id: I02a74b51977d105edf6f7e624ea26f866c965708
Use the constant from IExternalVibratorService.
Bug: 124318236
Test: play audio-haptic coupled file
Change-Id: Ice2ac13d0f6a6a749bb6243230524336144fa5f4
Track::interceptBuffer failed to write all the audio if the source BP
could not returned the requested buffer size.
This is actually normal when the source circular buffer wraps around.
Handle it by retrying if the first buffer is too small.
Test: adb shell audiorecorder --target /data/file.raw
Bug: 111453086
Change-Id: I42a7962449a0f075909a29f5f8f5ba82ca1d0085
It's possible that tracks with the same session id running on various
playback outputs, which causes effect chain being created on the same
session twice. As a result, the same effect engine will be released
twice as the same context is reused.
Output that has effect chain with same session id is more preferable.
Test: No regression with Play Music and Effects
Bug: 123082420
Change-Id: I690ea3cb942d1fdc96b46048e271557d48000f43
In order to avoid track to be added to tracksToRemove
redundantly, merge the adding operation under exclusive
condition check.
This can make sure the add can happen only one time within
one prepareTracks iterator.
authored-by: Zhou Song <zhous@codeaurora.org>
Test: AF active track removal with audio playback pause
Bug: 123375253
Change-Id: If35348af2144a28b84241e1cb93f497d5eec9a8a
If a track is paused right after start before it gets a chance to mix
the first frame. Don't apply volume ramp if it resumes later.
Test: Basic audio sanity. Partner CL.
Bug: 123063164
Change-Id: I969ff1b6edce8faf77f2cdc481db9c1e3ef6d3dd
The test case here involves two applications both of
which play the same music clip. When the 2nd application
ends playback, the 1st application must resume playback
where it left off. But it is possible that the new
AudioTrack.start() command from the 1st application is processed
after the 2nd application has paused and terminated.
This will prevent a flush to clear any state before playback
of the 1st application can resume. Direct thread thus
stays in pause state indefintely.
Issue unconditional flush for direct thread when a new
track is added to a direct output.
Test: partner CL submit, check compilation
Bug: 123082418
Change-Id: I33d36db35358a1b3b89dd5b2b8cb4db1f9c6d4a0
* changes:
Propagate track status to interception patch track
Add secondary output to audio tracks
Audioflinger: add timeout to PatchTrack
Audiopolicy: Move AudioPolicyMixCollection in helper function
Add MIX_ROUTE_FLAG_LOOP_BACK_RENDER
Clean up logic for FastTrack AudioMixer track initialization.
Test: SoundBar menu scrolling, AudioFlinger tee
Bug: 119284313
Change-Id: I551d9d54d82e0029a49c6481ba8669093359d6d1
The secondary are returned from mixes (from DAP loopback&render),
from getOutputForAttr.
All getOutputForAttr* of the stack are update.
Internal getOutputForAttr use descriptor, external one use handles.
The secondary output are saved in each track and the track is
invalidated if the list of secondary output changes.
In audio flinger, create a pair of recordTrack & patchTrack to pipe
the intercepted audio audio to the secondary output.
Test: adb shell audiorecorder --target /data/file.raw
Bug: 111453086
Change-Id: Id6523d9e383c15a0e39313d5f355df809b7e72fe
Add support for timeout that was only supported by PatchRecord.
This is implemented by moving the timeout and common code in a base
class.
Also remove PatchRecord useless virtual inheritance of RecordTrack.
Test: adb shell audiorecorder --target /data/file.raw
Bug: 111453086
Change-Id: I833148f31a311ca41092be1d7e2d170f086322c5
Signed-off-by: Kevin Rocard <krocard@google.com>
Overflow is expected when 32-bit counter wraps after several hours.
So prevent sanitization from causing a crash.
Bug: 122986677
Test: run a stream for more than 12 hours so the position overflows
Change-Id: I0f397f193288c2493a2036f67849bb12a9c9f221
The haptic playback should be controlled by vibrator service. Via the
interface, audio server could notify vibrator service about starting or
stopping haptic playback and get vibrator intensity from vibrator
service. Vibrator service could call mute/unmute to control the haptic
playback.
Test: Manually
Change-Id: Iad24813977e4dea0d67a91f8f8b390a016ce4ca2
Use the same logic in VibrationEffect.scale to control the intensity of
haptic playback in audio framework. Note that as the maximum amplitude
of vibrator is 255, convert the haptic data to pcm_8_bit before doing
scaling.
Test: Manually
Change-Id: I6136d27c9255a215834b6e3092aa8ad696fbae04
Test: Change Balance through Settings, play audio
Bug: 28390736
Co-author: Ed Savage-Jones <edward.savage-jones@sony.com>
Change-Id: I0169b436ccbaa5628584d9f4954dd7c76d021aae
Add new effect flag to monitor requested volume from
audio framework.
Pass requested volume directly if effect is volume monitor,
and others still follow an original rule by volume controller.
Bug: 123251705
Test: On/off equalizer on spotify/google music.
Switch songs with equalizer
Attach an effect with EFFECT_FLAG_INSERT_ANY,
EFFECT_FLAG_INSERT_FIRST,
EFFECT_FLAG_INSERT_LAST
and check received volume.
Change-Id: I01632bebb32aa6f921c964536039d43859ae3632
Signed-off-by: Jasmine Cha <chajasmine@google.com>
This commit adds the following audio capture sources:
- AUDIO_SOURCE_VOICE_PERFORMANCE: for real time live performances like Karaoke.
- AUDIO_SOURCE_ECHO_REFERENCE: for capturing the reference signal to suppress by an echo
canceller. Protected by privileged permission CAPTURE_AUDIO_OUTPUT.
Also added device AUDIO_DEVICE_IN_ECHO_REFERENCE selected when the requested
capture source is AUDIO_SOURCE_ECHO_REFERENCE.
Bug: 118203066
Test: CTS tests for audio capture
Change-Id: Ieb159ea82a7b81acf762506a44e24ec80111609f
In PatchPanel::createAudioPatch() verify that when creating a patch with
an output or input mixer as source or sink, no patch with the
same output or input mixer remains in the patch list.
This will prevent a call to releaseAudioPatch(() received
later with a stale patch handle due to delayed request to clear current
output or input routing.
Test: play music and insert USB headset.
Change-Id: I9417bf061f5ef1d93cf3871a9ed51ee2b6ae62ef
When opening an input stream for a software patch, pass in
the downstream destination device info. This helps the intermediate
module to set up any device-specific processing.
Note that the intermediate module must implement Audio HAL V5.0
in order to be able to receive this information. It's not available
on the legacy audio HAL API either.
Bug: 120859615
Test: make
Change-Id: I542a47d2c299fe19f576d5f5c2b237cc00ae5b93
In case of creation of AudioPatch with the same device type but a different
device id (typically: a device has been connected / disconnection, so
removed and re-attached to its corresponding module, a new Id is assigned),
the cache configuration of the clients is not updated.
If the client calls getRoutedDevice, the id will not be up to date and even
may refer to unknown port id.
Test: as follows:
1 / Calls setDeviceConnectionState AUDIO_DEVICE_OUT_HDMI state=1 mame=y_dummy_hdmi @=my_dummy_hdmi
2 / Plays explicititely on this device (by getting the id
AudioSystem::listAudioPorts
2 / Calls setDeviceConnectionState AUDIO_DEVICE_OUT_HDMI state=0
3 / Calls setDeviceConnectionState AUDIO_DEVICE_OUT_HDMI state=1 mame=y_dummy_hdmi @=my_dummy_hdmi
Plays explicititely on this device (by getting the id
AudioSystem::listAudioPorts
4 / Calls AudioTrack->getRoutedDeviceId()
The id shall match the second one, NOT the first one
that does not exist any more
Change-Id: I608ed8d78907b5ea1c9b6ef13c6cbfe528d88f44
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
When trying to play with haptic channel mask, use adjust channels
buffer provider to make the haptic channel the same as the output one.
If haptic playback is supported, use adjust channel non destructive
buffer provider to output haptic data to the end of the sink buffer.
Otherwise, haptic data will be ignored.
Test: Manually
Bug: 111454766
Change-Id: Ic5f780de48c1e71de6ba5c4774d1ed2e9c8c51a0
When haptic playback is supported according to audio policy
configuration file, try to open the output stream with haptic channel
mask. When trying to creat a track with haptic channel mask, use haptic
output if it is available.
Bug: 111454766
Test: Manually test
Change-Id: Ia8c70dd7f602a134d0509630eb734b8c540dea7d
This reverts commit 4c1ef4b64d.
Reason for revert: b/120588242
Bug: 120588242
Change-Id: Iac41f371cb739c54d5ce519232688bebe2285c72
Test: Launch QSB and capture from mic icon
exitStandby() was crashing if headphones were
unplugged between the open and start of a MMAP stream.
Bug: 120564294
Test: see repro steps in bug
Change-Id: Ic42743682ffeb48f2869eaa90581b4e4f7fcb1ab
Implement concurrent capture in audio policy manager:
- Attach AudioRecord client to already opened input when possible
instead of systematically opening a new input for each client.
- Always allow inputs to start even in case of concurrency.
- Clients are selectively silenced based on their app state by audio
policy service.
- In case of concurrency on a given input stream, device and source is
chosen based app states and source priority.
Bug: 111438757
Test: Manual capture tests with solotester and Camera, Assistant and Duo
Test: CTS tests for AudioRecord
Change-Id: I302710ff545f67361d9aca89e81de40771ce7fb0
Return the port ID allocated by audio policy manager instead of the
internal track ID allocated by audio flinger when an AudioTrack or
AudioRecord is created.
This information is more useful for logs and allows to associate information coming
from audiopolicy manager with a specific client instance.
Bug: 111438757
Test: Manual playback and capture tests
Change-Id: Ib467d8fcc34d9a8aa7bcaac0770a741982b847c5
The Java AudioTrack interface has a setPresentation API. This
calls the setParameters API in IAudioTrack. However, this does
not eventuate into a call into the android.hardware.audio@4.0
IStreamOut selectPresentation API.
Add selectPresentation API to IAudioTrack and call down to the
android.hardware.audio@4.0 IStreamOut selectPresentation API.
Translate into calls to setParameters API for legacy HAL
interfaces.
Bug: 63901775
Test: compile
Change-Id: Id634a107f3f93ab18dc80d2bd0af67bda35e859f
Test: A/V sync of direct/offload DD+ non HW A/V sync playback thread
through MSD, and MSD -> Audio HAL patch in DD+ non HW A/V sync
mode.
Change-Id: I244e9fda9741fe9a9ea913f39901654ebefb973c
(cherry picked from commit 8729c2eb3eabda3f6b6985a113bd2022b5b379c9)
Increase allowed downstream latency to 5 seconds.
Sometimes software patch might cause >1 second of latency.
Bug: 63901775
Test: MSD prototype
Change-Id: Ie111fa8b87bc7694ef787c6c4b1deca81bda2abb
This case is generally not encountered; we are fixing this
to ensure correctness for future code.
Test: No regression with MP3 effects and solo tester
Bug:118775810
Change-Id: I016e23101d42ffeee1e66102b6f6276f17c47684
Ensure all channels are accumulated.
Test: Use 4ch USB device, play MP3 with effects, see bug
Bug: 115693755
Change-Id: Ic1eb04dcff34284b3fff67266874eca41a43e523
Handle spurious wakeups in stop.
Handle track invalidation.
Clarify state.
Note: start and stop should not be called simultaneously from different
binder threads.
Test: audio sanity
Bug: 117303225
Change-Id: I587d9cda7b0eac5215eb6a88f93ee08e396e3ef9
Avoids race condition where APM::stopOutput is called after
APM::releaseOutput.
Test: audio sanity
Bug: 112067674
Change-Id: I244267d4a157078961589649b1e184206ee23248
There is a suspicion that dumping HAL state for a recently closed
input stream can hang forever, blocking audioflinger and stucking
system boot.
In order to verify, we disable this dumping to see if it would
help with presubmit bots.
Bug: 116211629
Test: see steps in b/116211629#9
Change-Id: I189461187a2310c213278cc2b3af2469d1896965
The more recent work that this was supposed to become is reflected in
dumpsys media.log, so this commit removes some code clutter that is not
used anymore.
Other Changes:
- Use std::make_unique for creating unique_ptr objects
Test: build, dumpsys media.audio_flinger
Bug: 68148948
Change-Id: I4841e118c2cdee4ada4c6cdc0fff1ec2e12b38c4
Dummy NBLog::Writer in FastThread must not be stored by value
because it's a RefBase descendant. Storing it by value causes
a diagnostic output from ~RefBase because no strong
references to it ever exist. In future this will cause a crash.
Test: verify there are no "RefBase: Explicit destruction" messages
in logcat
Change-Id: I95716ec8e29fdd9485ef64a3334cef49bf29bc96
Other Changes:
- added thread_params_t type to NBLog
- rearranged ordering of macros in TypedLogger.h
Test: dumpsys media.log with --json, --pa, and --plots options
Bug: 68148948
Change-Id: If97714271a085a99bba0ab3ae0c268a9f407f053
Add FALLTHROUGH_INTENDED for clang compiler.
Bug: 112564944
Test: build with global -Wimplicit-fallthrough.
Change-Id: I8875bc7ed073aae84d5df97eb39c8c745ca627ef
NBLog.cpp was deleted and split up into Entry.cpp, Merger.cpp,
Reader.cpp, Timeline.cpp, and Writer.cpp. NBLog.h was split up into
Entry.h, Events.h, Merger.h, Reader.h, Timeline.h, and Writer.h. NBLog.h
now includes all of these new headers except Merger.h, which is managed
exclusively by MediaLogService.
Other changes:
- changed NBLog from a class to a namespace
- changed NBLog::thread_info_t.type to enum and replaced magic numbers
- fixed some fragile build dependencies in libaudioclient and medialog
No other changes were made, and all functionalities that existed prior
to this commit remain the same.
Test: build, dumpsys media.log
Bug: 68148948
Change-Id: I1ce6dcb7b30d004f90584edfad7103a89f7bab0c
* changes:
AudioRecord: Add client side track id for logging
AudioTrack: Add client side track id for logging
AudioFlinger: Use track ids in log messages
AudioFlinger: Replace track name with id