]> git.alsa-project.org Git - tinycompress.git/log
tinycompress.git
22 months agofcplay: Modify play_samples func to support gapless playback.
Mohammad Rafi Shaik [Thu, 28 Sep 2023 07:18:06 +0000 (12:48 +0530)]
fcplay: Modify play_samples func to support gapless playback.

This patch will add changes which is required in play_samples
function to support gapless playback.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
22 months agofcplay: Add gapless playback support
Mohammad Rafi Shaik [Thu, 28 Sep 2023 06:52:36 +0000 (12:22 +0530)]
fcplay: Add gapless playback support

Add Gapless playback support while playing multiple audio files.

Gapless play command:
fcplay -c 1 -d 2 -g 1 test1.mp3 test2.mp3

In command "-g 1" option for enable gapless play.

Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
22 months agofcplay: Modify play_samples func to play multiple audio files
Mohammad Rafi Shaik [Thu, 28 Sep 2023 06:10:07 +0000 (11:40 +0530)]
fcplay: Modify play_samples func to play multiple audio files

This patch will modify the play_samples function to achive
multiple audio track play.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
22 months agofcplay: Add multiple audio files playback support
Mohammad Rafi Shaik [Thu, 28 Sep 2023 05:34:19 +0000 (11:04 +0530)]
fcplay: Add multiple audio files playback support

This patch will add changes which is required to play
multiple audio files.

The file_count variable is required for index validation and play
multiple audio files.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agoRelease v1.2.8 v1.2.8
Jaroslav Kysela [Mon, 24 Oct 2022 08:17:37 +0000 (10:17 +0200)]
Release v1.2.8

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agocplay: add parentheses around comparison in operand of ‘&’
Vinod Koul [Thu, 13 Oct 2022 12:45:54 +0000 (18:15 +0530)]
cplay: add parentheses around comparison in operand of ‘&’

We get a warning:
cplay.c: In function ‘find_adts_header’:
cplay.c:259:41: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
  259 |         if ((buf[0] != 0xff) || (buf[1] & 0xf0 != 0xf0))

Resolve by adding a parentheses around "&" case

Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agocplay: remove set but not used warnings
Vinod Koul [Thu, 13 Oct 2022 12:19:57 +0000 (17:49 +0530)]
cplay: remove set but not used warnings

cplay.c: In function ‘find_adif_header’:
cplay.c:367:13: warning: variable ‘object_type’ set but not used [-Wunused-but-set-variable]
  367 |         int object_type;
      |             ^~~~~~~~~~~

cplay.c:366:13: warning: variable ‘bitrate’ set but not used [-Wunused-but-set-variable]
  366 |         int bitrate;
      |             ^~~~~~~

cplay.c:91:27: warning: ‘DEFAULT_CODEC_ID’ defined but not used [-Wunused-const-variable=]
   91 | static const unsigned int DEFAULT_CODEC_ID = SND_AUDIOCODEC_PCM;
      |                           ^~~~~~~~~~~~~~~~

While at it, cleanup the code a bit as well removing now redundant
braces around if-else

So remove these unused variables

Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agoutils: cplay: Add support for ID3v2 tag skip
Laurentiu Mihalcea [Fri, 7 Oct 2022 11:38:09 +0000 (14:38 +0300)]
utils: cplay: Add support for ID3v2 tag skip

This patch will allow playing MP3 files containing ID3v2
tag at the beginning of the file.

