Commit Graph

9985 Commits

Author SHA1 Message Date
Andy Hung
c9300c80f2 Merge "AudioTrack: 24 channel index masks, compressed formats" am: e477e9686f am: dd8fa96c01 am: fde2ef0250
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1702808

Change-Id: I7b14b0c86e5ac1e089702e6a285bf58174fcd45c
2021-05-11 22:49:13 +00:00
Andy Hung
fde2ef0250 Merge "AudioTrack: 24 channel index masks, compressed formats" am: e477e9686f am: dd8fa96c01
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1702808

Change-Id: I35427c5ce3826841b1a0d313ba2488e2bc03fb3b
2021-05-11 22:25:26 +00:00
Andy Hung
d3ceb62024 AudioTrack: 24 channel index masks, compressed formats
PCM channel count is limited to AudioSystem.CHANNEL_OUT_MAX.

Compressed channel count is limited to AudioSystem.FCC_24
as typically the data rate is smaller than the equivalent
PCM channel count stream.

Test: atest AudioTrackTest
Test: atest AudioTrackTest#testImmersiveStreaming
Test: atest AudioTrackTest#testImmersiveChannelIndex
Bug: 187062102
Change-Id: I96b2e37c9b59c9e38a0caf69e19c280949c4d099
2021-05-11 11:01:22 -07:00
Kriti Dang
e5489584ef Merge "Removing the list of formats from the javadoc in setSurroundFormatEnabled" into sc-dev 2021-05-11 07:52:39 +00:00
shubang
5afdd12cfe Modify error codes and improve descriptions
Bug: 167036690
Test: atest MediaMetricsAtomTests
Change-Id: Ib34f402d29043cdda839340e23e26a40e82e57f2
2021-05-10 19:10:35 -07:00
Andy Hung
ce18518dca Merge "AudioFormat: Retrieve sample rate capability from framework" am: ba32f57428 am: 89ce768aa1 am: 4a47417302
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1700287

Change-Id: I7cc3432c9457ef2d046fa8552e7bf7aca4e4e8d8
2021-05-10 20:34:47 +00:00
Andy Hung
4a47417302 Merge "AudioFormat: Retrieve sample rate capability from framework" am: ba32f57428 am: 89ce768aa1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1700287

Change-Id: I137ad2c9e8b3f360037f312773ea8d31d8ba4bfa
2021-05-10 20:15:24 +00:00
Jay Patel
3d46ae52dc Merge "AudioSystem: update framework channel capabilities" am: 249034de9d am: 67143814c2 am: 4245889bbd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1317754

Change-Id: I30f6dd9c16b1168bf263f94498a3993a4bfe7b45
2021-05-10 18:44:23 +00:00
Jay Patel
4245889bbd Merge "AudioSystem: update framework channel capabilities" am: 249034de9d am: 67143814c2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1317754

Change-Id: Icb4bc0bd4382c6a0a7d330624bc371d009efc1c6
2021-05-10 18:08:04 +00:00
Andy Hung
4afe15ccb0 AudioFormat: Retrieve sample rate capability from framework
Allows a device to specify a higher sample rate (e.g. 384kHz)
and have it acknowledged by CTS.

Test: AudioTrackTest#testGetMinBufferSizeTooHighSR
Bug: 135474352
Bug: 187062102
Change-Id: I2a44590970b437c1090c615961432afce974f2ba
2021-05-10 16:22:59 +00:00
Kriti Dang
1985c45742 Removing the list of formats from the javadoc in setSurroundFormatEnabled
The IntDef in param automatically adds the javadoc.

Bug: 187701166
Test: N/A
Change-Id: I2fba353e98d543e8b5d1d66e4cc599e57e3a7f4d
2021-05-10 17:06:44 +02:00
TreeHugger Robot
3582d5cb2d Merge "Fixed AudioMixingRule usage of AudioAttribute#getUsage" into sc-dev 2021-05-07 20:06:35 +00:00
Zhangrui Zhang
cee3c552b8 AudioSystem: update framework channel capabilities
Anticipate more than 8 channels (such as 7.1.4) on
future devices, but keep at 8 for now.

