Commit Graph

511 Commits

Author SHA1 Message Date
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
Simon Wilson a64de01e0c Merge pull request #183 from tinyalsa/version
Add changelog for tinyalsa 2.0.0
2020-09-21 11:53:38 -06:00
Simon Wilson c18601cb25 Add changelog for tinyalsa 2.0.0
This should also fix the version check in scripts/travis-build.sh
2020-09-21 11:49:06 -06:00
Simon Wilson a10cd5d0a6 Merge pull request #182 from ericriff/eriff/fix-cmakelist
Fix error when building with -DTINYALSA_BUILD_UTILS=OFF
2020-09-21 10:15:11 -06:00
Simon Wilson 632a053c67 Merge pull request #173 from rohkkumar/mixer_fix
Fix mixer set/get for tlv based controls
2020-09-21 10:13:57 -06:00
Riff, Eric 2a015c1ad7 Fix error when building with -DTINYALSA_BUILD_UTILS=OFF 2020-09-16 21:38:54 -03:00
Simon Wilson 584620bd9f Merge pull request #181 from gkasten/make_depend
Fix Makefile dependencies
2020-09-16 14:12:32 -06:00
Simon Wilson 564e48ce1b Merge pull request #180 from gkasten/doxyfile
Update Doxyfile from version 1.8.11 to 1.8.17
2020-09-16 14:11:59 -06:00
Simon Wilson f5bf52510f Merge pull request #177 from gkasten/readme
Update README.md for build systems and Debian
2020-09-16 14:11:14 -06:00
Glenn Kasten b362ef9808 Fix Makefile dependencies 2020-09-16 12:37:00 -07:00
Glenn Kasten 2e7540419e Update Doxyfile from version 1.8.11 to 1.8.17 2020-09-16 12:32:52 -07:00
Glenn Kasten d62231683b Update README.md for build systems and Debian 2020-09-16 08:54:49 -07:00
Simon Wilson 3deaec9767 Merge pull request #176 from tinyalsa/issue-175
Minor TLV Fixes
2020-09-08 13:27:12 -06:00
notdave22 56c911d4dd per pcm_writei ' @return On success, this function returns the number of frames written; otherwise, a negative number.' 2020-09-04 06:27:33 -05:00
Rohit kumar 0085737734 tinymix: Fix get/set for tlv based mixer controls
TLV header is added by tinyalsa library. Remove tlv
header addition from tinymix to avoid adding it twice.
2020-09-04 14:58:39 +05:30
Rohit kumar 8376d8881b mixer: Fix invalid size check in mixer_ctl_set/get_array
For TLV based mixer controls, mixer_ctl_set/get_array
adds TLV headers in the API itself. Size check for count
need not include tlv header size addition. Remove it to
fix size check.
2020-09-04 14:43:27 +05:30
Taylor Holberton 3cdc08926a Using struct for TLV size 2020-09-03 22:49:53 -05:00
Simon Wilson f5b4bceb78 Merge pull request #174 from rohkkumar/mmap_plugin_support
Mmap plugin support
2020-09-03 08:05:11 -06:00
Rohit kumar 3b7da4b6d3 pcm_plugin: Update pcm state check in ttstamp ops
TTstamp ops is called from pcm_open. Update state check
to avoid failure.
2020-09-03 11:34:16 +05:30
Rohit kumar cebab3bf93 tinyalsa: add plugin support for mmap/poll ops 2020-09-03 11:29:44 +05:30
Rohit kumar 7712fc4684 pcm_plugin: Update pcm state in sync_ptr ops
PCM state is currently not updated in plugin.
Add support to update the state variable.
2020-08-25 11:39:56 +05:30
Rohit kumar eea9f9676e include: tinyalsa: Add PCM state macros
Add PCM_STATE_OPEN and PCM_STATE_SETUP macros so that
it can be utilized by plugin to update sync_ptr state.
2020-08-25 11:39:41 +05:30
Taylor Holberton 22ae95eedd Fixed boundary check for enum 2020-08-12 23:06:08 -05:00
Taylor Holberton a94cc40d34 Bump version to 2.0.0 TinyALSA 2020-08-05 08:06:50 -05:00
Taylor Holberton 67f1430fd0 Reordered enums to be compatible with Google's TinyALSA 2020-08-05 08:04:36 -05:00
Taylor Holberton c5750b85a0 Fix last commit. 2020-07-19 14:59:36 -05:00
Taylor Holberton 2c30bcfcf1 Quick fix for #168 2020-07-19 12:19:54 -05:00
Taylor Holberton 9cde3ab3e7 Merge pull request #164 from E5ten/cmake-standard
cmake: specify c99
2020-06-30 16:09:38 -05:00
Taylor Holberton 8dc14e3a54 Merge pull request #165 from E5ten/cmake-fix-includedir
cmake: fix header install location
2020-06-30 16:08:49 -05:00