Commit Graph

20 Commits

Author SHA1 Message Date
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 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 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 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 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 3eb0f55c81 initialize silence_size to zero 2020-10-28 22:15:21 +08:00
Ethan Sommer bdfd6e984b tinyplay: replace manual option parsing with optparse
This also removes the requirement for the file argument to come before
options.
2020-06-03 15:38:10 -04:00
Taylor Holberton d5fea77414 Waiting for PCM to finish before exiting 2020-04-24 13:44:14 -04:00
Taylor Holberton e67f9430fa Removed whitespace 2020-04-22 08:38:31 -04:00
jcromero 1ea4eec6a5 Fix typo in -D and -d options descriptions 2019-05-23 00:08:50 +02:00
Magickal Feline ecf27a44ff Added reading from stdin. 2017-12-15 02:36:07 -08:00
Taylor Holberton adb12103ab fixed short option in tinyplay 2017-11-06 21:20:45 -05:00
Jaikrishna Nemallapudi e125261297 Fix to pass num_frames to pcm_writei
pcm_writei expects size of data in frames, whereas currently size
is passed as number of bytes. So convert number of bytes to frames
for argument to pcm_writei.

Signed-off-by: Jaikrishna Nemallapudi <jaikrishnax.nemallapudi@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
2017-04-13 14:06:15 +05:30
Taylor Holberton e0781f13a7 Replaced old calls to pcm_read and pcm_write
The newer pcm_readi and pcm_writei functions are now being used.
2016-12-01 20:27:41 -08:00
Taylor Holberton 969ba7919d created cmd and ctx structures for tinyplay 2016-11-19 10:08:38 -08:00
Taylor Holberton f168b1218d added error if -i file-type doesn't make sense 2016-10-02 11:22:38 -04:00
Taylor Holberton 2fdee65cf7 checking results of fread() calls 2016-10-01 21:38:34 -04:00
Taylor Holberton b88fd4ff9c put programs into utils dir 2016-10-01 12:33:46 -04:00