Test: atest AudioTrackTest#testImmersiveStreaming
Test: same test by manually adjusting to 24 channels.
Bug: 127896072
Bug: 187062102
Change-Id: I72c2ff0faa7794f22deaeb794920afb65788f40b
2021-05-07 13:06:18 -07:00
Lajos Molnar
4fa6d3a873 Merge "media: propagate profiles to EncoderProfiles" into sc-dev 2021-05-07 15:02:15 +00:00
Sungsoo Lim
027d957f92 Check the device type instead of the object reference
Also print a log when restore route to default while a bluetooth
route is avaialble.

Bug: 176386259
Test: build
Change-Id: I4a974438040595597fbf4dcb0ec57d49351540ef
2021-05-07 10:56:15 +09:00
TreeHugger Robot
ca3cc01d0d Merge "SoundPool: Update documentation for sound duration" into sc-dev 2021-05-05 21:56:23 +00:00
Andy Hung
b3b3a741d5 SoundPool: Update documentation for sound duration
Test: make docs and view
Bug: 147408160
Change-Id: I8952dd7da2ab8e493415e93f10f2346af3de2bd1
2021-05-04 15:36:40 -07:00
Lajos Molnar
16ceab17a0 media: propagate profiles to EncoderProfiles
Bug: 171673898
Test: atest CamcorderProfileTest
Change-Id: I486762863cd29239b44846b54b146458426b643b
2021-05-03 23:27:42 -07:00
Lajos Molnar
973b2e89bd media: pass full EncoderProfiles from XML
Get multiple audio/video codec profiles from MediaProfiles object
instead of just wrapping the old CamcorderProfiles objects.

Bug: 171673898
Test: atest CamcorderProfileTest
Change-Id: If56ac6c2a89992361f0491d8175af1f89dffd3d0
2021-05-03 23:27:42 -07:00
Santiago Seifert
9642d628ab Merge "Rename MediaExtractor symbols to log session id" into sc-dev 2021-05-01 10:51:09 +00:00
Santiago Seifert
14cdc32bd0 Rename MediaExtractor symbols to log session id
Test: atest CtsMediaHostTestCases
Bug: 167036690
Change-Id: I2e71d460e6907400daeba21fd6a76fa0ea5e0922
Merged-In: I2e71d460e6907400daeba21fd6a76fa0ea5e0922
2021-04-30 22:32:55 +00:00
Andy Hung
6e1398b55f Merge changes from topics "dra", "dts_uhd" am: 6a1812c30f am: ea8e392fef
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1691214

Change-Id: I34f818f3140c8d5c6f21089bf168b6b836a61fbc
2021-04-30 21:28:39 +00:00
Andy Hung
e70b8644aa Audio: Add ENCODING_DTS_UHD am: bd3a68b6f1 am: d3b7c9bb9c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1691700

Change-Id: I070bba4d6da54a75dd9ecf264a8e985ddaf36ed6
2021-04-30 21:28:33 +00:00
Hyundo Moon
b2de16f23f Merge "Fix failing MediaRouter2ManagerTest" into sc-dev 2021-04-30 08:29:37 +00:00
Oscar Azucena
b4cca57bfc Fixed AudioMixingRule usage of AudioAttribute#getUsage
Given that system usages were added to the AudioAttributes, system
components need to use the API were applicable. AudioMixingRule was
missing this and thus the audio attribute usage base routing did not
work correctly. In particular the registration of the audio policy mixing
rules would not register the system usages based routing correctly.
Instead, the match usage rule would default to unknown usage instead of
the requested system usage.

Bug: 186661937
Bug: 186442942
Bug: 186158497
Test: build gcar_emu_x86 and run car kitchen sink to make sure routing
    performed as expected.
Change-Id: I4aaedf1b6b9144bd2e84d2d7112b5ebcf744a8b2
2021-04-29 22:18:15 -07:00
Andy Hung
a4c82624e9 Audio: Add ENCODING_DRA
China DTMB digital TV.
See SJ/T11368-2006
“Specification for multichannel digital audio coding technology”.

