ASoC: dmaengine: Correct Makefile when sound is built as module
PATCH 1/1 ASoC: dmaengine: Correct Makefile when sound is built as module
soc-dmaengine-pcm library need to be part of the snd-soc-core in order to be able to compile ASoC as modules when dmaengine is enabled on the platform.
--- sound/soc/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/Makefile +3 -2
@@ -1,8 +1,9 @@ snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o snd-soc-core-objs += soc-pcm.o soc-compress.o soc-io.o -snd-soc-dmaengine-pcm-objs := soc-dmaengine-pcm.o -obj-$(CONFIG_SND_SOC_DMAENGINE_PCM) += snd-soc-dmaengine-pcm.o +ifneq ($(CONFIG_SND_SOC_DMAENGINE_PCM),) +snd-soc-core-objs += soc-dmaengine-pcm.o +endif obj-$(CONFIG_SND_SOC) += snd-soc-core.o obj-$(CONFIG_SND_SOC) += codecs/
Signature · 1 line
1.7.12
Hi Mark,
Quoted 2 lines · Peter Ujfalusi
soc-dmaengine-pcm library need to be part of the snd-soc-core in order to be able to compile ASoC as modules when dmaengine is enabled on the platform.
Would it be possible to schedule this patch for 3.7? I'm sure if you build any platform which uses dmaegine for audio and compile the audio as module you will also have errors about missing symbols.
Thank you,
Péter
Quoted 23 lines
Signed-off-by Peter Ujfalusi <[email protected]>--- sound/soc/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)sound/soc/Makefile +3
-2@@ -1,8 +1,9 @@ snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o snd-soc-core-objs += soc-pcm.o soc-compress.o soc-io.o -snd-soc-dmaengine-pcm-objs := soc-dmaengine-pcm.o -obj-$(CONFIG_SND_SOC_DMAENGINE_PCM) += snd-soc-dmaengine-pcm.o +ifneq ($(CONFIG_SND_SOC_DMAENGINE_PCM),) +snd-soc-core-objs += soc-dmaengine-pcm.o +endif obj-$(CONFIG_SND_SOC) += snd-soc-core.o obj-$(CONFIG_SND_SOC) += codecs/
Quoted 7 lines · Péter Ujfalusi
Quoted 2 lines · Peter Ujfalusi
soc-dmaengine-pcm library need to be part of the snd-soc-core in order to be able to compile ASoC as modules when dmaengine is enabled on the platform.
Would it be possible to schedule this patch for 3.7? I'm sure if you build any platform which uses dmaegine for audio and compile the audio as module you will also have errors about missing symbols.
As ever this sort of contentless nag is annoying rather than helpful.
Mark Brown
AppliedQuoted 2 lines · Peter Ujfalusi
soc-dmaengine-pcm library need to be part of the snd-soc-core in order to be able to compile ASoC as modules when dmaengine is enabled on the platform.
Applied, thanks.
Quoted 2 lines · Peter Ujfalusi
soc-dmaengine-pcm library need to be part of the snd-soc-core in order to be able to compile ASoC as modules when dmaengine is enabled on the platform.
I also meant to ask... what's the actual issue here?
Quoted 6 lines · Mark Brown
Quoted 2 lines · Peter Ujfalusi
soc-dmaengine-pcm library need to be part of the snd-soc-core in order to be able to compile ASoC as modules when dmaengine is enabled on the platform.
I also meant to ask... what's the actual issue here?
When we build sound as modules for OMAP which has been converted to dmaengine:
ERROR: "snd_hwparams_to_dma_slave_config" [sound/soc/omap/snd-soc-omap.ko] undefined!
ERROR: "snd_dmaengine_pcm_pointer" [sound/soc/omap/snd-soc-omap.ko] undefined!
ERROR: "snd_dmaengine_pcm_open" [sound/soc/omap/snd-soc-omap.ko] undefined!
ERROR: "snd_dmaengine_pcm_close" [sound/soc/omap/snd-soc-omap.ko] undefined!
ERROR: "snd_dmaengine_pcm_get_chan" [sound/soc/omap/snd-soc-omap.ko] undefined!
ERROR: "snd_dmaengine_pcm_trigger" [sound/soc/omap/snd-soc-omap.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
Signature · 1 line
Péter
Quoted 11 lines · Péter Ujfalusi
When we build sound as modules for OMAP which has been converted to dmaengine:
ERROR: "
snd_hwparams_to_dma_slave_config" [sound/soc/omap/snd-soc-omap.ko] undefined!
ERROR: "snd_dmaengine_pcm_pointer" [sound/soc/omap/snd-soc-omap.ko] undefined!
ERROR: "snd_dmaengine_pcm_open" [sound/soc/omap/snd-soc-omap.ko] undefined!
ERROR: "snd_dmaengine_pcm_close" [sound/soc/omap/snd-soc-omap.ko] undefined!
ERROR: "snd_dmaengine_pcm_get_chan" [sound/soc/omap/snd-soc-omap.ko] undefined!
ERROR: "snd_dmaengine_pcm_trigger" [sound/soc/omap/snd-soc-omap.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
What makes you believe that this is due to the code not being part of the core module?
Quoted 2 lines · Mark Brown
What makes you believe that this is due to the code not being part of the core module?
the linker tells me.
Without this patch with mainline kernel from today (I used tegra to see if it happens there as well):
make tegra_defconfigscripts/config -d CONFIG_MMC # MMC does not compile for tegra scripts/config -e CONFIG_SOUND -e CONFIG_SND -e CONFIG_SND_SOC
Fine
scripts/config -e CONFIG_SOUND -e CONFIG_SND -m CONFIG_SND_SOC
sound/built-in.o: In function `dmaengine_pcm_dma_complete':/home/ujfalusi/work/kernel/kernel.org-torvalds-linux-2.6/sound/soc/soc-dmaengine-pcm.c:134:
undefined reference to `snd_pcm_period_elapsed'sound/built-in.o: In function `snd_dmaengine_pcm_open':/home/ujfalusi/work/kernel/kernel.org-torvalds-linux-2.6/sound/soc/soc-dmaengine-pcm.c:285:
undefined reference to `snd_pcm_hw_constraint_integer'
make: *** [vmlinux] Error 1
scripts/config -e CONFIG_SOUND -m CONFIG_SND -m CONFIG_SND_SOC scripts/config -m CONFIG_SOUND -m CONFIG_SND -m CONFIG_SND_SOC
ERROR: "snd_hwparams_to_dma_slave_config" [sound/soc/tegra/snd-soc-tegra-pcm.ko] undefined!
ERROR: "snd_dmaengine_pcm_pointer" [sound/soc/tegra/snd-soc-tegra-pcm.ko] undefined!
ERROR: "snd_dmaengine_pcm_open" [sound/soc/tegra/snd-soc-tegra-pcm.ko] undefined!
ERROR: "snd_dmaengine_pcm_close" [sound/soc/tegra/snd-soc-tegra-pcm.ko] undefined!
ERROR: "snd_dmaengine_pcm_get_chan" [sound/soc/tegra/snd-soc-tegra-pcm.ko] undefined!
ERROR: "snd_dmaengine_pcm_trigger" [sound/soc/tegra/snd-soc-tegra-pcm.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
make: *** Waiting for unfinished jobs....
With the patch:
make tegra_defconfigscripts/config -d CONFIG_MMC # MMC does not compile for tegra scripts/config -e CONFIG_SOUND -e CONFIG_SND -e CONFIG_SND_SOC scripts/config -e CONFIG_SOUND -e CONFIG_SND -m CONFIG_SND_SOC scripts/config -e CONFIG_SOUND -m CONFIG_SND -m CONFIG_SND_SOC scripts/config -m CONFIG_SOUND -m CONFIG_SND -m CONFIG_SND_SOC
is fine.
I guess it was due to the Kconfig/Makefile related to soc-dmaengine:
config SND_SOC_DMAENGINE_PCM
bool
snd-soc-dmaengine-pcm-objs := soc-dmaengine-pcm.o obj-$(CONFIG_SND_SOC_DMAENGINE_PCM) += snd-soc-dmaengine-pcm.o
My guess is that in this way the soc-dmaengine-pcm.o would want itself to be built in to the kernel but since the sound is in modules there is no place to link this part of the code.
If I change the Kconfig from bool to tristate it will build snd-soc-dmaengine-pcm.ko but since the soc-dmaengine-pcm.c does not have module_init it is not really going to load.
I might be wrong.
Signature · 1 line
Péter
Quoted 6 lines · Péter Ujfalusi
Quoted 2 lines · Mark Brown
What makes you believe that this is due to the code not being part of the core module?
the linker tells me.
No it doesn't.
Quoted 8 lines
Without this patch with mainline kernel from today (I used tegra to see if it happens there as well):
[
sound/soc/tegra/snd-soc-tegra-pcm.ko] undefined!
ERROR: "snd_dmaengine_pcm_pointer" [sound/soc/tegra/snd-soc-tegra-pcm.ko] undefined!I guess it was due to the Kconfig/Makefile related to soc-dmaengine:
All the above is telling you is that if you make this change the error goes away. It doesn't explain what the problem is or why this change fixes it.
Quoted 10 lines
config
SND_SOC_DMAENGINE_PCM
boolsnd-soc-dmaengine-pcm-objs := soc-dmaengine-pcm.o obj-$(CONFIG_SND_SOC_DMAENGINE_PCM) += snd-soc-dmaengine-pcm.o
My guess is that in this way the soc-dmaengine-pcm.o would want itself to be built in to the kernel but since the sound is in modules there is no place to link this part of the code.
If I change theKconfigfrom bool to tristate it will build
Indeed, so this is getting warmer. The problem is that the way Kconfig is set up is causing CONFIG_SND_SOC_DMAENGINE_PCM to come out as something that doesn't get built as it's a bool selected by a module and as you say one fix here is to make the dmaengine code a module by itself.
Quoted 3 lines
snd-soc-dmaengine-pcm.ko but since the
soc-dmaengine-pcm.cdoes not havemodule_initit is not really going to load.
I might be wrong.
No, why would module_init() have anything to do with this? Is there something that needs to be run at startup for soc-dmaengine?