Commit Graph

539 Commits

Author SHA1 Message Date
zhao_haipeng 2a2187126c Missing README.OpenSource open source description file
Signed-off-by: zhao_haipeng <zhao_haipeng@hoperun.com>
2021-11-16 18:12:33 +08:00
zhao_haipeng 02e8ef8fa8 Missing README.OpenSource open source description file
Signed-off-by: zhao_haipeng <zhao_haipeng@hoperun.com>
2021-11-16 18:08:32 +08:00
dvdli ddd99c8e23 Merge pull request #198 from dvdli/tinyalsa-dev
fix bugs
v2.0.0
2021-02-01 13:29:04 +08:00
dvdli e93cd3cb47 upgrade Travis CI dist to bionic 2021-01-29 14:31:15 +08:00
dvdli a003e01ecd fix test case to match the API 2021-01-28 17:46:05 +08:00
dvdli 61ed424e2b Let pcm_mmap_read/write call pcm_readi/writei
The pcm_readi and pcm_writei also can deal with the mmap read/write.
Also mark the pcm_mmap_read/write functions as deprecated functions and
update the test case.

Add mmap playback support to tinyplay
2021-01-28 15:14:34 +08:00
dvdli 1db8c1f78a prepare in pcm_generic_transfer 2021-01-28 14:25:40 +08:00
dvdli a8ea24a676 Merge pull request #200 from dvdli/tinyalsa-aosp
add LICENSE file and rename modules in Android.bp
2021-01-20 11:50:37 +08:00
dvdli 16d2e46f32 add LICENSE file and rename modules in Android.bp 2021-01-20 11:36:15 +08:00
dvdli 09d8a4cdb4 fix integer character ascii range 2021-01-12 18:09:46 +08:00
dvdli a72d982b0d remove pcm_prepare in pcm_open
For the dynamic pcm device, it is valid to specify the backend after
opening it. However, it is invalid to call prepare on a dynamic pcm
device without connecting any backend device. We should not do
pcm_prepare in pcm_open.

See also: Issue #197
2021-01-12 15:55:49 +08:00
dvdli 88e2d3a438 fix mmap-related functions' bugs
1. sync hw ptr before calculating the avail
2. return zero when reading or writing successfully
2020-12-09 15:49:00 +08:00
dvdli cc04ef66f5 fix bugs in the pcm_open_* functions
1. Align the document and the code.
2. Copy error messages to bad_pcm object for client to get more info
   when opening failed.
2020-12-09 15:14:10 +08:00
dvdli 57ff1ba0cd Merge pull request #194 from dvdli/tinymix-dev
Fix tinymix bugs and support setting negative values
2020-12-09 15:04:44 +08:00
dvdli 4c0d4be795 correct index of integer string and reduce the life time of variables 2020-12-09 14:18:56 +08:00
dvdli f201a65f16 add usage of VALUES 2020-12-07 16:30:50 +08:00
dvdli e3939c5b85 add support setting negative values to tinymix 2020-12-07 15:03:16 +08:00
dvdli f7fcb287d1 formatting and remove tinymix prefix of static functions 2020-12-07 11:47:42 +08:00
dvdli 61f14087f3 duplicate an argv list to avoid the argv order changed 2020-12-07 11:16:14 +08:00
dvdli 8984e0e2a6 fix printing format and wrong control for data printing
tinymix_detail_control took controls' name as its parameter to
identify which control is that we want to print data of. However,
if there are some controls with same name, we will always print
the data of the first one.
2020-12-04 10:24:31 +08:00
dvdli a2e22bb593 Merge pull request #192 from dvdli/android-aosp-sync
fix build breakage in Android
2020-12-04 09:54:51 +08:00
dvdli ee280e8ade Merge pull request #191 from dvdli/tinyalsa-tests
Tests for libtinyalsa
2020-12-04 09:54:26 +08:00
David Li d9622de48b fix build breakage
1. Add a missing field and a function
2. Disable the deprecated attribute in Android temporarily to
   allow us to use "pcm_read/write" which are deprecated upstream
