Commit graph

94 commits

Author SHA1 Message Date
millerliang
8ab4968f7c audio:enable mmap and raw on BT
AoC can support mmap on BT both playback and recording
after gpar/322484.

Bug: 232205959
Test: OboeTester

Signed-off-by: millerliang <millerliang@google.com>
Change-Id: I53d70625acb4629954f2bd3041d9d52f4b5c61d1
2023-01-11 08:00:34 +00:00
millerliang
6ef0262388 audio: add missed camcorder be_cfg in dsp latency
Some 3rd party app may use one or three microhpne(s)
to do the camera recording.
Add these two configurations to UC_AUDIO_RECORD to sync
the audio and video of the recoreded video.

Bug: 260824124
Test: Reporter verified
Change-Id: Ide731ef55457a4aee47a1cbfd7badd2ba31704dc
2022-12-05 16:20:59 +08:00
millerliang
7402c9741d audio: remove spatial audio configuraion in speaker path
Remove spatial audio configuration in speaker path
to match the rule.

Bug: 247415765
Test: spatial audio playback
Change-Id: I3df0cdf6c47ecbc633ac2ddcba026084b682b17e
2022-11-07 07:26:44 +00:00
vincenttew
7570035fe7 audio: extand the period number of hifi usecase
extend this to prevent alsa trigger stop playback
and causing pop

Bug: 238056484
Signed-off-by: vincenttew <vincenttew@google.com>
Change-Id: I3f422169a8bccbeece0c97b3ba515d99f7dab2e2
2022-09-20 15:20:09 +00:00
millerliang
eec44318a5 audio: adjust the latency for immersive playback
To meet the av sync, we need to adjust the uc latency
for immersive playback.

Bug: 243645548
Test: Test with av sync video
Change-Id: I5980c8833e168f859b541eeab7d093c206857233
2022-09-07 13:59:37 +08:00
juyuchen
47d623aeff audio: enable gapless offload for trimming data
Bug: 233723867
Test: manual audio tests
Signed-off-by: juyuchen <juyuchen@google.com>
Change-Id: I4e67b18abde5b6d33ddd62776722a252ac1dfacd
2022-09-01 15:06:21 +00:00
Robert Lee
a30ace99c8 audio: enable gapless offload flag
Enable gapless support on compressed_offload w/o trimming delay and padding.

Bug: 236351705
Test: test with AOSP Music and MediaMonkey
Change-Id: Ie23f10d612ee98d6926236de9174aa90e75de415
Signed-off-by: Robert Lee <lerobert@google.com>
2022-08-04 01:42:51 +00:00
Omer Osman
49a124f8cd Add support for Opus as a BT A2DP offload codec
Bug: 226441860
Test: Sink device using bds-dev
Change-Id: Ia371622514fa7e9145d41311f39bb422fbe17a36
2022-07-15 19:44:57 +00:00
millerliang
f04d996f0a audio: apply new pcm id for immersive output
Change to use pcm id 30 for immersive output,
which is using raw path in AoC to get lower
roundtrip latency.

Bug: 237677573
Test: spatial audio playback
Change-Id: Ibbd3e70df5f35503673c2834fda7a22cbeaae557
2022-07-15 12:49:05 +00:00
justinweng
07e8b01a17 Audio configuration for spatial audio
Update audio policy and effect configuration files to
support spatial audio feature

Bug: 237677573
Test: make
Merged-In: I4a7e2eb3c44192954b7bcf804d14097e94e90eb0
Change-Id: I4a7e2eb3c44192954b7bcf804d14097e94e90eb0
2022-07-11 14:39:34 +00:00
Jasmine Cha
9610e3d430 audio: improve mute duration
- redefine mute duration of primary output from 160ms to 40ms to avoid
  cutting of preview notification.

Bug: 233176336
Test: preview notification/voice end call tone

Signed-off-by: Jasmine Cha <chajasmine@google.com>
Change-Id: Ib696638eca99b1f58300533cca586cab209b188d
2022-05-24 06:19:32 +00:00
Carter Hsu
7e54d6ddf0 audio: allow mmap-record to set dsp volume
Bug: 231630423
Test: build pass
Signed-off-by: Carter Hsu <carterhsu@google.com>
Change-Id: Iaafafe9963c102690a89e5d4fe7c63e6783450f1
2022-05-11 03:00:58 +00:00
Carter Hsu
1a8281331d audio: adjust the digital gain for speaker-mic
add mic gain on path "speaker-mic" from 0 to 22

