linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] mx27_3ds: Add sound support
@ 2012-08-06 13:07 Gaëtan Carlier
  2012-08-06 13:36 ` Fabio Estevam
  0 siblings, 1 reply; 5+ messages in thread
From: Gaëtan Carlier @ 2012-08-06 13:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,
I have ported code "Enable sound on mx31_3ds" from Philippe R?tornaz to
MX27 3DS platform on master branch of linux-next (tag next-20120806).
I also applied patch "dma: imx-dma: Fix kernel crash due to missing clock
conversion" of Fabio Estevam which is not yet merged in linux-next.
Thanks to them, everything is working good on MX27 3DS platform except that
sound is played too fast.
Which parameter must be adjusted to have sound playing at normal speed ?
In mc13783 codec driver, imx_add_imx_ssi(), clock configuration in
mach-mx27_3ds file ?

Thanks for your help.

Signed-off-by: Ga?tan Carlier <gcembed@gmail.com>
---
 arch/arm/mach-imx/Kconfig         |    1 +
 arch/arm/mach-imx/mach-mx27_3ds.c |   19 ++++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index afd542a..63f64f1 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -302,6 +302,7 @@ config MACH_MX27_3DS
 	select IMX_HAVE_PLATFORM_IMX2_WDT
 	select IMX_HAVE_PLATFORM_IMX_FB
 	select IMX_HAVE_PLATFORM_IMX_I2C
+	select IMX_HAVE_PLATFORM_IMX_SSI
 	select IMX_HAVE_PLATFORM_IMX_KEYPAD
 	select IMX_HAVE_PLATFORM_IMX_UART
 	select IMX_HAVE_PLATFORM_MX2_CAMERA
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 58c24c1..a5d4080 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -158,6 +158,11 @@ static const int mx27pdk_pins[] __initconst = {
 	PB21_PF_CSI_HSYNC,
 	CSI_PWRDWN | GPIO_GPIO | GPIO_OUT,
 	CSI_RESET | GPIO_GPIO | GPIO_OUT,
+	/* SSI */
+	PC16_PF_SSI4_FS,
+	PC17_PF_SSI4_RXD,
+	PC18_PF_SSI4_TXD,
+	PC19_PF_SSI4_CLK,
 };
 
 static struct gpio mx27_3ds_camera_gpios[] = {
@@ -329,13 +334,23 @@ static struct mc13xxx_regulator_init_data mx27_3ds_regulators[] = {
 };
 
 /* MC13783 */
+static struct mc13xxx_codec_platform_data mx27_3ds_codec = {
+	.dac_ssi_port = MC13783_SSI1_PORT,
+	.adc_ssi_port = MC13783_SSI1_PORT,
+};
+
 static struct mc13xxx_platform_data mc13783_pdata = {
 	.regulators = {
 		.regulators = mx27_3ds_regulators,
 		.num_regulators = ARRAY_SIZE(mx27_3ds_regulators),
 
 	},
-	.flags  = MC13XXX_USE_TOUCHSCREEN | MC13XXX_USE_RTC,
+	.codec = &mx27_3ds_codec,
+	.flags  = MC13XXX_USE_TOUCHSCREEN | MC13XXX_USE_RTC | MC13XXX_USE_CODEC,
+};
+
+static struct imx_ssi_platform_data mx27_3ds_ssi_pdata = {
+		.flags = IMX_SSI_DMA | IMX_SSI_NET,
 };
 
 /* SPI */
@@ -512,6 +527,8 @@ static void __init mx27pdk_init(void)
 	}
 
 	imx27_add_mx2_camera(&mx27_3ds_cam_pdata);
+	imx27_add_imx_ssi(0, &mx27_3ds_ssi_pdata);
+	imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0);
 }
 
 static void __init mx27pdk_timer_init(void)
-- 
1.7.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 1/1] mx27_3ds: Add sound support
  2012-08-06 13:07 [PATCH 1/1] mx27_3ds: Add sound support Gaëtan Carlier
@ 2012-08-06 13:36 ` Fabio Estevam
  2012-08-06 14:24   ` Gaëtan Carlier
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2012-08-06 13:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Ga?tan,

On Mon, Aug 6, 2012 at 10:07 AM, Ga?tan Carlier <gcembed@gmail.com> wrote:
> Hi,
> I have ported code "Enable sound on mx31_3ds" from Philippe R?tornaz to
> MX27 3DS platform on master branch of linux-next (tag next-20120806).
> I also applied patch "dma: imx-dma: Fix kernel crash due to missing clock
> conversion" of Fabio Estevam which is not yet merged in linux-next.
> Thanks to them, everything is working good on MX27 3DS platform except that
> sound is played too fast.
> Which parameter must be adjusted to have sound playing at normal speed ?
> In mc13783 codec driver, imx_add_imx_ssi(), clock configuration in
> mach-mx27_3ds file ?
>
> Thanks for your help.
>
> Signed-off-by: Ga?tan Carlier <gcembed@gmail.com>

I have added audio support for mx27pdk:
https://patchwork.kernel.org/patch/1152951/

,and in my tests the audio was played at the correct rate.

Can you please have a try?

What is the sampling rate of your file?

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] mx27_3ds: Add sound support
  2012-08-06 13:36 ` Fabio Estevam