3. Remove an unused define and an include in mixer.h
4. Add mixer_ctl_event and copy the snd_ctl_event to mixer_ctl_event
5. Add pcm_ioctl function and mark as deprecated function
2020-12-02 07:46:19 +00:00
dvdli 0821e39571 fix typo, add comments to describe the tests and fix the loopback test 2020-12-02 15:20:20 +08:00
dvdli 5818ecf32c add instructions to run tests and fix typo 2020-12-01 14:10:34 +08:00
dvdli 903411c837 add unit tests
1. add mixer event test
2. add pcm capturing test
3. add pcm loopback test
2020-11-26 11:11:19 +08:00
dvdli b4dbaa08e3 add unit tests for mixer related functions 2020-11-23 11:39:27 +08:00
dvdli 8c6aba1c8d add unit tests for pcm_* functions 2020-11-16 17:07:04 +08:00
dvdli 87c428fa10 Merge pull request #189 from wksuper/master
Backward compatible for pcm_write() pcm_read()
2020-11-04 13:53:36 +08:00
dvdli df7a77773c Merge pull request #190 from dvdli/tinyplay-dev
Fix tinyplay bugs
2020-11-04 13:52:23 +08:00
dvdli 5cd807562c calcuate the thresholds after options parsing
The period size and count may be changed after options parsing. We need
to set proper threshoulds.
2020-11-02 16:42:37 +08:00
dvdli b9d254f525 modify the buffer size to the period size to avoid underrun 2020-11-02 15:56:45 +08:00
dvdli fa80ef9436 Merge pull request #188 from dvdli/android-dev
Synchronize the changes on AOSP repo
2020-11-02 09:48:10 +08:00
Kui Wang 9f3a515493 Backward compatible for pcm_write() pcm_read()
Current return value of pcm_write()/pcm_read()
comes from pcm_writei()/pcm_readi() which is the
actual frames written/read. But the old pcm_write()
/pcm_read() just returns 0 on success and a nagative
value on error.

This change will keep the pcm_write()/pcm_read() as
the old behavior which has been already used by
many applications, and is also matching the comment
above each function.

Signed-off-by: Kui Wang <wangkuisuper@hotmail.com>
2020-11-01 23:27:53 +08:00
dvdli 9de8d71901 AOSP CL "tinymix: fix setting enum str started with digits"
https://android.googlesource.com/platform/external/tinyalsa/+/f2d93a540297e75815eeb6644bf675cdae3be909

commit	f2d93a540297e75815eeb6644bf675cdae3be909
author	HW Lee <hwlee@google.com>

tinymix: fix setting enum str started with digits

For those value strings which are started with digits, they must be set
as enum instead of index value.

Test: with mixer control values started with digits like '48KHz'
Change-Id: I1c70f5613a48d020d3248b71c1e4384f83e33d25
Signed-off-by: HW Lee <hwlee@google.com>
2020-10-29 18:38:53 +08:00
dvdli d057691ea0 check whether the audio data are still enough to play
reference: https://android.googlesource.com/platform/external/tinyalsa/+/8b7274b2ec686c87673bf39328381acbdea1a333

commit	8b7274b2ec686c87673bf39328381acbdea1a333
author	Haynes Mathew George <hgeorge@codeaurora.org>

tinyplay: play PCM up to size specified in the header

tinyplay plays to the end of file without checking whether playback
goes beyond end of data section which its size is specified in the
RIFF wave header. This could lead to playing out unwanted data which
is placed at the end of file.

authored-by: Patrick Lai <plai@codeaurora.org>

Change-Id: I17bd3f6ebca4813f8987585472208c1f52696cae
2020-10-29 18:31:55 +08:00
dvdli 0bc69241e5 AOSP CL "tinyalsa: check for NULL mmap_status"
https://android.googlesource.com/platform/external/tinyalsa/+/62644f7a3c4cfa18d7935f731cf59b675669d17a

commit	62644f7a3c4cfa18d7935f731cf59b675669d17a
author	Phil Burk <philburk@google.com>

tinyalsa: check for NULL mmap_status

pcm_mmap_get_hw_ptr() was not checking pcm->mmap_status and
crashed when it was NULL.

Bug: 64346189
Test: input_monitor.cpp, see bug report for repro steps
Change-Id: I8436686a231eb01a82dd28ca2cce561d5460bcd6
2020-10-29 16:32:44 +08:00
dvdli 8f3c405caf AOSP CL "pcm: Fix usage of oops() function for use of strerror."
https://android.googlesource.com/platform/external/tinyalsa/+/50028cd233f8cf8a084e950c951eefc01e1cd15c

commit	50028cd233f8cf8a084e950c951eefc01e1cd15c
author	John Muir <muirj@google.com>

pcm: Fix usage of oops() function for use of strerror.

The oops() function expected errno to be passed in, but at some
point it was broken to look at errno itself, and ignore the
passed-in value.

Fix the oops() function to check the passed-in value, and modify
uses of oops() to actually pass in errno and not -errno or the
return value from the errored function call.

Bug: None
Test: pcm error code printed correctly.
Change-Id: I555e1eda0cdd0cc9b94e05423d341f1c08f8e485
(cherry picked from commit 2c1d902ace5f78dcff0c39740642d269b2e17dff)

Note: the oops in pcm_mmap_transfer was removed.
2020-10-29 16:24:43 +08:00
dvdli 89063d25a8 AOSP CL "tinyalsa: fix typos in tinyplay and asoundlib.h"
commit	f451f433520fc154de6e371747f21d2f746da83b
author	Glenn Kasten <gkasten@google.com>

