-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland cras_alsa_io: avoid sample manipulations on mmap memory
This is a reland of commit 1e84e2f with memory copy fix in put_buffer of cras_also_io.c. The access speed of mmap memory can be very slow compared to accessing the local memory. To avoid the slow access of mmap memory for alsa devices: 1. Malloc the local memory in configure_dev(). 2. Performs the sample manipulations on the local memory. 3. Copies the result from the local memory to the mmap memory before calling cras_alsa_mmap_commit(). 4. Free the local memory in close_dev(). This CL also fixes the capture pop noise reported in b/296971597 by preserving the processed samples in the local memory instead of writing them into the non-commit memory and then reading them back at the next mmap_begin. BUG=b:299402922 BUG=b:296971597 TEST=unit tests TEST=tast run ${DUT} arc.AudioOboetesterGlitch.* TEST=tast run ${DUT} arc.AudioLoopbackCorrectness.* TEST=tast run ${DUT} audio.CrasStreamMix.* TEST=atest android.media.cts.AudioRecordTest#testAudioRecordAuditByteBufferResamplerStereoFloat Change-Id: I2cdf6cda54bacaace8635eb25b7f7031993c6894 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/4957838 Reviewed-by: Li-Yu Yu <aaronyu@google.com> Tested-by: Judy Hsiao <judyhsiao@google.com> Tested-by: chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com <chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com> Reviewed-by: Yu-Hsuan Hsu <yuhsuan@chromium.org> Auto-Submit: Judy Hsiao <judyhsiao@google.com> Commit-Queue: Judy Hsiao <judyhsiao@google.com>
- Loading branch information
Showing
7 changed files
with
132 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters