mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
a0e0d13542
This patch implements a PCM interface for streaming hotword phrases over SPI. Userspace can open the PCM device at anytime. The stream is blocked when no hotword is detected. The mic audio buffer on the DSP is a ~128KByte ring buffer that holds ~4sec of audio samples recorded from the DMIC (S16_LE, mono, 16KHz). After a hotword is detected, previous 2 seconds of audio (containing the detected hotword) is streamed first, then live capture continues until userspace closes the PCM stream. When transferring, copy one period at a time then call snd_pcm_period_elapsed(). This reduces the latency of transferring the initial ~2sec of audio after hotword detect since audio samples are available for userspace earlier. Signed-off-by: Ben Zhang <benzh@chromium.org> Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> Link: https://lore.kernel.org/r/20191018200449.141123-2-cujomalainey@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
18 lines
513 B
C
18 lines
513 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* rt5677-spi.h -- RT5677 ALSA SoC audio codec driver
|
|
*
|
|
* Copyright 2013 Realtek Semiconductor Corp.
|
|
* Author: Oder Chiou <oder_chiou@realtek.com>
|
|
*/
|
|
|
|
#ifndef __RT5677_SPI_H__
|
|
#define __RT5677_SPI_H__
|
|
|
|
int rt5677_spi_read(u32 addr, void *rxbuf, size_t len);
|
|
int rt5677_spi_write(u32 addr, const void *txbuf, size_t len);
|
|
int rt5677_spi_write_firmware(u32 addr, const struct firmware *fw);
|
|
void rt5677_spi_hotword_detected(void);
|
|
|
|
#endif /* __RT5677_SPI_H__ */
|