Add a special case for keyStreamSupportedChannels and
keyStreamSupportedSamplingRates in ConversionHelperHidl::keysFromHal().
In this case, the query also contains a key=value pair specifying
the audio format to consider and it must be passed to the audio
HAL including the value.
Bug: 38326193
Test: verify format specifier is sent to HAL for supported sampling
rates and channels queries
Change-Id: I14ac40da920122ec0242ab027a2a4ac1d92381c8
Do not dup the fd received from HAL in StreamHalHidl::createMmapBuffer()
Bug: 38232872
Test: verify that MMAP streams can be opened and closed multiple times
Change-Id: I4813f78bd1ae1e8c705d1769a59710c9437bf246
This makes legitimate unix socket interaction between A2DP
module and the Bluetooth stack.
Implemented by allowing both "local" and "hidl" interface
wrappers to co-exist for devices and streams. A "hybrid" device
factory is introduced to create an appropriate implementation
of a device depending on the requested module name.
Bug: 37640821
Test: Play Music over BT headset
Change-Id: I5592961dd5b56840418fb122680979d11a261b6c
Fraunhofer's downmixer has additional buffering, this is incompatible
with how DownmixerBufferProvider used to process incomplete buffers.
Now the effects HIDL wrapper delivers frameCount updates in
audiobuffers to the server side. This fixes playback of multichannel
sound streams.
Bug: 36181621
Test: play 5.1 track from Play Music
Change-Id: I3b2cd097d61873c6ba329f1a574235ac88b21cac
These dependencies are only needed when building with
USE_LEGACY_LOCAL_AUDIO_HAL=true.
Test: adb shell lsof | grep libeffects
Bug: 33241851
Change-Id: I9c5eaf52d02c2101c55ea420780d0eb435d6493a
Replace LOG_ALWAYS_FATAL with ALOGE + exit, so the process still
restarts, but without a crash. This avoids confusion in bug triaging
and also helps to eliminate noise in bug reports statistics.
Bug: 36424777
Change-Id: I623cbc6a5b0d3351f849810dd67708d421efd61a
Test: reproduced error condition, checked that audio server restarts
HAL services are crucial for the audioflinger to work.
If for some reason device or effect factories can't be obtained,
log a error message and crash af. If the problem with obtaining
services is transient, restarting af helps to restore audio.
Bug: 36153684
Change-Id: Iec17a6c6e19650cf1d1de1ec30caf05753b9bce1
Test: reproed the bug, checked that af restarts and finds devices
EINTR can be returned in the case when a futex wait has been
interrupted by a signal. We need to retry in that case.
Bug: 35813113
Change-Id: I7eaee5298f5c0bc5cd62309c3fd8349ee3eae629
Test: make
Temporary change for investigating b/35813113. Need to test
the hypothesis that sometimes either legacy HAL, or the wrapper
reports more bytes written than being asked for.
Bug: 35813113
Change-Id: I6916d39e40d332b45a95aad05674009266e9cd96
Test: make
The 2-parameter version of processResult used to call the 3-param
version, and for that it was extracting the value from Result.
Now HIDL framework checks that it shouldn't be done if the transaction
wasn't OK.
Change the code so the 2-param version now only extracts the result
value if the transaction has been successful.
Bug: 35758741
Change-Id: I42cb5f5220e3a952b1c304840ccb3952c1707cd0
Test: make
include/camera -> camera/include/camera
include/media/audiohal -> media/libaudiohal/include
include/media/AudioResampler*.h -> media/libaudioprocessing/include
include/media/Audio*.h,IAudio*.h,IEffect*.h,ToneGenerator.h -> media/libaudioclient/include
include/media/EffectsFactoryApi.h -> media/libeffects/include
include/media/stagefright -> media/libstagefright/include
include/media/nbaio -> media/libnbaio/include
include/media/<rest of files> -> media/libmedia/include
include/cpustats -> media/libcpustats/include/cpustats
Added symlinks from old location to new ones
Bug: 33241851
Test: VNDK linked modules will need to add explicit lib dep.
All other modules should compile the same
Change-Id: I0ecf754a2132640ae781a3cc31428fb8c0bd1669
In binderized mode, the exact time of destroying the server object
is not defined. Enforce destruction by flusing hwbinder commands
queue after releasing the last client reference.
Bug: 35394629
Test: capture trace while following repro steps, verify that server-side object
gets destroyed
Change-Id: Id2756cab0f36ed4eaf290d3f5a1c750c9c75b1d3
Now that b/34772726 is fixed, we can remove this temporary code.
Bug: 34772726
Test: audio works on marlin
Change-Id: I1a268e7030d27b4e944659bd7d82ba321be13a6e
The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.
Test: builds; VTS HalAudioEffectHidlTargetBasicTest passes
Bug: 33844934
Change-Id: I5283bf7c2d0645bd38a16e92cab05103c1bcdf26
The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.
Test: builds
Bug: 33844934
Change-Id: Ifc6d297d0bbf7b28be560700c027c07acaa2466c
android.hidl.memory is being split into android.hidl.memory and
android.hidl.allocator since the former is a passthrough hal and the
latter is a binderized service.
Bug: 35327976
Test: hidl_test, lshal, youtube/camera works
Change-Id: I7a2e72dcd3721d2689eb7ef95f5b140ecc1c446f
Also convert "get config" effects command. It doesn't seem to
be really used, but nevertheless nice to have it called correctly
in mixed ABI case.
Change-Id: Ib29124933f5bfb8fd164f29a3059b3a5a3e8052b
Test: none
effect_config_t size depends on the architecture because it
uses pointers. Need to convert it into HIDL structure when
passing to HAL.
Test: build 64-bit af with 32-bit hal server in binderized mode
run Play Music, apply effects
Change-Id: I16ff9cd3accc00b6cb30f86418880ca5b749fdad
Having a timeout is causing issues on hal driver thread startup.
If thread startup is delayed, then eventflag wait exits with
timeout. This leaves fmqs in an intermediate state, and a pending
wakeup for the server enables the client and the server to run
in parallel, causing races.
The legacy HAL interface didn't have any timeouts for read / write
operations, so there is no good reason for having them in
the wrapping interface.
The only difference with legacy HAL is that Treble HAL can be in
a separate process, and can crash, but this is handled separately.
Test: Check logs on startup, must be no fmq read / write errors
Bug: 35346610
Change-Id: Id3f79d31305afab194a4543bfb4501665518a27b
HALs are prohibited from using framework binder, and there is
no equivalent scheduling policy service in hwbinder. Thus, in order
to match priorities of FastCapture / Mixer threads with their
counterparts in the HAL, it is needed to request the priority boost
from audioflinger on behalf of the HAL.
Test done to verify the priority was correctly set.
Bug: 34131400
Change-Id: If8b6b031c0fcba771fae901a5b8e7da89b3a1570
Test: check priority match between audioflinger's and hal's threads
When outputting audio, the framework issues several HAL calls
from the same thread that writes into data FMQ. These calls
also need to be served on the same thread that writes audio data
to HAL. The same thing happens when audio input is commenced.
Add a command FMQ for passing different commands to the HAL thread.
This way, depending on the calling thread, the same call may go
either via hwbinder or via the command queue.
This dramatically reduces jitter in RTT measurements (although
doesn't improve the latency).
Bug: 30222631
Test: scripted RTT app
Change-Id: Ic212e33d4e2b1cf404973fe9d60762523eef9f40
IAllocator is a framework service, and currently dependency on it
isn't handled correctly.
Bug: 34771147
Change-Id: Id3d50dd3bf9456aa363ae20a30ad319cf9c72e10
Test: manual
Fix deviceAddressFromHal() method to allow empty device
address string which is a legit value in some contexts.
Bug: 34767019
Test: run Loopback app over USB dongle.
Change-Id: I1f7407d23b4cdf6011df75e854ff60595645b74d
Correctly operate on input and output buffers in DownmixerBufferProvider
Note that playback is a bit choppy, need to investigate further.
Change-Id: I350175dcc9cc7142a1935585a8bd5e9abb1b8eb6
Test: play back a 5.1 file
The code wasn't checking the return from IAllocator::allocate
resulting in a crash from HIDL framework when there was an error.
Bug: 34635658
Change-Id: Ia6146ec0be972f261d35852fdc44302b67e44898
Test: Run android.media.cts.AudioTrackTest#testPlayStreamData
1. Treat both reply size being 0 and reply buffer being NULL
as an indication that the reply isn't needed.
2. Synchronize both input and output effect chain buffers,
and avoid excessive copies when the input buffer is the same as
the output buffer.
3. Improve effect chain debug dump by showing both
"external" and "allocated" pointers for effect audio data buffers.
Bug: 34368451
Change-Id: I56aba6908408b5fce3f15c8d29138555101e8720
Test: volume controls works when both Bass Boost and EQ effects enabled
Hwbinder 'linkToDeath' mechanism is used to track abrupt
disappearance of server hal objects due to hal server crash.
Upon hal server crash, notifications can be sent to binder
clients if needed, then the audioserver crashes itself as the
current audio HAL design does not provide an easy way to restore
all the transient objects (devices, streams, effects) in their
pre-crash state.
Bug: 34158778
Test: In binderized mode, kill audio hal server
Change-Id: If9265711edc445984601fcb5c29d2c173a370762
Fix crash when the client passes NULL as 'replySize' for Effect::command.
Bug: 30222631
Change-Id: I015a49ba8c7a3103edfcbf9df39bb32093367a7a
Test: No crash when adjusting "Bass Boost" setting in Play Music
Updated the client code to use the new field:
IStreamOut.WriteStatus.presentationPositionRetval for providing
legacy-compatible results when calling 'get_presentation_position'
immediately after 'write'.
Bug: 30222631
Test: Loopback RTT, media CTS
Change-Id: Idf3f1d29288ddf17a5015f96291648d64d124ec7
Remove ENABLE_TREBLE flag usage for legacy hal fallback.
Introduce new build flag USE_LEGACY_LOCAL_AUDIO_HAL for fallback.
Bug: 32978887
Test: checked "OK Google" (from standby), Hangouts, YouTube,
Play Music, fake radio hal + test app
KI: issues when using equializer and virtualuzer in Play Music
Change-Id: I1c279e622c885f799481f1287e0660ca576fcea0
In ag/1768960, I forgot to actually set the buffers for the effect
interface. Without that, a 'process' method was attempting to use null
buffers.
Bug: 34228998
Test: android.media.cts.AudioNativeTest#testPlayStreamData
Change-Id: I904a9c08aa75bd5738b3ce981ee54511f37df7ec