Skip to contentSkip to conversation

ASoC: DMA and SSI drivers for i.MX27

PATCH javier Martin 1 participant 2 messages Aug 3, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

As I described in one of my previous mails, I have been trying to port an old ASoC driver for kernel 2.6.22 to latest stable 2.6.30 kernel. I am currently facing a big problem which make some repeated samples appear with a regular pattern:
- frequency of bad samples = 2 * period_size
- bad samples in audio stream are taken from "buffer_size" samples back in the original file.

You can reproduce this with:
aplay -t raw -f S16_LE -r8000 8k16bitpcm.wav

(http://en.wikipedia.org/wiki/WAV to get this file)

Here I submit two patches:
- One which adds ssi and dma drivers plus a custom machine driver (imx27asoc_list.patch).
- Another patch which adds wm8974 codec support taken from ASoC wm8974-upstream branch (wm8974_list.patch).

Note that the machine driver attached uses wm8974 codec, thus second patch is needed. Please, note also that patches are currently quite dirty, and in an early development state. The purpose of this mail is not to even consider to include them in any branch right now, but to gather some help to solve the problem. As soon as I have it solved I will clean all the stuff and try to prepare it for mainline.

Signature · 8 lines
Javier Martin
Vista Silicon S.L.
Universidad de Cantabria
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

commit 061556c42e6f48911338a6a7996445da968e962a

Author: Javier Martin <[email protected]>
Date:   Mon Jul 20 16:37:44 2009 +0200

ASOC: i.MX27 DMA and DAI platform drivers support.

They have been ported from visstrim_m10 2.6.22 kernel. They still do not work properly, but at least it compiles and it is detected by the system properly as a sound card.

---
 sound/soc/Kconfig              |    1 +
 sound/soc/Makefile             |    1 +
 sound/soc/imx/Kconfig          |   58 +++
 sound/soc/imx/Makefile         |   21 +
 sound/soc/imx/imx27-pcm.c      |  596 +++++++++++++++++++++++++
 sound/soc/imx/imx27-pcm.h      |   95 ++++
 sound/soc/imx/imx27-ssi.c      |  934 ++++++++++++++++++++++++++++++++++++++++
 sound/soc/imx/imx27-ssi.h      |  226 ++++++++++
 sound/soc/imx/mx27vis_wm8974.c |  357 +++++++++++++++
 9 files changed, 2289 insertions(+), 0 deletions(-)
sound/soc/Kconfig +1 -0
index 3d2bb6f..c9bbc70 100644
@@ -33,6 +33,7 @@ source "sound/soc/omap/Kconfig"
 source "sound/soc/pxa/Kconfig"
 source "sound/soc/s3c24xx/Kconfig"
 source "sound/soc/sh/Kconfig"
+source "sound/soc/imx/Kconfig"
 
 # Supported codecs
 source "sound/soc/codecs/Kconfig"
sound/soc/Makefile +1 -0
index 0237879..8120b52 100644
@@ -11,3 +11,4 @@ obj-$(CONFIG_SND_SOC)	+= omap/
 obj-$(CONFIG_SND_SOC)	+= pxa/
 obj-$(CONFIG_SND_SOC)	+= s3c24xx/
 obj-$(CONFIG_SND_SOC)	+= sh/
+obj-$(CONFIG_SND_SOC)   += imx/
sound/soc/imx/Kconfig new file +58 -0

58 lines not on this page · raw message

sound/soc/imx/Makefile new file +21 -0
new file mode 100644
index 0000000..3fb4174
@@ -0,0 +1,21 @@
+# i.MX Platform Support
+snd-soc-imx21-objs := imx21-pcm.o
+snd-soc-imx27-objs := imx27-pcm.o
+snd-soc-imx31-objs := imx31-pcm.o
+snd-soc-imx-ac97-objs := imx-ac97.o
+snd-soc-imx-ssi-objs := imx-ssi.o
+snd-soc-imx27-ssi-objs := imx27-ssi.o
+
+obj-$(CONFIG_SND_MX31_SOC) += snd-soc-imx31.o
+obj-$(CONFIG_SND_MX31_SOC_AC97) += snd-soc-imx-ac97.o
+obj-$(CONFIG_SND_MX31_SOC_SSI) += snd-soc-imx-ssi.o
+obj-$(CONFIG_SND_MX27_SOC) += snd-soc-imx27.o
+obj-$(CONFIG_SND_MX27_SOC_SSI) += snd-soc-imx27-ssi.o
+
+# i.MX Machine Support
+snd-soc-mx31ads-wm8753-objs := mx31ads_wm8753.o
+obj-$(CONFIG_SND_SOC_MX31ADS_WM8753) += snd-soc-mx31ads-wm8753.o
+snd-soc-mx21ads-wm8731-objs := mx21ads_wm8731.o
+obj-$(CONFIG_SND_SOC_MX21ADS_WM8731) += snd-soc-mx21ads-wm8731.o
+snd-soc-mx27vis-wm8974-objs := mx27vis_wm8974.o
+obj-$(CONFIG_SND_SOC_MX27VIS_WM8974) += snd-soc-mx27vis-wm8974.o
sound/soc/imx/imx27-pcm.c new file +596 -0

596 lines not on this page · raw message

sound/soc/imx/imx27-pcm.h new file +95 -0

95 lines not on this page · raw message

sound/soc/imx/imx27-ssi.c new file +934 -0

934 lines not on this page · raw message

sound/soc/imx/imx27-ssi.h new file +226 -0

226 lines not on this page · raw message

sound/soc/imx/mx27vis_wm8974.c new file +357 -0

357 lines not on this page · raw message

commit 69d824099e04cd965920326b49d20bbb03d686c6

Author: Javier Martin <[email protected]>
Date:   Mon Jul 20 16:40:20 2009 +0200

ASOC: Add wm8974 codec driver support.

This has been taken from Wolfson's wm8974-upstream branch which means that it is quite stable and candidate to be released in mainline kernel.

---
 sound/soc/codecs/Kconfig  |    4 +
 sound/soc/codecs/Makefile |    2 +
 sound/soc/codecs/wm8974.c |  846 +++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/wm8974.h |   99 ++++++
 4 files changed, 951 insertions(+), 0 deletions(-)
sound/soc/codecs/Kconfig +4 -0
index b6c7f7a..ee5a14c 100644
@@ -36,6 +36,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_WM8900 if I2C
 	select SND_SOC_WM8903 if I2C
 	select SND_SOC_WM8971 if I2C
+	select SND_SOC_WM8974 if I2C
 	select SND_SOC_WM8990 if I2C
 	select SND_SOC_WM9705 if SND_SOC_AC97_BUS
 	select SND_SOC_WM9712 if SND_SOC_AC97_BUS
@@ -141,6 +142,9 @@ config SND_SOC_WM8903
 config SND_SOC_WM8971
 	tristate
 
+config SND_SOC_WM8974
+	tristate
+
 config SND_SOC_WM8990
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index f265380..e7d7f1f 100644
@@ -24,6 +24,7 @@ snd-soc-wm8753-objs := wm8753.o
 snd-soc-wm8900-objs := wm8900.o
 snd-soc-wm8903-objs := wm8903.o
 snd-soc-wm8971-objs := wm8971.o
+snd-soc-wm8974-objs := wm8974.o
 snd-soc-wm8990-objs := wm8990.o
 snd-soc-wm9705-objs := wm9705.o
 snd-soc-wm9712-objs := wm9712.o
@@ -55,6 +56,7 @@ obj-$(CONFIG_SND_SOC_WM8753)	+= snd-soc-wm8753.o
 obj-$(CONFIG_SND_SOC_WM8900)	+= snd-soc-wm8900.o
 obj-$(CONFIG_SND_SOC_WM8903)	+= snd-soc-wm8903.o
 obj-$(CONFIG_SND_SOC_WM8971)	+= snd-soc-wm8971.o
+obj-$(CONFIG_SND_SOC_WM8974)	+= snd-soc-wm8974.o
 obj-$(CONFIG_SND_SOC_WM8990)	+= snd-soc-wm8990.o
 obj-$(CONFIG_SND_SOC_WM9705)	+= snd-soc-wm9705.o
 obj-$(CONFIG_SND_SOC_WM9712)	+= snd-soc-wm9712.o
sound/soc/codecs/wm8974.c new file +846 -0

672 lines not on this page · raw message

sound/soc/codecs/wm8974.h new file +99 -0

99 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Part of the diff is not shown here. View the raw message.

#1 lore raw

2009/8/3 javier Martin <[email protected]>:

Quoted 28 lines

As I described in one of my previous mails, I have been trying to port an old ASoC driver for kernel 2.6.22 to latest stable 2.6.30 kernel. I am currently facing a big problem which make some repeated samples appear with a regular pattern:
- frequency of bad samples = 2 * period_size
- bad samples in audio stream are taken from "buffer_size" samples back in the original file.

You can reproduce this with:
aplay -t raw -f S16_LE -r8000 8k16bitpcm.wav

(http://en.wikipedia.org/wiki/WAV to get this file)

Here I submit two patches:
- One which adds ssi and dma drivers plus a custom machine driver (imx27asoc_list.patch).
- Another patch which adds wm8974 codec support taken from ASoC wm8974-upstream branch (wm8974_list.patch).

Note that the machine driver attached uses wm8974 codec, thus second patch is needed. Please, note also that patches are currently quite dirty, and in an early development state. The purpose of this mail is not to even consider to include them in any branch right now, but to gather some help to solve the problem. As soon as I have it solved I will clean all the stuff and try to prepare it for mainline.

Quoted 10 lines

--
Javier Martin
Vista Silicon S.L.
Universidad de Cantabria
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

I was doing some random tests and I have found that using "-M" option in aplay makes it work fine. It seems a problem of performance when not using mmap.

I don't know if you have something to comment about this.

Thanks.

Signature · 8 lines
Javier Martin
Vista Silicon S.L.
Universidad de Cantabria
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com