Test: atest AudioFormatTest
Bug: 185950819
Merged-In: Id6078e65941020a73f8a43017f480574c2a78999
Change-Id: Id6078e65941020a73f8a43017f480574c2a78999
2021-04-29 19:13:33 -07:00
Andy Hung
bd3a68b6f1 Audio: Add ENCODING_DTS_UHD
See ETSI TS 103 491 V1.2.1 (2019-05)
DTS-UHD Audio Format; Delivery of Channels,
Objects and Ambisonic Sound Fields

Test: atest AudioFormatTest
Bug: 184538197
Merged-In: I740a9ba041ad444ead5513fb3b632a78d391ab1c
Change-Id: I740a9ba041ad444ead5513fb3b632a78d391ab1c
2021-04-29 17:55:34 -07:00
Hyundo Moon
34029e0082 Fix failing MediaRouter2ManagerTest
The test failed for several reasons:
 - When other real cast device is present, tests are run before actual
   routes arrive.
 - Screen is not turned on during test.
 - Test lacks MEDIA_CONTENT_CONTROL permission.

This CL fixes the test.

Bug: 186190171
Test: atest com.android.mediaroutertest.MediaRouter2ManagerTest \
        --rerun-until-failure
Change-Id: I6f86ae7cba25871ffb7c8ee96f4c8db6bd86b816
2021-04-27 17:59:47 +09:00
Chong Zhang
0621358a52 trancoding: lazy-start transcoding service
bug: 186387244
test: atest MediaTranscodeManagerTest; unit tests
Change-Id: I354f32d062b9a46ddfc9f86d5f79c778809799a4
2021-04-26 22:06:25 +00:00
Treehugger Robot
26b0f32060 Merge "Add constant values for MPEG-H." am: 6286d0952d am: 315d8a0faf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1670526

Change-Id: I065363f18a7fc389add1518213596bd930d562df
2021-04-23 23:47:59 +00:00
Treehugger Robot
6286d0952d Merge "Add constant values for MPEG-H." 2021-04-23 22:51:55 +00:00
Andy Hung
6698967429 Merge "MediaFormat: new MIME types for MPEG-H audio" am: fae80ba7a4 am: 3eb382c3da
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682765

Change-Id: I2cbfa51d8b0b4c1aaa5452064df6119b0cf8794a
2021-04-23 20:43:38 +00:00
Andy Hung
9fe576be8b Merge "AudioFormat: Add ENCODING_PCM_32BIT ENCODING_PCM_24BIT_PACKED" am: e468f6c151 am: 32010fbba7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1670486

Change-Id: I1b3354768d9ed8539459c48f5bb1a051cc9ebf24
2021-04-23 20:42:57 +00:00
Andy Hung
fae80ba7a4 Merge "MediaFormat: new MIME types for MPEG-H audio" 2021-04-23 20:03:56 +00:00
Andy Hung
e468f6c151 Merge "AudioFormat: Add ENCODING_PCM_32BIT ENCODING_PCM_24BIT_PACKED" 2021-04-23 19:49:33 +00:00
TreeHugger Robot
386e8ba090 Merge "media: polish EncoderProfiles" into sc-dev 2021-04-22 18:03:17 +00:00
Eric Laurent
22483664c9 Merge changes from topic "startAudioSource_issues" am: 45da2609b7 am: 28ccf9bf8e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1678048

Change-Id: I3de8128a6e2860e99effc18a6753eeea25213767
2021-04-22 17:30:55 +00:00
Eric Laurent
45da2609b7 Merge changes from topic "startAudioSource_issues"
* changes:
  HwAudioSource: wrong native handle check
  AudioSystem: startAudioSource: ensure port handle initialized
2021-04-22 16:33:23 +00:00
Francois Gaffie
2364bed6e6 HwAudioSource: wrong native handle check
Playing status of audio source is checked using the native handler
not 0.
However, if AudioSystem#startAudioSource fails, the native handler
returned is not 0, but an error code.
In fact AudioPolicyManager sets the PORT to NONE (0) and sets an error
status.
JNI layer transforms the failure status into a native handler returned
to the caller.

Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
Change-Id: Iaa920c073885c2556a93a1b5ae23467fa6ffad4f
Merged-In: Iaa920c073885c2556a93a1b5ae23467fa6ffad4f
2021-04-22 14:20:20 +00:00
Eric Laurent
d703642add Merge changes Iaa920c07,I4eb8046a into sc-dev
* changes:
  HwAudioSource: wrong native handle check
  AudioSystem: startAudioSource: ensure port handle initialized
