Move all alsa callings to a single block (alsa.c), so other blocks
such as the main structure, the signal process and the data analysis
modules will be independent to alsa, and new modules such as a
tinyalsa interface can be easily embedded into alsabat.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Use general data generator to replace local function, so other
modules can reuse the data generator rather than re-implement it.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Refactoring ALSA capture thread:
1. Move file open/seek operations to sub function, so all file
processes are now on a single function (read_from_pcm_loop()), so
the structure is more reasonable, the function API is simplified
and no need file cleanup in thread loop.
2. Replace the wav header processing lines with a general function
(update_wav_header()), which can be reused in other sections.
3. Add pthread_exit() for thread to exit safely in single line mode,
and correct comment.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Preserve errno value before use, since the value might be
changed by another library call.
Add "#include <errno.h>" and remove redundant include.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add common definitions of macros and data structures; Add functions
that used by multiple components, such as wav file reading and writing.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bernard Gautier <bernard.gautier@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>