This is done simply by parsing the ID3v2 header, extracting
the header size and seeking to that position (+10 bytes
from the header size which is not included in the 'header
size' field of the ID3v2 header)

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2 years agoREADME: mention official mirror
Vinod Koul [Mon, 10 Oct 2022 05:57:21 +0000 (11:27 +0530)]
README: mention official mirror

Since alsa-project is 'the' official mirror, we should still keep these links

2 years agoREADME: remove old alsa-project link
Vinod Koul [Mon, 10 Oct 2022 05:45:44 +0000 (11:15 +0530)]
README: remove old alsa-project link

git.alsa-project is not main repo now, so remove that in favour of the github link

3 years agoutils: cplay: Add support for pause/resume
Laurentiu Mihalcea [Fri, 26 Aug 2022 09:23:45 +0000 (12:23 +0300)]
utils: cplay: Add support for pause/resume

We want to be able to pause and resume the stream
just like the ALSA utilitary aplay does.

In order to do so, we first need to mark the read operations
on stdin as nonblocking and then enable the noncanonical mode
for the terminal. What this does is it makes the read operations
nonblocking and it makes the input available immediately.

After doing so, we can check if we receive a SPACE or ENTER
character from user and do pause/resume depending on current
stream state (and by this I mean if the stream is currently
paused and we receive a SPACE or ENTER then we resume it
and vice-versa)

Signed-off-by: Maurine Creton <maurine.creton@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
3 years agoutils: cplay: Reset file cursor after MP3 header parse
Laurentiu Mihalcea [Fri, 26 Aug 2022 08:52:38 +0000 (11:52 +0300)]
utils: cplay: Reset file cursor after MP3 header parse

We need to reset the file cursor to the beginning of the file.

Initially, the program would simply get stuck polling the
compress fd. This was probably because of the fact that the
codec would hang because of the fact that it was expecting
to receive the MP3 data along with its associated MP3 header.

This was not the case for the first (header, data) pair because,
after parsing the first header, the file cursor would point
at the beginning of the data region.

By resetting the file cursor to the beginning of the file,
the codec will receive all the (header, data) pairs it
actually expects.

Suggested-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
4 years agoRelease v1.2.5 v1.2.5
Jaroslav Kysela [Mon, 31 May 2021 08:07:44 +0000 (10:07 +0200)]
Release v1.2.5

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoinclude: add tinywave.h to noinst_HEADERS
Jaroslav Kysela [Mon, 31 May 2021 08:07:19 +0000 (10:07 +0200)]
include: add tinywave.h to noinst_HEADERS

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoMerge pull request #10 from TangleZ/master
Vinod Koul [Wed, 7 Apr 2021 06:19:06 +0000 (11:49 +0530)]
Merge pull request #10 from TangleZ/master

cplay: Add suport for AAC audio codec

4 years agocplay: Add suport for AAC audio codec
Zhang Peng [Tue, 6 Apr 2021 12:18:26 +0000 (20:18 +0800)]
cplay: Add suport for AAC audio codec

Add parse_aac_header API to parse AAC streams, support ADTS and
ADIF format.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
4 years agoMerge pull request #9 from dbaluta/wave
Vinod Koul [Mon, 8 Feb 2021 12:01:54 +0000 (17:31 +0530)]
Merge pull request #9 from dbaluta/wave

Add support for WAVE file format in cplay

4 years agocplay: Add suport for PCM audio codec
Daniel Baluta [Thu, 7 Jan 2021 21:01:06 +0000 (23:01 +0200)]
cplay: Add suport for PCM audio codec

Make use of newly added parse_wave_header function in order
to discover PCM codec properties.

PCM with tinycompress interface is very useful for testing
new compress API implementations and can be enabled using
--enable-pcm option at configuration time.

e.g:
    - ./gitcompile --enable-pcm

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
4 years agowave: Introduce parse_wave header
Daniel Baluta [Thu, 7 Jan 2021 20:57:14 +0000 (22:57 +0200)]
wave: Introduce parse_wave header

This parses a canonical WAVE header and fills in
informationlike channels, rate and format.

In tinycompress, we use canonical WAVE format described here:

http://soundfile.sapp.org/doc/WaveFormat/

A WAVE file is often just a RIFF file with a single "WAVE" chunk which
consists of two sub-chunks -- a "fmt " chunk specifying the data format
and a "data" chunk containing the actual sample data.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
4 years agowave: Separate wave functions to wave file
Daniel Baluta [Thu, 7 Jan 2021 18:36:22 +0000 (20:36 +0200)]
wave: Separate wave functions to wave file

Move all related wave functions from crecord to their own wave.c
file.

This helps organizing the code so that both cplay/crecord can
use wave functions.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
4 years agocrecord: Move wave data structures to their own header
Daniel Baluta [Thu, 7 Jan 2021 18:17:58 +0000 (20:17 +0200)]
crecord: Move wave data structures to their own header

This is in preparation for adding wave parsing routines
to be used by tinycompress utilities.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
4 years agoRelease v1.2.4 v1.2.4
Jaroslav Kysela [Tue, 20 Oct 2020 17:45:07 +0000 (19:45 +0200)]
Release v1.2.4

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoadd tinycompress/compress_ops.h to include/Makefile.am
Jaroslav Kysela [Tue, 20 Oct 2020 17:43:53 +0000 (19:43 +0200)]
add tinycompress/compress_ops.h to include/Makefile.am

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agohandle TINYCOMPRESS_PLUGIN_DIR environment variable
Jaroslav Kysela [Tue, 20 Oct 2020 16:45:11 +0000 (18:45 +0200)]
handle TINYCOMPRESS_PLUGIN_DIR environment variable

The path specified in environment variable TINYCOMPRESS_PLUGIN_DIR
can be used to modify the build-in path at runtime.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoMerge pull request #6 from rohkkumar/plugin_support
Vinod Koul [Fri, 16 Oct 2020 05:34:08 +0000 (11:04 +0530)]
Merge pull request #6 from rohkkumar/plugin_support

Plugin support in tinycompress

4 years agosrc: lib: compress: Add support for plugins
Rohit kumar [Tue, 22 Sep 2020 11:52:05 +0000 (17:22 +0530)]
src: lib: compress: Add support for plugins

Add compress_open_by_name() and is_codec_supported_by_name()
to support plugins. Format of name is 'hw:<card>,<device>'
for hw compress nodes and '<plugin_name>:<custom_data>'
for virtual compress nodes. It dynamically loads the plugin
library whose name is libtinycompress_module_<plugin_name>.so.
Plugin library needs to expose compress_plugin_ops.
Default path of plugin lib is /usr/lib/tinycompress-lib/ and it
can be updated by defining TINYCOMPRESS_PLUGIN_DIR in makefile.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
5 years agosrc: lib: Move functionality to compress_hw.c
Rohit kumar [Tue, 22 Sep 2020 10:53:39 +0000 (16:23 +0530)]
src: lib: Move functionality to compress_hw.c

Add compress_hw.c to handle all operations associated
with HW compress nodes. Move handling to compress_hw
using compress_hw_ops.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
5 years agoinclude: tinycompress: Add compress_ops.h
Rohit kumar [Tue, 22 Sep 2020 10:34:58 +0000 (16:04 +0530)]
include: tinycompress: Add compress_ops.h

Add compress_ops.h needed to support plugins. Compress_ops
can be used to jump to either hw compress node ops or to
virtual compress node ops.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
5 years agoRelease v1.2.3 v1.2.3
Jaroslav Kysela [Sun, 7 Jun 2020 17:19:45 +0000 (19:19 +0200)]
Release v1.2.3

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agosound: fix the snd_dec_alac structure
Vinod Koul [Mon, 18 May 2020 15:08:56 +0000 (20:38 +0530)]
sound: fix the snd_dec_alac structure

Update of header to latest version bought wrong update for struct
snd_dec_alac so fix it to correct version

Fixes: b1a8b075f134 ("sound: update header to v0.2.0")
Signed-off-by: Vinod Koul <vkoul@kernel.org>
5 years agosound: update header to v0.2.0
Vinod Koul [Tue, 24 Mar 2020 06:52:45 +0000 (12:22 +0530)]
sound: update header to v0.2.0

Kernel has upgraded compress headers with support for WMA, ALAC and APE
and bumped version to 0.2.0, so update this header as well

Signed-off-by: Vinod Koul <vkoul@kernel.org>
5 years agoRelease v1.2.2 v1.2.2
Jaroslav Kysela [Wed, 19 Feb 2020 09:35:45 +0000 (10:35 +0100)]
Release v1.2.2

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agofcplay: initial addition
Vinod Koul [Thu, 5 Dec 2019 07:57:28 +0000 (13:27 +0530)]
fcplay: initial addition

This tool was forked from tinycompress cplay. The fork was required due
to this linking against libavcodec which is GPL. This uses libav APIs to
parse the compressed files and send the audio stream to compressed
device using tinycompress APIs

Right now it supports only playback on MP3 (no problems now not finding
sync word) and flac files.

Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
5 years agotinycompress: Add pc file
Vinod Koul [Fri, 15 Nov 2019 14:15:33 +0000 (19:45 +0530)]
tinycompress: Add pc file

Add pc file for the users of this lib

Signed-off-by: Vinod Koul <vkoul@kernel.org>
5 years agosound: update header for FLAC
Vinod Koul [Wed, 13 Nov 2019 11:34:33 +0000 (17:04 +0530)]
sound: update header for FLAC

Signed-off-by: Vinod Koul <vkoul@kernel.org>
6 years agoRelease v1.1.8 v1.1.8
Jaroslav Kysela [Mon, 7 Jan 2019 12:55:44 +0000 (13:55 +0100)]
Release v1.1.8

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
6 years agocplay: Always write whole buffer requested by user
Daniel Baluta [Mon, 5 Nov 2018 14:02:43 +0000 (16:02 +0200)]
cplay: Always write whole buffer requested by user

cplay first writes frag * fragment_size and then
it only writes one fragment at a time.

This means for example than if the user supplied a buffer_size
it will only be used for the first write.

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
6 years agotinycompress: Fix missing '}' around extern C
Piotr Stankiewicz [Thu, 6 Dec 2018 10:04:27 +0000 (10:04 +0000)]
tinycompress: Fix missing '}' around extern C

Signed-off-by: Piotr Stankiewicz <piotrs@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
6 years agotinycompress: Update headers to include AUDIOCODEC_BESPOKE
Charles Keepax [Thu, 8 Nov 2018 17:12:32 +0000 (17:12 +0000)]
tinycompress: Update headers to include AUDIOCODEC_BESPOKE

commit dbb6b94339e8 ("ALSA: compress: Add SND_AUDIOCODEC_BESPOKE") added
an additional CODEC type for bespoke CODECs. Update the local headers to
include this.

Reported-by: Andrew Ford <andrew.ford@cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
6 years agocplay: fix typo
Vinod Koul [Tue, 13 Nov 2018 14:54:07 +0000 (20:24 +0530)]
cplay: fix typo

Signed-off-by: Vinod Koul <vkoul@kernel.org>
6 years agoREADME: fix trailing spaces
Vinod Koul [Tue, 13 Nov 2018 14:07:10 +0000 (19:37 +0530)]
README: fix trailing spaces

Signed-off-by: Vinod Koul <vkoul@kernel.org>
6 years agoREADME: Update project github location
Vinod Koul [Tue, 13 Nov 2018 13:43:16 +0000 (19:13 +0530)]
README: Update project github location

alsa userspace is now moved to github, so update it in README

Signed-off-by: Vinod Koul <vkoul@kernel.org>
6 years agoREADME: update Vinod's email
Vinod Koul [Tue, 13 Nov 2018 13:38:16 +0000 (19:08 +0530)]
README: update Vinod's email

Update email address in README from old invalid id

Signed-off-by: Vinod Koul <vkoul@kernel.org>
6 years agoRelease v1.1.7 v1.1.7
Jaroslav Kysela [Tue, 16 Oct 2018 08:08:37 +0000 (10:08 +0200)]
Release v1.1.7

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
7 years agotinycompress: Update email address for Vinod
Vinod Koul [Thu, 26 Apr 2018 06:46:40 +0000 (12:16 +0530)]
tinycompress: Update email address for Vinod

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
7 years agocrecord: fix incorrect print specifier warning
Vinod Koul [Thu, 19 Apr 2018 06:11:31 +0000 (11:41 +0530)]
crecord: fix incorrect print specifier warning

We get a warning in crecord for incorrect print specifier, fix it by using
right one %u for unsigned int

crecord.c:380:17: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘unsigned int’ [-Wformat=]
  fprintf(finfo, "Recording file %s On Card %u device %u, with buffer of %lu bytes\n",

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
7 years agocplay: fix incorrect print specifier warning
Vinod Koul [Thu, 19 Apr 2018 06:11:31 +0000 (11:41 +0530)]
cplay: fix incorrect print specifier warning

We get a warning in cplay for incorrect print specifier, fix it by using
right one %ld for long unsigned int.

cplay.c:327:19: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
   fprintf(stderr, "codec ID %d is not supported\n", codec_id);

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
7 years agocplay: remove dead code check_codec_format_supported()
Vinod Koul [Thu, 19 Apr 2018 06:11:31 +0000 (11:41 +0530)]
cplay: remove dead code check_codec_format_supported()

The check_codec_format_supported() was added but never used so remove
it and eliminate unused function warning

cplay.c:103:20: warning: ‘codec_name_from_id’ defined but not used [-Wunused-function]

We can take from git if user appears

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
7 years agocplay: remove dead code codec_name_from_id()
Vinod Koul [Thu, 19 Apr 2018 06:11:31 +0000 (11:41 +0530)]
cplay: remove dead code codec_name_from_id()

The codec_name_from_id() was added but never used so remove it and
eliminate unused function warning

cplay.c:103:20: warning: ‘codec_name_from_id’ defined but not used [-Wunused-function]

We can take from git if user appears

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
7 years agocompress: remove dead code _is_codec_supported()
Vinod Koul [Thu, 19 Apr 2018 06:11:31 +0000 (11:41 +0530)]
compress: remove dead code _is_codec_supported()

The _is_codec_supported() was dead and none using it, so remove this and
eliminate unused function warning

compress.c:145:13: warning: ‘_is_codec_supported’ defined but not used [-Wunused-function]

We can take from git if user appears

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
7 years agocrecord: Use whole buffer requested by user
Charles Keepax [Fri, 13 Apr 2018 11:58:59 +0000 (12:58 +0100)]
crecord: Use whole buffer requested by user

Currently, crecord will only actually use 1 fragment worth of its
internal buffer no matter what the user requests. Correct this so that
the whole buffer requested by the user is used for copying data.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
7 years agoRelease v1.1.6 v1.1.6
Jaroslav Kysela [Tue, 3 Apr 2018 07:01:39 +0000 (09:01 +0200)]
Release v1.1.6

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
7 years agocplay: make get_codec_iec return void
Vinod Koul [Fri, 2 Feb 2018 17:34:46 +0000 (23:04 +0530)]
cplay: make get_codec_iec return void

get_codec_iec() doesn't return anything, so make return type as void

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
7 years agocplay: support IEC61937 format
Katsuhiro Suzuki [Fri, 2 Feb 2018 04:32:46 +0000 (13:32 +0900)]
cplay: support IEC61937 format

This patch adds very simple supports for IEC61937 S/PDIF format.

The cplay just specifies the format ID and sends audio data to ALSA.
There is no check the audio data is valid or invalid as IEC61937
specifications.

Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
7 years agocplay: move around MP3 header parsing method
Katsuhiro Suzuki [Fri, 2 Feb 2018 04:32:45 +0000 (13:32 +0900)]
cplay: move around MP3 header parsing method

This patch moves MP3 parsing method for -I option, this is for
adding other codec ID in the future.

Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
7 years agocplay: add option to specify codec ID
Katsuhiro Suzuki [Fri, 2 Feb 2018 04:32:44 +0000 (13:32 +0900)]
cplay: add option to specify codec ID

This patch adds a -I command line option to set the codec ID,
same as crecord.

Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
7 years agocplay: fix size and nmemb of mp3 header of fread
Katsuhiro Suzuki [Tue, 23 Jan 2018 02:33:11 +0000 (11:33 +0900)]
cplay: fix size and nmemb of mp3 header of fread

This patch swaps 'size' and 'nmemb' arguments of fread.
The fread returns always 1 (because 'nmemb' is 1) so checking
the return value is always failure.

Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
7 years agoRelease v1.1.5 v1.1.5
Jaroslav Kysela [Tue, 14 Nov 2017 07:52:11 +0000 (08:52 +0100)]
Release v1.1.5

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
7 years agotinycompress: clarify dual-license wording
Pierre-Louis Bossart [Wed, 18 Oct 2017 18:11:25 +0000 (13:11 -0500)]
tinycompress: clarify dual-license wording

There were reports of confusion in legal circles introduced by the wording
"tinycompress is provided under LGPL and BSD dual license" in the README.

Clarify with the addition of the wording traditionally used for dual licenses:

"This file is provided under a dual BSD/LGPLv2.1 license.  When using or
redistributing this file, you may do so under either license"

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoRelease v1.1.4 v1.1.4
Jaroslav Kysela [Fri, 12 May 2017 08:01:46 +0000 (10:01 +0200)]
Release v1.1.4

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
8 years agocrecord: Add option to specify codec ID
Richard Fitzgerald [Wed, 18 Jan 2017 16:29:54 +0000 (16:29 +0000)]
crecord: Add option to specify codec ID

This patch adds a -I command line option to set the codec ID,
either from a defined set of string values or as a number.

After discussion with Vinod it was agreed that we should only
allow writing to a file if we support creating the correct container
file format for that data. As we currently only have support for
creating WAV files only PCM data can be written to a file. Other
formats can be sent raw to stdout.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agocrecord: Fix some minor coding style problems
Richard Fitzgerald [Wed, 18 Jan 2017 16:29:53 +0000 (16:29 +0000)]
crecord: Fix some minor coding style problems

- Incorrect indenting of arguments to capture_samples()
- Wrap long line in capture_samples()
- Added a blank line in main() for readability
- Deleted extra trailing blank line at end of file

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoRelease v1.1.3 v1.1.3
Jaroslav Kysela [Tue, 20 Dec 2016 09:12:30 +0000 (10:12 +0100)]
Release v1.1.3

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
8 years agotinycompress: rename crec usages
Vinod Koul [Fri, 16 Dec 2016 07:36:51 +0000 (13:06 +0530)]
tinycompress: rename crec usages

The creord utility help listed crec as the utility name, change that to
crecord and also update the program explanation text.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agotinycompress: rename crec.c
Vinod Koul [Fri, 16 Dec 2016 07:24:02 +0000 (12:54 +0530)]
tinycompress: rename crec.c

Since the compress recorder utility is called crecord, it makes it apt to
have src file named crecord.c.

Reported-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
9 years agoRelease v1.1.1 v1.1.1
Jaroslav Kysela [Thu, 31 Mar 2016 13:12:42 +0000 (15:12 +0200)]
Release v1.1.1

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
9 years agotinycompress: INSTALL: Update the instructions
Vinod Koul [Thu, 10 Mar 2016 08:10:19 +0000 (13:40 +0530)]
tinycompress: INSTALL: Update the instructions

Reported-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
9 years agotinycompress: crec: make functions static
Vinod Koul [Sat, 9 Jan 2016 08:12:46 +0000 (13:42 +0530)]
tinycompress: crec: make functions static

Sparse rightly complains some functions should be static so make them static

crec.c:113:26: warning: symbol 'blank_wave_header' was not declared. Should it be static?
crec.c:239:6: warning: symbol 'capture_samples' was not declared. Should it be static?

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
9 years agotinycompress: crec: fix function declaration
Vinod Koul [Sat, 9 Jan 2016 08:12:46 +0000 (13:42 +0530)]
tinycompress: crec: fix function declaration

finish_record was not following ANSI standard for declaration as warned by
sparse

crec.c:193:26: warning: non-ANSI function declaration of function 'finish_record'

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
9 years agotinycompress: cplay: make functions static
Vinod Koul [Sat, 9 Jan 2016 08:12:46 +0000 (13:42 +0530)]
tinycompress: cplay: make functions static

Sparse rightly complains some functions should be static so make them static

cplay.c:100:5: warning: symbol 'parse_mp3_header' was not declared. Should it be static?
cplay.c:129:5: warning: symbol 'check_codec_format_supported' was not declared. Should it be static?
../../include/tinycompress/tinymp3.h:66:11: warning: symbol 'mp3_sample_rates' was not declared. Should it be static?
../../include/tinycompress/tinymp3.h:72:11: warning: symbol 'mp3_bit_rates' was not declared. Should it be static?

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
9 years agocrec: Always read whole number of fragments when length limit specified
Richard Fitzgerald [Thu, 3 Dec 2015 11:25:35 +0000 (11:25 +0000)]
crec: Always read whole number of fragments when length limit specified

This patch removes the lines that adjusted the read size to exactly
read to the end of the calculated length in bytes. Doing this could
lead to invalid fragment sizes being requested which may then cause
a read error on some codecs.

Instead we keep reading whole fragments until we have >= length bytes
of data captured.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
9 years agoRelease v1.1.0 v1.1.0
Jaroslav Kysela [Tue, 27 Oct 2015 13:34:07 +0000 (14:34 +0100)]
Release v1.1.0

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
9 years agoadd gitcompile
Jaroslav Kysela [Tue, 27 Oct 2015 11:02:09 +0000 (12:02 +0100)]
add gitcompile

10 years agobuild: Fix make distcheck
Arun Raghavan [Thu, 8 Oct 2015 10:41:28 +0000 (11:41 +0100)]
build: Fix make distcheck

srcdir may not be the same as builddir, so use the correct variable for
the include path.

Signed-off-by: Arun Raghavan <git@arunraghavan.net>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agocplay: check the values of fread
Vinod Koul [Fri, 8 May 2015 10:30:02 +0000 (16:00 +0530)]
cplay: check the values of fread

This fixes the following warning:
cplay.c: In function ‘play_samples’:
cplay.c:219:7: warning: ignoring return value of ‘fread’, declared with
attribute warn_unused_result [-Wunused-result]
  fread(&header, sizeof(header), 1, file);

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agoAuthors: add information about how to find authors
Vinod Koul [Fri, 8 May 2015 10:23:06 +0000 (15:53 +0530)]
Authors: add information about how to find authors

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agoChangelog: update to git log
Vinod Koul [Fri, 8 May 2015 10:19:05 +0000 (15:49 +0530)]
Changelog: update to git log

we dont use changelog file as git is a very good log of what we are
changing, so point to git log

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agoautotool: update the INSTALL file
Vinod Koul [Fri, 8 May 2015 10:18:06 +0000 (15:48 +0530)]
autotool: update the INSTALL file

toolchains are updating the INSTALL file so take the updated changes

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agotinycompress.h: explicitly include required headers
Qais Yousef [Tue, 5 May 2015 10:21:11 +0000 (11:21 +0100)]
tinycompress.h: explicitly include required headers

tinycompress.h was relying on other files to include linux/types.h and stdbool.h
which are required by it. Explicitly include it to fix compile errors when external
program tries to include this header.

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agosrc/lib/utils.c: remove this empty file
Qais Yousef [Tue, 5 May 2015 10:21:10 +0000 (11:21 +0100)]
src/lib/utils.c: remove this empty file

utils.c isn't implementing anything so delete it

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agocompress.c: fix check for errors from poll(), read() and write()
Qais Yousef [Tue, 5 May 2015 10:21:09 +0000 (11:21 +0100)]
compress.c: fix check for errors from poll(), read() and write()

When these functions fail they return -1 and set errno. Fix error checks
accordingly.

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agoAndroid.mk: Update to use the new location of source files
Qais Yousef [Tue, 5 May 2015 10:21:08 +0000 (11:21 +0100)]
Android.mk: Update to use the new location of source files

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agomakefile.linux: delete as no longer necessary/used
Qais Yousef [Tue, 5 May 2015 10:21:07 +0000 (11:21 +0100)]
makefile.linux: delete as no longer necessary/used

Now autotools takes care of generating Makefiles.

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agoadd .gitignore file
Qais Yousef [Tue, 5 May 2015 10:21:06 +0000 (11:21 +0100)]
add .gitignore file

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agoConvert the build system to autotools
Qais Yousef [Tue, 5 May 2015 10:21:05 +0000 (11:21 +0100)]
Convert the build system to autotools

Hopefully this should make tinycompress a more robust package.
This change splits the source into utils and lib.
No functional changes was introduced.

use autogen.sh to generate configure then run ./configure as with other
packages.

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agocrec: support streaming output to stdout
Ammar Zahid Ali Syed [Thu, 19 Feb 2015 14:55:40 +0000 (14:55 +0000)]
crec: support streaming output to stdout

It's useful for testing to be able to stream the captured
audio to stdout instead of having to go via a file.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Ammar Ali <aali@opensource.wolfsonmicro.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agomakefile.linux: allow env to override CROSS_COMPILE and CC
Qais Yousef [Tue, 20 Jan 2015 15:34:37 +0000 (15:34 +0000)]
makefile.linux: allow env to override CROSS_COMPILE and CC

allow env variables to override them without having to modify the makefile.

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
10 years agocrec: Fix error with opening file using O_CREAT
Ammar Zahid Ali Syed [Mon, 18 Aug 2014 08:41:58 +0000 (09:41 +0100)]
crec: Fix error with opening file using O_CREAT

The code was not compiling when mode was not passed to open()
while using O_CREAT offset. Passed mode to the open() alongwith
O_CREAT to specify the attributes of file and fix compile issue.

Signed-off-by: Ammar Zahid Ali Syed <ammar.zhd@googlemail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
11 years agotinycompress: update headers for packed, aligned
Vinod Koul [Thu, 19 Jun 2014 09:33:17 +0000 (15:03 +0530)]
tinycompress: update headers for packed, aligned

commit "6b24a8dd: ALSA: compress: fix the struct alignment to 4 bytes" updated
compress struct to force packed and aligned to 4 bytes. Update here a s well

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
11 years agotinycompress: update compress headers for sample rate field
Vinod Koul [Thu, 19 Jun 2014 09:27:59 +0000 (14:57 +0530)]
tinycompress: update compress headers for sample rate field

commit "929559b: ALSA: compress: add num_sample_rates in snd_codec_desc" adds
array for passing sample rate instead of bit map. Update the local header as
well

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
11 years agocompress: use int for samples in compress_get_tstamp
Vinod Koul [Mon, 17 Feb 2014 17:25:24 +0000 (22:55 +0530)]
compress: use int for samples in compress_get_tstamp

in 64bit updates we made the sample rate as 32bit explicitly, so update the
library API as well

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
11 years agocrec: Add primitive exception handling
Charles Keepax [Fri, 24 Jan 2014 11:37:35 +0000 (11:37 +0000)]
crec: Add primitive exception handling

Add very primitive signal handling, we will not attempt to drain any
remaining data etc. simply save out what we have to a file.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
11 years agocrec: Initial version of a compressed capture utility
Charles Keepax [Fri, 24 Jan 2014 11:37:34 +0000 (11:37 +0000)]
crec: Initial version of a compressed capture utility

This version only supports capture of PCM streams over a compressed
device and saves these as WAV files.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
11 years agotinycompress: remove usage of SNDRV_RATE_xxx
Vinod Koul [Mon, 16 Dec 2013 15:07:24 +0000 (20:37 +0530)]
tinycompress: remove usage of SNDRV_RATE_xxx

as now it is not to be used for passing the sampling rate

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
11 years agotinycompress: cplay: use the numeric sample rate
Vinod Koul [Mon, 16 Dec 2013 15:03:03 +0000 (20:33 +0530)]
tinycompress: cplay: use the numeric sample rate

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
11 years agotinycompress: update the header to kernel API v0.1.2
Vinod Koul [Mon, 16 Dec 2013 14:57:26 +0000 (20:27 +0530)]
tinycompress: update the header to kernel API v0.1.2

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
11 years agocompress: compress_wait() must return error if timed out
Richard Fitzgerald [Tue, 22 Oct 2013 10:51:58 +0000 (11:51 +0100)]
compress: compress_wait() must return error if timed out

The caller must be certain that a return of 0 really means
that compress is ready for more data, so when poll() returns
0 for a timeout we must report that as an error.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
12 years agocompress: Must check for POLLERR before POLLOUT/POLLIN
Richard Fitzgerald [Thu, 29 Aug 2013 08:32:02 +0000 (09:32 +0100)]
compress: Must check for POLLERR before POLLOUT/POLLIN

In the case of error the ALSA compressed driver sets revents as
(POLLOUT | POLLWRNORM | POLLERR) or (POLLIN | POLLWRNORM | POLLERR).
So we can't assume that POLLOUT or POLLIN indicate success, we must
check for POLLERR first.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
12 years agofix error returned by compress_wait()
Eric Laurent [Wed, 24 Jul 2013 17:37:16 +0000 (10:37 -0700)]
fix error returned by compress_wait()

oops() expects positive error codes.

Signed-off-by: Eric Laurent <elaurent@google.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
12 years agocompress: fix the typo in compress_get_alsa_rate()
Vinod Koul [Sat, 20 Jul 2013 06:30:38 +0000 (12:00 +0530)]
compress: fix the typo in compress_get_alsa_rate()

Reported-by: Ravi <ralama@codeaurora.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>