Allow the default audio implementation to use the sample rate and
format provided by the application, but default to 16-bit stereo
for both input and output.
Also, default to 10ms output buffer and 20ms input buffer.
Bug: 70692394
Test: Audio device and output stream created successfully with
the default frame_count.
Audio device reports 20ms for input buffer size.
Audio input stream created successfully with defaults.
Setup device with audio_policy_configuration_stub.xml;
no failures for GTS tests: GtsGmscoreHostTestCases
-t 'com.google.android.gts.audio.AudioHostTest'
Change-Id: If496fc89f72f26266a7ed9b59acf88d1ca76e704
audio.h and its dependencies (audio-effect.h, sound_trigger.h...)
used to be shared between system and vendor code.
This led to multiple problems:
1) Such sharing contradicts the Treble policy of
strict independence of framework and vendor code.
2) When audio.h was changed, every vendor needed to update
its code in the next release. This meant that audio*.h
headers were mostly changed in backward compatible manner.
Nevertheless, for P the HIDL interface and thus the audio.h
interface are changed in backward incompatible way.
(Some enum are becoming 64 bit long).
3) As the headers were common, some API used only by the framework
needed to be visible to the vendors (mostly enum values).
4) Treble policy is to support at least one previous HAL version
As a result the audio*.h headers are now duplicated,
one set for the framework, and one for the vendor.
Each set will evolve independently. After this split,
the framework-only APIs will be removed from the vendor headers
and vice versa.
The split is implements as such:
+ for system code
- NOT moving the libaudio_system_headers
Eg: system/audio.h and system/audio_effects/effect_equalizer.h
are still in system/media/audio
- the legacy audio HAL API that were in libhardware headers
are now in libaudiohal_legacy_headers
Eg: hardware/audio.h and hardware/audio_effect.h
are now in frameworks/av/media/libaudiohal/legacy/
+ for vendor code
- moving libaudio_system_headers and the legacy audio HAL API
that were in libhardware_headers in
android.hardware.audio.common.legacy@2.0
Note that those headers are now versioned, so migrating to a @4.0
HIDL HAL will mean changing the legacy dependency too.
Eg: system/audio.h, system/audio-effect.h, hardware/audio.h
are now in hardware/interfaces/audio/common/2.0/legacy
- the legacy audio effect HAL API that was in libaudioeffects
is now moved in android.hardware.audio.effect.legacy@2.0
Eg: audio_effects/effect*.h are now in
hardware/interfaces/audio/effect/2.0/legacy
- the legacy sound trigger HAL API that were in libhardware_headers
is now moved in android.hardware.soundtrigger.legacy@2.0
Eg: hardware/sound_trigger.h is now in
hardware/interfaces/audio/effect/2.0/legacy
libaudioutil being used by both system and vendor, had
to be renamed for system to libaudioutil_system.
Vendor libs that now depend on the audio.h of a specific
version and are not extensively referenced in non google code,
append @2.0 to their name.
Note that headers that are not expected to change in the 4.0 HAL are
left in all-versions folder to avoid duplication.
This is an implementation detail as the versioned libraries export
the all-versions headers.
Note that strict vendor-system separation is enforced by the
build-system. The system headers are not available for vendor
libs and vice-versa.
Note that this patch is split between numerous git repository (>10),
all the commits having the same Change-id for searchability.
Note that audio_policy.h is no longer exposed to vendors
as the legacy audio policy HAL API was never officially supported.
As a result the audiopolicy stub implementation has been removed.
Test: compile taimen-userdebug walleye-userdebug
sailfish-userdebug marlin-userdebug
gce_x86_phone-userdebug gce_x86_phone
full-eng aosp_arm aosp_x86-eng
Test: check that the emulator booted and played audio
Test: full QA on sailfish-userdebug and taimen-userdebug
Bug: 38184704
Change-Id: I950f4e0a55613d72e32eba31bd563cb5bafe2d1a
Signed-off-by: Kevin Rocard <krocard@google.com>
Libraries under /hardware/libhardware/modules should go to /vendor/.
These are conventionl HALs for default implementations, most of them
are not used.
Camera and thermal are already moved in other CLs.
Bug: 35907904
Test: Compiled and checked install path. Verified on Sailfish with
$ lsof | grep default.
Change-Id: Ibde574001c01cbfea014a20a0fbbb3265e6cdc8a
Creating a simple "stub" audio HAL to be used in systems with no
hardware output. This stub HAL allows systems to run CTS tests and
other audio system calls without crashing or unexpected behavior.
The stub can be used also as a starting point for creating a new HAL.
This is needed for audio_output feature support.
bug: 19439530
Change-Id: I9e8e06e5b7fea7c7f3ff1de303db015b51e8acde
Pass device address (and audio source for inputs) to
open_output_stream() and open_input_stream() audio HAL functions.
Bug: 14815883.
Change-Id: I5535677db3f3027917a31a7ed5c0a4c6bc013639
Set -Wno-unused-parameter, which makes the directory warnings-clean
on 32-bit and 64-bit.
Remove LOCAL_32_BIT_ONLY.
Change-Id: If0c0135e57935d785a0f36b7d5187ac567c7e21c
Changed audio device API version to 2.0 because of
new enums for audio input and output devices.
Removed implementations of get_supported_devices() in
stub and usb audio modules.
Change-Id: I09345d38929d931e5015e36d18259f5a5f950298
(cherry picked from commit d245968b7ef0be5c776c9aefff3eca9e293d1b35)
> Extend the audio HAL interface to support get/set master mute
>
> Hand merge from ics-aah
>
> > Extend the audio HAL interface to support get/set master mute: DO NOT MERGE
> >
> > Extend the audio HAL interface to allow HALs to optionally support HW
> > level master mute. This follows the same pattern as master volume and
> > is part of the fix for bug 6828363. Because of the divergences
> > between ICS and master, this change will need to be merged by hand.
> >
> > Signed-off-by: John Grossman <johngro@google.com>
> > Change-Id: Ica6f5e37e13d13dde60463966f41f271ffa104fd
>
> Change-Id: I5e7aea6d7da0012dcc077281f9077fc04cfb9889
> Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I2011cc5bc41ca7081ce255a4bfba65f36f899bc4
Signed-off-by: John Grossman <johngro@google.com>
Modified open output and input stream functions to add new
parameters needed by audio HAL. Also grouped parameters
in a config structure for clarity.
Change-Id: I60832d8e5b5e4a48f209a6d83f5ca9c044be61f1
This is a squashed merge of the following changes:
Commit f560da61a5e128ca9f82f7fe939afcf1f09188c7
Author: John Grossman <johngro@google.com>
Date: Thu Aug 11 15:34:55 2011 -0700
Fill out a missing entry in the audio HAL function table.
The entry for get_initial_master_volume was missing from the non-legacy audio
HAL and needs to be filled out. Also fix up the order of the comments
describing the get_initial_master_volume method.
Change-Id: I87d5415ef92611497a6dab4c657fc00367c4d80b
commit cea82facb63fd237a4ea6fb770605fcb500850ff
Author: Jason Simmons <jsimmons@google.com>
Date: Thu Jun 16 14:24:24 2011 -0700
Define a replacement for getSampleDelta that returns a DMA start time and count of samples queued
Change-Id: I2d13f57b5a8c5b97fb3aa0a90834ce91c56864ef
commit 60a9acd7eee470a8d870218e8be618bfa3be15a5
Author: Mike J. Chen <mjchen@google.com>
Date: Tue Jun 7 09:13:23 2011 -0700
Add Android@Home extensions to new Audio HAL interface.
Change-Id: I3ea4676d4b7d2afd78a5a7a7003ad5c437276d05
Signed-off-by: Mike J. Chen <mjchen@google.com>
Change-Id: I09f3756d12a1ce4f9af39610ed857890742a72df
Signed-off-by: Mike J. Chen <mjchen@google.com>
Signed-off-by: John Grossman <johngro@google.com>
Conflicts:
include/hardware/audio.h
modules/audio/audio_hw.c
Improve volume management by keeping track of volume for each type
of device independently.
Added functions at the audio policy interface to set and get stream volume
for a particular device.
Change-Id: Ic8899e82e48193cb65b3673e9d20383efed943b5
Added a method on audio policy interface to register
audio effect CPU usage on enable and unregister on disable
instead of when the effect is created or destroyed.
Change-Id: Iee20bf70fee7302f817ec4c7d9bf7640caca2e95