tinyalsa: fix typos in tinyplay and asoundlib.h

Test: run tinyplay and look for typos in the output
Change-Id: Ieedcc1b7610700aa3d5ff913d5c01105db2c1601
2020-10-29 15:32:35 +08:00
dvdli 0b906733f3 AOSP CL "pcm: add API for MMAP NO IRQ mode"
https://android.googlesource.com/platform/external/tinyalsa/+/5b15b4cbd9e779a4ecd87e0f757fb0f8f6b9bcb8

commit	5b15b4cbd9e779a4ecd87e0f757fb0f8f6b9bcb8
author	Eric Laurent <elaurent@google.com>

pcm: add API for MMAP NO IRQ mode

Bug: 33398120
Test: build
Change-Id: Iecb47f76337d98ceb01044ca488a04e1f350c6bc
2020-10-28 22:56:53 +08:00
dvdli 5fcee0c184 AOSP CL "Add pcm_get_poll_fd"
https://android.googlesource.com/platform/external/tinyalsa/+/b42510d55bafc96805a44bd6ac40faac28ebd219

commit	b42510d55bafc96805a44bd6ac40faac28ebd219
author	Dylan Reid <dgreid@chromium.org>

Add pcm_get_poll_fd

Similar to ALSA snd_pcm_get_poll_fd, this will allow a user to wait for
a sound device to have data in a poll(2) call.  The hotword thread will
use this to wait for a message on its socket or for audio data to become
ready.

Change-Id: I61375a73d7a842b00362fc707c12f99aa18e0bdf
Signed-off-by: Dylan Reid <dgreid@chromium.org>
2020-10-28 22:22:27 +08:00
dvdli 295e2fc9fd AOSP CL "Export pcm_mmap_avail"
https://android.googlesource.com/platform/external/tinyalsa/+/9074cfc4127cb841f0633b35895141f90da3f0d6

commit	9074cfc4127cb841f0633b35895141f90da3f0d6
author	Dylan Reid <dgreid@chromium.org>

Export pcm_mmap_avail

This is useful for timer based wakeups and for checking how much data
has been captured by a hotwording device.

Change-Id: I409201a5c9ce73abc807a9dd767beb3a32810f06
Signed-off-by: Dylan Reid <dgreid@chromium.org>
2020-10-28 22:18:40 +08:00
dvdli 3eb0f55c81 initialize silence_size to zero 2020-10-28 22:15:21 +08:00
dvdli f55c43b508 AOSP CL "tinyalsa: channel status set as per IEC958"
https://android.googlesource.com/platform/external/tinyalsa/+/49a61374fc18a0f39da0d9c11cc9ccc3e9c1ec3f

commit	49a61374fc18a0f39da0d9c11cc9ccc3e9c1ec3f
author	Yogesh Agrawal <yagrawal@nvidia.com>

tinyalsa: channel status set as per IEC958

Add support for modifying the IEC958 structure in a mixer_ctl.

Bug: 9428304
Bug: 22576112
Change-Id: I8982340da9403a8a9e36b389fc97e9c635a9f681
2020-10-28 22:09:09 +08:00
dvdli 8810a5d953 AOSP CL "pcm: add support to set silence_size"
https://android.googlesource.com/platform/external/tinyalsa/+/e25fe0b50ea717a9f347dcb927d396e8772e6362

commit	e25fe0b50ea717a9f347dcb927d396e8772e6362
author	Maneet Singh <mmaneetsingh@nvidia.com>

pcm: add support to set silence_size

Tinyalsa always set silence_size to zero. Add support to set this
pcm software parameter as required.

Bug: 20226809
Bug: 20300203
Change-Id: I25de43623dc04bf5a3ad4c6573bc2b8dad1eec5e
2020-10-28 17:37:19 +08:00
dvdli f1449a1dc9 Merge remote-tracking branch 'origin' into android-dev 2020-10-28 16:12:19 +08:00
dvdli a6195345aa AOSP CL "Add pcm_params string conversion and format checking"
https://android.googlesource.com/platform/external/tinyalsa/+/70530a69767a9a383c5bf546e6e803aac08a5a1e%5E!/

title: Add pcm_params string conversion and format checking
commit	70530a69767a9a383c5bf546e6e803aac08a5a1e
author	Andy Hung <hunga@google.com>
2020-10-28 16:05:19 +08:00
dvdli fbfd095ef6 Merge pull request #185 from notdave22/master
Fix pcm-write example
2020-10-21 14:22:07 +08:00
dvdli b62f137501 Merge pull request #186 from gkasten/android
Add and update files from Android downstream branch to more closely m…
2020-10-19 17:57:53 +08:00
Glenn Kasten dea96bbde1 Add and update files from Android downstream branch to more closely match
Change-Id: If0ebdf44667202eaf73ec41f583092bf61e88b63
2020-09-22 15:19:39 -07:00