@ 2012-08-06 14:24   ` Gaëtan Carlier
  2012-08-06 14:26     ` Fabio Estevam
  2012-08-06 19:38     ` Fabio Estevam
  0 siblings, 2 replies; 5+ messages in thread
From: Gaëtan Carlier @ 2012-08-06 14:24 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Fabio,
Sorry, I have missed your patch in my email archive. I didn't search the 
right keywords.
I applied your [patch 1/2] (2/2 is already merged) but I have same 
effect. I use aplay with file k3b_error1.wav (Unsigned 8 bit, Rate 8000 
Hz, Mono) and alsa/Front_Left.wav (Signed 16 bit Little Endian, Rate 
48000 Hz, Mono). Two sounds are played too fast.
It is maybe a bad configuration of Alsa (but this is working with kernel 
2.6.22 from Freescale).
Thanks.
Ga?tan.

On 08/06/2012 03:36 PM, Fabio Estevam wrote:
> Hi Ga?tan,
>
> On Mon, Aug 6, 2012 at 10:07 AM, Ga?tan Carlier <gcembed@gmail.com> wrote:
>> Hi,
>> I have ported code "Enable sound on mx31_3ds" from Philippe R?tornaz to
>> MX27 3DS platform on master branch of linux-next (tag next-20120806).
>> I also applied patch "dma: imx-dma: Fix kernel crash due to missing clock
>> conversion" of Fabio Estevam which is not yet merged in linux-next.
>> Thanks to them, everything is working good on MX27 3DS platform except that
>> sound is played too fast.
>> Which parameter must be adjusted to have sound playing at normal speed ?
>> In mc13783 codec driver, imx_add_imx_ssi(), clock configuration in
>> mach-mx27_3ds file ?
>>
>> Thanks for your help.
>>
>> Signed-off-by: Ga?tan Carlier <gcembed@gmail.com>
>
> I have added audio support for mx27pdk:
> https://patchwork.kernel.org/patch/1152951/
>
> ,and in my tests the audio was played at the correct rate.
>
> Can you please have a try?
>
> What is the sampling rate of your file?
>
> Regards,
>
> Fabio Estevam
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] mx27_3ds: Add sound support
  2012-08-06 14:24   ` Gaëtan Carlier
@ 2012-08-06 14:26     ` Fabio Estevam
  2012-08-06 19:38     ` Fabio Estevam
  1 sibling, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2012-08-06 14:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 6, 2012 at 11:24 AM, Ga?tan Carlier <gcembed@gmail.com> wrote:
> Hi Fabio,
> Sorry, I have missed your patch in my email archive. I didn't search the
> right keywords.
> I applied your [patch 1/2] (2/2 is already merged) but I have same effect. I
> use aplay with file k3b_error1.wav (Unsigned 8 bit, Rate 8000 Hz, Mono) and
> alsa/Front_Left.wav (Signed 16 bit Little Endian, Rate 48000 Hz, Mono). Two
> sounds are played too fast.
> It is maybe a bad configuration of Alsa (but this is working with kernel
> 2.6.22 from Freescale).

Ok, we will need to debug this problem then.

Can you please send me offline these two files?

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] mx27_3ds: Add sound support
  2012-08-06 14:24   ` Gaëtan Carlier
  2012-08-06 14:26     ` Fabio Estevam
@ 2012-08-06 19:38     ` Fabio Estevam
  1 sibling, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2012-08-06 19:38 UTC (permalink / raw)
  To: linux-arm-kernel

Ga?tan,

On Mon, Aug 6, 2012 at 11:24 AM, Ga?tan Carlier <gcembed@gmail.com> wrote:
> Hi Fabio,
> Sorry, I have missed your patch in my email archive. I didn't search the
> right keywords.
> I applied your [patch 1/2] (2/2 is already merged) but I have same effect. I
> use aplay with file k3b_error1.wav (Unsigned 8 bit, Rate 8000 Hz, Mono) and
> alsa/Front_Left.wav (Signed 16 bit Little Endian, Rate 48000 Hz, Mono). Two
> sounds are played too fast.
> It is maybe a bad configuration of Alsa (but this is working with kernel
> 2.6.22 from Freescale).

I have just sent the following patch to the alsa-list which fixes this
mono playback issue.

Regards,

Fabio Estevam

>From bc46087110bd48a41f1f7dcb826853349662c766 Mon Sep 17 00:00:00 2001
From: Fabio Estevam <fabio.estevam@freescale.com>
Date: Mon, 6 Aug 2012 16:30:51 -0300
Subject: [PATCH] ASoC: imx-ssi: Fix mono playback

Currently mono playback is played on a faster rate.

Adjust channels_min to 2 channels in order to play it back correctly.

Reported-by: Ga?tan Carlier <gcembed@gmail.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/fsl/imx-ssi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 28dd76c..c42df31 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -380,7 +380,7 @@ static int imx_ssi_dai_probe(struct snd_soc_dai *dai)
 static struct snd_soc_dai_driver imx_ssi_dai = {
 	.probe = imx_ssi_dai_probe,
 	.playback = {
-		.channels_min = 1,
+		.channels_min = 2,
 		.channels_max = 2,
 		.rates = SNDRV_PCM_RATE_8000_96000,
 		.formats = SNDRV_PCM_FMTBIT_S16_LE,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-06 19:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-06 13:07 [PATCH 1/1] mx27_3ds: Add sound support Gaëtan Carlier
2012-08-06 13:36 ` Fabio Estevam
2012-08-06 14:24   ` Gaëtan Carlier
2012-08-06 14:26     ` Fabio Estevam
2012-08-06 19:38     ` Fabio Estevam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).