Bug: 228224014
Test: audio record
Signed-off-by: Carter Hsu <carterhsu@google.com>
Change-Id: Idafad36fdfb5c5f54e2ad3c1718b814b956ac17c
2022-04-22 09:17:54 +00:00
Eric Laurent
4c4c40aee6 Revert "audio: add immersive output"
This reverts commit 432fc04f64.

Bug: 223736548
Test: make
Change-Id: I242dd4677d0e42e05bed443e4021ca44cddf4daf
2022-04-12 18:02:04 +02:00
Eric Laurent
5f85a1763f resolve merge conflicts of 7b77d473a7 to tm-dev
Revert "DO NOT MERGE Audio configuration for spatial audio"

Bug: 223736548
Test: make
This reverts commit edfc5e86bd.

Change-Id: Ie693f24b76d00469ad71a36989e481023946c3bb
2022-04-12 11:17:09 +02:00
Eric Laurent
0a1b979e6b Audio configuration for spatial audio
Update audio policy and effect configuration files to
support spatial audio feature

Bug: 189423448
Test: make
Change-Id: I2274fb4784eef5e28cadd9f33c38fdbbe60f6b40
2022-03-23 08:57:06 +00:00
justinweng
432fc04f64 audio: add immersive output
Bug: 189423448
Test: build passed.

Signed-off-by: justinweng <justinweng@google.com>
Change-Id: I0a14bd264fb79f56698ab626bd71af7f72e9fff8
2022-03-21 16:06:34 +08:00
Yung Ti Su
4a8903fb24 Seperate audio_policy_configuration for a2dp and le
If ro.bluetooth.a2dp_offload.supported == true AND persist.bluetooth.a2dp_offload.disabled == true
use audio_policy_configuration_a2dp_offload_disabled.xml (a2dp X LE X)

If ro.bluetooth.a2dp_offload.supported == true AND persist.bluetooth.a2dp_offload.disabled == false AND
(ro.bluetooth.leaudio_offload.supported == false OR persist.bluetooth.leaudio_offload.disabled == true)
use audio_policy_configuration_le_offload_disabled.xml (a2dp O LE X)

If ro.bluetooth.a2dp_offload.supported == true AND persist.bluetooth.a2dp_offload.disabled == false AND
ro.bluetooth.leaudio_offload.supported == true AND persist.bluetooth.leaudio_offload.disabled == false
use default audio_policy_configuration.xml (a2dp O LE O)

Note:
The above settings are based on ro.bluetooth.a2dp_offload.supported == true condition
If ro.bluetooth.a2dp_offload.supported == false, the content of the default audio_policy_configuration.xml file must be replaced by audio_policy_configuration_a2dp_offload_disabled.xml on the target

Test: manual

Signed-off-by: Yung Ti Su <andysu@google.com>
Change-Id: Ibea329bb5b7d24b18ed3e915c9e7306729b17dfd
2022-03-07 16:34:09 +00:00
vincenttew
3f20e9f745 audio: syncing the USB config for mfg am: d0104cfd0d am: ab770e5eeb
Original change: https://googleplex-android-review.googlesource.com/c/device/google/raviole/+/16564364

Change-Id: Ifa9343597be3aa660c64798646ac61cd2cf5de9b
2022-01-10 06:32:11 +00:00
vincenttew
d0104cfd0d audio: syncing the USB config for mfg
currently mfg audio tool using audio-recordC usb-headset-mic
in mixer_paths.xml, add a new path for mfg usb recording to
switching the usb mic source

modify the usb alsa control to v2 since the latest alsa control
already changed

Bug: 213027646
Test: verify pass with mfg tool usb-record
Signed-off-by: vincenttew <vincenttew@google.com>
Change-Id: If3af632ed2bddcdd1329f17fc89ea82162d810ae
2022-01-10 05:50:46 +00:00
Carter Hsu
67f708afd9 audio: change primary output to float
Bug: 200293124
Test: build pass
Signed-off-by: Carter Hsu <carterhsu@google.com>
Change-Id: I2a8dbd08a166bc7cedc58fe57e3ff5f6ee4a4f29
2021-12-23 08:02:30 +00:00
millerliang
91daad4478 audio: change format of mmap-playback to float
Bug: 201398105
Test: OboeTester
Change-Id: If63d33624100185d1126d8e00df5a14b5da9a4d5
2021-11-17 08:32:56 +00:00
Rios Kao
7b87bd2241 audio: add support for aec recording path
Add Audio Capture Eraser Enable to switch
    Eraser for recording path.
    For gain of this path, we shouldn't apply
    software gain, because the input source is
    from hotword pipeline.