2021-04-22 14:14:49 +00:00
Francois Gaffie
5253a31c7a HwAudioSource: wrong native handle check
Playing status of audio source is checked using the native handler
not 0.
However, if AudioSystem#startAudioSource fails, the native handler
returned is not 0, but an error code.
In fact AudioPolicyManager sets the PORT to NONE (0) and sets an error
status.
JNI layer transforms the failure status into a native handler returned
to the caller.

Bug: 186088557
Test: make

Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
Change-Id: Iaa920c073885c2556a93a1b5ae23467fa6ffad4f
2021-04-22 11:24:52 +02:00
Lajos Molnar
4ef563a2a5 media: polish EncoderProfiles
Made inner classes private.
Added IntDef annotations (also to related CamcorderProfiles methods).
Deprecated CamcorderProfiles.get methods.

Bug: 184714224
Test: atest CamcorderProfileTest
Change-Id: Ibbacb7d3c5f3558f82c109bf36a64f6a3e369b31
2021-04-21 22:20:37 -07:00
Nate Myren
08635fe057 AudioManager: add API for mode listener
New API to add/remove a listener for changes to the audio
mode (see existing AudioManager.getMode() API).

Bug: 184891081
Test: atest android.media.cts.AudioModeListenerTest
Change-Id: I0be07d577c7497066b61a1573752343227605fd7
2021-04-21 20:19:46 -07:00
Andy Hung
7f4e3745ae Merge "Audio: Add ENCODING_DRA" into sc-dev 2021-04-21 22:08:43 +00:00
Eric Laurent
21d375cdb6 Merge "AudioRecord: Allow to share capture history." into sc-dev 2021-04-21 17:03:28 +00:00
Andy Hung
e1bfbd683b Merge "MediaFormat: Update constants for MPEG-H codecs" am: ca57ecee1b am: 3d46fe5294 am: f286036ab3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1680925

Change-Id: I68b1d8518691cb7858a29de7675384d3792e1b1a
2021-04-21 16:15:34 +00:00
Andy Hung
f286036ab3 Merge "MediaFormat: Update constants for MPEG-H codecs" am: ca57ecee1b am: 3d46fe5294
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1680925

Change-Id: Ia10684622673a6a9875aebc85667be794a958d0a
2021-04-21 16:01:31 +00:00
Andy Hung
ca57ecee1b Merge "MediaFormat: Update constants for MPEG-H codecs" 2021-04-21 15:21:01 +00:00
Eric Laurent
c670e06157 AudioRecord: Allow to share capture history.
Add the possibility for privileged applications to
share part of their audio capture history with another app.

A privileged app with permission CAPTURE_AUDIO_HOTWORD can share part of
its recent capture history on a given AudioRecord with the following
steps:
1) Specify the maximum time in the past that will be available for other
apps by calling setMaxSharedAudioHistoryMillis() on the AudioRecord.Builder
when creating the AudioRecord
2) Start recording and determine where the other app should start
capturing in the past.
3) Call AudioRecord.shareAudioHistory() with the package name of the app the history
will be shared with and the intended start time for this app's capture relative to
this AudioRecord's start time.
4) Communicate the MediaSyncEvent returned by shareAudioHistory() to the other app
5) The other app will use the MediaSyncEvent when creating its AudioRecord by calling
setSharedAudioEvent() on the AudioRecord.Builder.
6) Only after the other app has started capturing can this app stop capturing and
release its AudioRecord.

Bug: 183705547
Test: regression on capture use cases

Change-Id: I5beba6c1e489148a14ba86165b8ef2fdc78c802a
2021-04-21 12:00:00 +02:00
Andy Hung
fb082f6463 Audio: Add ENCODING_DRA
China DTMB digital TV.
See SJ/T11368-2006
“Specification for multichannel digital audio coding technology”.

Test: atest AudioFormatTest
Bug: 185950819
Change-Id: Id6078e65941020a73f8a43017f480574c2a78999
2021-04-20 19:12:59 -07:00