seeed-voicecard/Makefile

53 lines
983 B
Makefile
Raw Normal View History

#
# Peter Yang <turmary@126.com>
# Copyright (c) 2019 Seeed Studio
#
# MIT License
#
uname_r=$(shell uname -r)
# If KERNELRELEASE is defined, we've been invoked from the
# kernel build system and can use its language
ifneq ($(KERNELRELEASE),)
# $(warning KERNELVERSION=$(KERNELVERSION))
2017-09-14 10:29:26 +02:00
snd-soc-wm8960-objs := wm8960.o
snd-soc-ac108-objs := ac108.o ac101.o
Operational change to correct for 5.5+ change in trigger order; REVISIT! Need to revisit, and do in a different way. https://github.com/respeaker/seeed-voicecard/issues/290 6mics / linear 4 mics: fails to record against v5.10 kernel https://github.com/raspberrypi/linux/issues/4279 [regression] alsa system call blocks on record between 5.4.83 and 5.5.19 In v5.5, commit 4378f1fbe924054a09ff0d4e39e1a581b9245252 Author: Peter Ujfalusi <peter.ujfalusi@ti.com> Date: Fri Sep 27 10:16:46 2019 +0300 ASoC: soc-pcm: Use different sequence for start/stop trigger On stream stop currently we stop the DMA first followed by the CPU DAI. This can cause underflow (playback) or overflow (capture) on the DAI side as the DMA is no longer feeding data while the DAI is still active. It can be observed easily if the DAI side does not have FIFO (or it is disabled) to survive the time while the DMA is stopped, but still can happen on relatively slow CPUs when relatively high sampling rate is used: the FIFO is drained between the time the DMA is stopped and the DAI is stopped. It can only fixed by using different sequence within trigger for 'stop' and 'start': case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: Trigger order: dai_link, DMA, CPU DAI then the codec case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: Trigger order: codec, CPU DAI, DMA then dai_link Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927071646.22319-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-23 23:55:59 +02:00
snd-soc-seeed-voicecard-objs := seeed-voicecard.o ac101.o
2017-09-14 10:29:26 +02:00
obj-m += snd-soc-wm8960.o
obj-m += snd-soc-ac108.o
obj-m += snd-soc-seeed-voicecard.o
2017-09-14 10:29:26 +02:00
ifdef DEBUG
ifneq ($(DEBUG),0)
ccflags-y += -DDEBUG -DAC101_DEBG
endif
endif
2017-04-27 09:31:04 +02:00
else
DEST := /lib/modules/$(uname_r)/kernel
2017-04-27 09:31:04 +02:00
all:
make -C /lib/modules/$(uname_r)/build M=$(PWD) modules
2017-04-27 09:31:04 +02:00
clean:
make -C /lib/modules/$(uname_r)/build M=$(PWD) clean
2017-04-27 09:31:04 +02:00
install:
sudo cp snd-soc-ac108.ko ${DEST}/sound/soc/codecs/
sudo cp snd-soc-wm8960.ko ${DEST}/sound/soc/codecs/
sudo cp snd-soc-seeed-voicecard.ko ${DEST}/sound/soc/bcm/
2017-04-27 09:31:04 +02:00
sudo depmod -a
.PHONY: all clean install
endif