Test: build pass
Bug: 172266161
Change-Id: Iabe372e7fe91e557ba9125af14bfb61606c09ea0
2021-11-09 13:05:24 +00:00
Carter Hsu
07322dbd68 audio: change format of deep-buffer to float
Bug: 201593243
Test: build pass
Signed-off-by: Carter Hsu <carterhsu@google.com>
Change-Id: I20ccdca02a134093846437fdc2f770935485853c
2021-10-26 03:35:38 +00:00
Carter Hsu
4d42f48baf audio: update O6/R4 Aaram volume curve am: e5484251ec
Original change: https://googleplex-android-review.googlesource.com/c/device/google/raviole/+/16005300

Change-Id: I1ef019c1be30e2fd4b65a70edce264b679d117ab
2021-10-08 08:07:01 +00:00
Eric Laurent
442155a8c8 audio config: fix minimum alarm volume am: d9f59c1496
Original change: https://googleplex-android-review.googlesource.com/c/device/google/raviole/+/15958180

Change-Id: I09ca426b6aea65559fcc5e69ab354af6664b7449
2021-10-08 08:07:00 +00:00
Carter Hsu
8852d7bcee audio: update O6/R4 Aaram volume curve
O6
Change:
<volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_SPEAKER">
        <point>0,-4800</point>
R4
Change:
<volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_SPEAKER">
        <point>0,-5200</point>

Bug: 201069348
Test: build pass
Signed-off-by: Carter Hsu <carterhsu@google.com>
Change-Id: Ia5f82e06bc272d93172892692c7987993786b754
2021-10-08 12:02:04 +08:00
Eric Laurent
0800e891ec audio config: fix minimum alarm volume
The ALARM volume curve on SPEAKER device must have a lowest
point with abscisse 0 instead of 1 to prevent the stream from
being muted when lowest UI index is selected.

Bug: 201069348
Test: set alarm volume to min and play alarm
Change-Id: I29dda66002562e9ce889bd4f8b0154c2837f7be5
2021-10-08 12:01:03 +08:00
millerliang
4c87c94832 audio: changet the period size of VoIP Record am: 47a8acc5f1 am: f3e85379a4
Original change: https://googleplex-android-review.googlesource.com/c/device/google/raviole/+/15824293

Change-Id: I341ba5e4b200ef4b9d242a4a7fa66bd53dd47df3
2021-09-24 07:36:05 +00:00
millerliang
5fb9498c64 audio: changet the period size of VoIP Record am: 47a8acc5f1
Original change: https://googleplex-android-review.googlesource.com/c/device/google/raviole/+/15824293

Change-Id: I9051aef768a94eb34b32770dafe38ed25046007d
2021-09-24 07:14:38 +00:00
millerliang
a8c236c35c audio: changet the period size of VoIP Record
Change the period size of VoIP Record to 20ms.
Otherwise it will apply fast capture.
Fast capture timestamps are not supported yet.

Bug: 196912510
Test: Build pass
Change-Id: I6434a7596880712efa7cbfa03b3480efb5e2c2aa
2021-09-24 10:41:15 +08:00
Xinhui Zhou
923b3af81f audio: deep buffer to floating point pcm data [DO NOT MERGE] am: ee3bc4db89
Original change: https://googleplex-android-review.googlesource.com/c/device/google/raviole/+/15799241

Change-Id: I4ca8af2b8270665bd447859b010ad33ddbcd692e
2021-09-21 22:10:44 +00:00
Xinhui Zhou
411cd28a78 audio: deep buffer to floating point pcm data [DO NOT MERGE]
Bug: 199157246
Test: build pass
Signed-off-by: Xinhui Zhou <zxinhui@google.com>
Change-Id: I331d55403daadda3bb6699b3dfff0e759f782b95
2021-09-21 21:58:32 +00:00
Roger Fang
be2bde46ba audio_usb: Enable ASRC in USB voice call path
Telephony downlink ASRC should be enabled for USB. See b/173577733.
Otherwise the downlink ring buffer will underflow or overflow

