mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 03:05:40 +08:00
arch/sim: add sim alsa support
Squashed commit of the following: sim audio: call alsa to playback/capture data sim/audio: correct the format capability sim/audio: add pause/resume support sim/audio: add auto stop when meet AUDIO_APB_FINAL sim/audio: fix abort when set small buffer_size sim/audio: move sim_audio.c to sim_alsa.c Change-Id: I8e00ece79159e844ca17fd4c363480b985ee0490 Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -201,6 +201,25 @@ config SIM_NET_BRIDGE_DEVICE
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
config SIM_SOUND
|
||||||
|
bool "Simulated sound support"
|
||||||
|
depends on AUDIO
|
||||||
|
default y
|
||||||
|
|
||||||
|
if SIM_SOUND
|
||||||
|
|
||||||
|
choice
|
||||||
|
prompt "Simulated sound Type"
|
||||||
|
default SIM_SOUND_ALSA
|
||||||
|
|
||||||
|
config SIM_SOUND_ALSA
|
||||||
|
bool "alsa support on sim"
|
||||||
|
depends on HOST_LINUX
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
config SIM_RPTUN_MASTER
|
config SIM_RPTUN_MASTER
|
||||||
bool "Remote Processor Tunneling Role"
|
bool "Remote Processor Tunneling Role"
|
||||||
depends on RPTUN
|
depends on RPTUN
|
||||||
|
|||||||
@@ -205,6 +205,11 @@ ifeq ($(CONFIG_RPTUN),y)
|
|||||||
CSRCS += up_rptun.c
|
CSRCS += up_rptun.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_SIM_SOUND_ALSA),y)
|
||||||
|
CSRCS += up_alsa.c
|
||||||
|
STDLIBS += -lasound
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_FS_HOSTFS),y)
|
ifeq ($(CONFIG_FS_HOSTFS),y)
|
||||||
ifneq ($(CONFIG_FS_HOSTFS_RPMSG),y)
|
ifneq ($(CONFIG_FS_HOSTFS_RPMSG),y)
|
||||||
HOSTSRCS += up_hostfs.c
|
HOSTSRCS += up_hostfs.c
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -113,6 +113,10 @@ void up_idle(void)
|
|||||||
bthcisock_loop();
|
bthcisock_loop();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_SIM_SOUND
|
||||||
|
sim_audio_loop();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ONESHOT
|
#ifdef CONFIG_ONESHOT
|
||||||
/* Driver the simulated interval timer */
|
/* Driver the simulated interval timer */
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
|
#include <nuttx/audio/audio.h>
|
||||||
#include <nuttx/drivers/drivers.h>
|
#include <nuttx/drivers/drivers.h>
|
||||||
#include <nuttx/fs/loop.h>
|
#include <nuttx/fs/loop.h>
|
||||||
#include <nuttx/fs/ioctl.h>
|
#include <nuttx/fs/ioctl.h>
|
||||||
@@ -281,4 +282,9 @@ void up_initialize(void)
|
|||||||
#if defined(CONFIG_FS_SMARTFS) && (defined(CONFIG_SIM_SPIFLASH) || defined(CONFIG_SIM_QSPIFLASH))
|
#if defined(CONFIG_FS_SMARTFS) && (defined(CONFIG_SIM_SPIFLASH) || defined(CONFIG_SIM_QSPIFLASH))
|
||||||
up_init_smartfs();
|
up_init_smartfs();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_SIM_SOUND
|
||||||
|
audio_register("pcm0p", sim_audio_initialize(true));
|
||||||
|
audio_register("pcm0c", sim_audio_initialize(false));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -397,6 +397,13 @@ int bthcisock_register(int dev_id);
|
|||||||
int bthcisock_loop(void);
|
int bthcisock_loop(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* up_audio.c ***************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_SIM_SOUND
|
||||||
|
struct audio_lowerhalf_s *sim_audio_initialize(bool playback);
|
||||||
|
void sim_audio_loop(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Debug ********************************************************************/
|
/* Debug ********************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_STACK_COLORATION
|
#ifdef CONFIG_STACK_COLORATION
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
#
|
||||||
|
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||||
|
#
|
||||||
|
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||||
|
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||||
|
# modifications.
|
||||||
|
#
|
||||||
|
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||||
|
CONFIG_ARCH="sim"
|
||||||
|
CONFIG_ARCH_BOARD="sim"
|
||||||
|
CONFIG_ARCH_BOARD_SIM=y
|
||||||
|
CONFIG_ARCH_CHIP="sim"
|
||||||
|
CONFIG_ARCH_SIM=y
|
||||||
|
CONFIG_AUDIO=y
|
||||||
|
CONFIG_BOARDCTL_APP_SYMTAB=y
|
||||||
|
CONFIG_BOARDCTL_POWEROFF=y
|
||||||
|
CONFIG_BOARD_LOOPSPERMSEC=0
|
||||||
|
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
||||||
|
CONFIG_BUILTIN=y
|
||||||
|
CONFIG_DEBUG_SYMBOLS=y
|
||||||
|
CONFIG_DEV_LOOP=y
|
||||||
|
CONFIG_DEV_ZERO=y
|
||||||
|
CONFIG_EXAMPLES_HELLO=y
|
||||||
|
CONFIG_FAT_LCNAMES=y
|
||||||
|
CONFIG_FAT_LFN=y
|
||||||
|
CONFIG_FSUTILS_PASSWD=y
|
||||||
|
CONFIG_FSUTILS_PASSWD_READONLY=y
|
||||||
|
CONFIG_FS_BINFS=y
|
||||||
|
CONFIG_FS_FAT=y
|
||||||
|
CONFIG_FS_HOSTFS=y
|
||||||
|
CONFIG_FS_PROCFS=y
|
||||||
|
CONFIG_FS_ROMFS=y
|
||||||
|
CONFIG_IDLETHREAD_STACKSIZE=4096
|
||||||
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
|
CONFIG_MAX_TASKS=64
|
||||||
|
CONFIG_NFILE_DESCRIPTORS=32
|
||||||
|
CONFIG_NSH_ARCHINIT=y
|
||||||
|
CONFIG_NSH_ARCHROMFS=y
|
||||||
|
CONFIG_NSH_BUILTIN_APPS=y
|
||||||
|
CONFIG_NSH_FATDEVNO=2
|
||||||
|
CONFIG_NSH_FILE_APPS=y
|
||||||
|
CONFIG_NSH_READLINE=y
|
||||||
|
CONFIG_NSH_ROMFSDEVNO=1
|
||||||
|
CONFIG_NSH_ROMFSETC=y
|
||||||
|
CONFIG_PATH_INITIAL="/bin"
|
||||||
|
CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=2048
|
||||||
|
CONFIG_READLINE_TABCOMPLETION=y
|
||||||
|
CONFIG_SCHED_HAVE_PARENT=y
|
||||||
|
CONFIG_SCHED_ONEXIT=y
|
||||||
|
CONFIG_SCHED_WAITPID=y
|
||||||
|
CONFIG_SDCLONE_DISABLE=y
|
||||||
|
CONFIG_START_MONTH=6
|
||||||
|
CONFIG_START_YEAR=2008
|
||||||
|
CONFIG_SYSTEM_NSH=y
|
||||||
|
CONFIG_SYSTEM_NXPLAYER=y
|
||||||
|
CONFIG_SYSTEM_NXRECORDER=y
|
||||||
|
CONFIG_USERMAIN_STACKSIZE=4096
|
||||||
|
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||||
Reference in New Issue
Block a user