mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Audio: Add a NULL audio device that can be used to simply unit-level testing of audio decoders
This commit is contained in:
@@ -106,5 +106,57 @@ config AUDIO_WM8904
|
||||
that dependency is not explicit here.
|
||||
|
||||
if AUDIO_WM8904
|
||||
|
||||
config WM8904_INITVOLUME
|
||||
int "WM8904 initial volume setting"
|
||||
default 250
|
||||
|
||||
config WM8904_INFLIGHT
|
||||
int "WM8904 maximum in-flight audio buffers"
|
||||
default 2
|
||||
|
||||
config WM8904_MSG_PRIO
|
||||
int "WM8904 message priority"
|
||||
default 1
|
||||
|
||||
config WM8904_BUFFER_SIZE
|
||||
int "WM8904 preferred buffer size"
|
||||
default 8192
|
||||
|
||||
config WM8904_NUM_BUFFERS
|
||||
int "WM8904 preferred number of buffers"
|
||||
default 4
|
||||
|
||||
config WM8904_WORKER_STACKSIZE
|
||||
int "WM8904 worker thread stack size"
|
||||
default 768
|
||||
|
||||
endif # AUDIO_WM8904
|
||||
|
||||
config AUDIO_NULL
|
||||
bool "NULL audio device"
|
||||
default n
|
||||
depends on AUDIO
|
||||
---help---
|
||||
A do-nothinig audio device driver to simplify testing of audio
|
||||
decoders.
|
||||
|
||||
if AUDIO_NULL
|
||||
|
||||
config AUDIO_NULL_MSG_PRIO
|
||||
int "Null audio device message priority"
|
||||
default 1
|
||||
|
||||
config UDIO_NULL_BUFFER_SIZE
|
||||
int "Null audio device preferred buffer size"
|
||||
default 8192
|
||||
|
||||
config AUDIO_NULL_NUM_BUFFERS
|
||||
int "Null audio device preferred number of buffers"
|
||||
default 4
|
||||
|
||||
config AUDIO_NULL_WORKER_STACKSIZE
|
||||
int "Null audio device worker thread stack size"
|
||||
default 768
|
||||
|
||||
endif # AUDIO_NULL
|
||||
|
||||
@@ -47,6 +47,10 @@ ifeq ($(CONFIG_AUDIO_WM8904),y)
|
||||
CSRCS += wm8904.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AUDIO_NULL),y)
|
||||
CSRCS += audio_null.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AUDIO_I2SCHAR),y)
|
||||
CSRCS += i2schar.c
|
||||
endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -95,7 +95,7 @@ struct wm8904_dev_s
|
||||
* "half" that is referred to as "lower".
|
||||
*/
|
||||
|
||||
struct audio_lowerhalf_s dev; /* WM8904 audio lower half (this drive) */
|
||||
struct audio_lowerhalf_s dev; /* WM8904 audio lower half (this device) */
|
||||
|
||||
/* Our specific driver data goes here */
|
||||
|
||||
@@ -181,15 +181,10 @@ static int wm8904_stop(FAR struct audio_lowerhalf_s *dev);
|
||||
#ifdef CONFIG_AUDIO_MULTI_SESSION
|
||||
static int wm8904_pause(FAR struct audio_lowerhalf_s *dev,
|
||||
FAR void* session);
|
||||
#else
|
||||
static int wm8904_pause(FAR struct audio_lowerhalf_s *dev);
|
||||
#endif
|
||||
#endif
|
||||
#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME
|
||||
#ifdef CONFIG_AUDIO_MULTI_SESSION
|
||||
static int wm8904_resume(FAR struct audio_lowerhalf_s *dev,
|
||||
FAR void* session);
|
||||
#else
|
||||
static int wm8904_pause(FAR struct audio_lowerhalf_s *dev);
|
||||
static int wm8904_resume(FAR struct audio_lowerhalf_s *dev);
|
||||
#endif
|
||||
#endif
|
||||
@@ -1755,8 +1750,8 @@ static void wm8904_audio_input(FAR struct wm8904_dev_s *priv)
|
||||
* lower - Persistent board configuration data
|
||||
*
|
||||
* Returned Value:
|
||||
* A new lower half audio interface is returned for the WM8904 device is
|
||||
* returned on success; NULL is returned on failure.
|
||||
* A new lower half audio interface for the WM8904 device is returned on
|
||||
* success; NULL is returned on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user