Bug: 199230403
Test: Local build + Telephony test for five minutes: No glitch observed.
Signed-off-by: Roger Fang <rogerfang@google.com>
Change-Id: Ifbcd9252c97a7f794e0b142e69faf1b0f3041098
2021-09-08 15:06:00 +08:00
Jasmine Cha
7ebc080458 audio: update music playback volume curve
- changes volume 1,2,3,4,5 (due to a sound quality noise floor issue)

Bug: 198224217
Test: manual power test (b/198224217#comment21)

Signed-off-by: Jasmine Cha <chajasmine@google.com>
Change-Id: Ied7e88ad941e8a13e2080da6e2897b9541966dd0
2021-09-03 05:32:23 +00:00
David Li
b82bc02526 audio: update Media Record Tuning Files
R4O6
Update camcorder tunings files for FRC

Reason:
- The SA-lite pipeline is used for 3rd party camcorder/recorder and
    need to be updated tuning for audio quality (b/185293492)
- There is e-Noise issue could be noticed when using 3rd party
    camcorder/recorder

Change list:
Update audio_platform_configuration.xml file so that parameters in
    SA-lite pipeline can be loaded correctly
Update template.xml file to enable feature swapping microphone
    assessment in SA-lite pipeline
Update recording.gatf file for modifing tuning parameters

Validation:
3rd party camcorder/recorder function are good and validation was
    used SD1A.210817.007 (7665414)

Bug: 197492283
Test: forrest build passed
Change-Id: Ifc66519c92935dc4bd14d68a85a491f96429272a
2021-08-27 01:57:46 +00:00
Jasmine Cha
f21fa1b132 audio: update tuning tables (20210826)
Release Notes (R4):
- Retune top volumes for more balanced sound, less harsh
- Heavy emphasis on vocals, both depth and clarity
- DTMF volume curve reduced to better align w/ O6, F2, C2, B9
- SYSTEM volume curve reduced to better align touch sounds
- SYSTEM volume curve copied into AUDIBLE volume curve

Release notes (O6):
- Camera shutter (system sound) decreased volume curve to better align w/ R4/B9 and F2/C2
- Slight adjustment at min vol point for DTMF
- SYSTEM volume curve reduced to mitigate loud camera shutter
- SYSTEM volume curve copied into AUDIBLE volume curve

Bug:190960105
Test: High level tuning validation (b/190960105#comment15)

Signed-off-by: Jasmine Cha <chajasmine@google.com>
Change-Id: Icf0c9e921017b5e06ec950452a78a9d89acf86f2
2021-08-26 01:15:23 +00:00
Robert Lee
09c3fd343f audio: update audio_policy_volumes.xml
Update below stream's volume curves to refine system sound output
from speaker too loud in the lowest volume.

  <volume stream="AUDIO_STREAM_SYSTEM" deviceCategory="DEVICE_CATEGORY_SPEAKER">
  <volume stream="AUDIO_STREAM_RING" deviceCategory="DEVICE_CATEGORY_SPEAKER">
  <volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_SPEAKER">
  <volume stream="AUDIO_STREAM_NOTIFICATION" deviceCategory="DEVICE_CATEGORY_SPEAKER">
  <volume stream="AUDIO_STREAM_DTMF" deviceCategory="DEVICE_CATEGORY_SPEAKER">

Refine audio-tables.mk location to make sure the xml is updated.

Bug: 195387287
Test: QMC verified
Test: Local built and verified vendor/etc/audio_policy_volumes.xml is correct one

Signed-off-by: Robert Lee <lerobert@google.com>
Change-Id: I13188d7470092448a2660f89d43cf13a56c22edc
2021-08-16 11:27:19 +00:00
Carter Hsu
7ca7fc2c5c audio: dynamic/runtime audio capture switch
Bug: 193042612
Test: build pass and audio capture
Signed-off-by: Carter Hsu <carterhsu@google.com>
Change-Id: Ief7d8137a6c636d0c71c7c7ab732dc38d4601a45
2021-08-06 20:54:48 +00:00
Roger Fang
cfaa3174c3 audio: Add command to set PCM steam wait time for voice and audio.
This control is from this patch: https://partner-android-review.googlesource.com/c/kernel/private/google-modules/aoc/+/1962616/

Bug: 194454077
Test: Playing a music then removing the USB headset
Change-Id: Ie9dbf9df13ffaee80c61e2d5da529878fde0b740
Signed-off-by: Roger Fang <rogerfang@google.com>
2021-08-06 17:14:07 +00:00
millerliang
f4cd1362d0 audio: adjust the latency for bluetooth output
HAL can get the device latency from bluetooth headset.
We just to set the latency of the device side.

Bug: 195166550
Test: av sync
Change-Id: Id64b7ea796ddc4de996817d0553f1855b4d9485a
2021-08-06 06:30:03 +00:00
Robert Lee
755a0887fa audio: add Built-In Back Mic device
Bug: 194169487
Test: Test Diagnostic Tools microphone test

Signed-off-by: Robert Lee <lerobert@google.com>
Change-Id: Ice468e91591f5e552e733d187ade86e76896c5b5
2021-07-30 05:26:47 +00:00
millerliang
225b713e1e audio: refine the period size for raw playback
For raw playback, the buffer size needs to equal to the
ring buffer size. AoC changes the buffer size to 16384 bytes,
but it cannot be divisible by 48(1ms frames with 48000 sample rate).
Use the period size(frame couts) from configuration file.

Bug: 194398677
Test: OboeTester->TEST OUTPUT
Change-Id: I07f0cb7d5904e4e3ef78b9a15d31590fdd5a9087
2021-07-29 16:10:07 +00:00
Joey Poomarin Phloyphisut
96b58c1c6f audio_usb: Updating mixer_paths.xml to use V2 command to send config to AoC to support USB behind HUB.
This V2 command is from this patch:
https://partner-android-review.googlesource.com/c/kernel/private/google-modules/aoc/+/1962494

Bug: 181296179
Test: Local build
Change-Id: Ia95886ed22519f4da70e2a4880f7fb0eb9900660
2021-07-19 11:33:51 +00:00
Joey Poomarin Phloyphisut
895e3d3808 audio_usb: Add unsupported pcm format for USB accessory on Raviole.
This patch need ag/15270810 to work.

Test: N/A
Bug: 193477495
Change-Id: Ied9317fed60f1fae5a0de76ed12aec723c20a0c2
2021-07-19 07:33:28 +00:00
millerliang
eff4e0db3d audio: adjust the latency for USB Headphone
Adjust the latency for OUT_USB_HEADSET_BE_CFG

Bug: 174992590
Test: Test av sync for video playback
Change-Id: Idc1dedbbc21290106d417905832810b1ebd1c576
2021-07-14 21:27:00 +08:00
Carter Hsu
f8a04fb6d9 audio: add BT path back to the haptic output
Bug: 192910606
Test: build pass
Signed-off-by: Carter Hsu <carterhsu@google.com>
Change-Id: Iccfb65d568a640c01177d81f8c96d2103b9fda49
2021-07-13 04:11:46 +00:00
millerliang
d2db8a5541 audio: apply RAW path for raw playback
Apply the entry point of raw path which writes data through
pcm mmap from user space to DRAM ring buffer.

Bug: 190775545
Test: OboeTester
Change-Id: I3f61126f323fcebc0a2b53c06d564b9e9e64f823
2021-07-12 13:22:54 +00:00
Joey Poomarin Phloyphisut
6def5fe520 USB Audio: Add USB HiFi routing
Let USB HiFi BE as a standalone bind/src command to AoC.
And fix that USB HiFi Rx no audio after the other touch
sound's UC and BE is closed.

On top of the change of pa/1959717
(pa/Ib82ff06986ebe97d472f4518aa136f32da30da66)

Test: Local test
Bug: 191222376
Change-Id: I1017aab232bd2e929dc4caa9939f0613ba937f86
2021-07-12 10:10:40 +00:00
millerliang
0d481528c0 audio: adjust the latency for output and input
Change the period size to 20 for audio record.
Otherwise it will apply fast capture.
Fast capture timestamps are not supported yet.

Bug: 190453606
Bug: 189793417
Test: Test av sync for camera recording
Test: Test av sync for video playback
Change-Id: Ic7225979a411f6fdef1e5869df7f816bd49003b1
2021-06-25 13:44:27 +00:00