All of lore.kernel.org
 help / color / mirror / Atom feed
* speaker-test error using sgtl5000 and imx27
@ 2015-09-15  9:49 Alexandre Schnegg
  2015-09-29 14:26 ` Alexandre Schnegg
  0 siblings, 1 reply; 6+ messages in thread
From: Alexandre Schnegg @ 2015-09-15  9:49 UTC (permalink / raw)
  To: alsa-devel

Hello,

 

I would like to use the Freescale SGTl5000 audio codec with the Freescale
imx27 processor.

 

Unfortunately, I get this error when I try to run < speaker-test >:

 

# speaker-test 

 

speaker-test 1.0.28

 

Playback device is default

Stream parameters are 48000Hz, S16_LE, 1 channels

Using 16 octaves of pink noise

Rate set to 48000Hz (requested 48000Hz)

Buffer size range from 128 to 32768

Period size range from 64 to 16384

Using max buffer size 32768

Periods = 4

was set period_size = 8192

was set buffer_size = 32768

0 - Front Left

Write error: -5,Input/output error

xrun_recovery failed: -5,Input/output error

Transfer failed: Input/output error

 

The codec is connected to SSI2 pins and I would like to use the SSI0
internal port in asynchronous mode (4 wires). The command interface is I2C1.
The codec seems to work because it generates both bit and frame clocks (the
codec is the master) but no data are coming from the processor. I'm using
kernel 4.1.7 but I have got the same error with versions 3.19.8, 4.0.5 and
4.0.9. I have also tried the < imx-sgtl5000 > driver and I get the same
error. I can use < alsamixer > with no issue.

 

Here are my device tree bindings:

 

                sound {

                               compatible = "simple-audio-card";

                               simple-audio-card,name = "sgtl5000-audio";

                               simple-audio-card,format = "i2s";

                               simple-audio-card,bitclock-master =
<&dailink0_master>;

                               simple-audio-card,frame-master =
<&dailink0_master>;

 

                               simple-audio-card,widgets =

                                               "Microphone", "Mic Jack",

                                               "Headphone", "Headphone
Jack";

 

                               simple-audio-card,routing =

                                               "MIC_IN", "Mic Jack",

                                               "Mic Jack", "Mic Bias",

                                               "Headphone Jack", "HP_OUT";

 

                               simple-audio-card,cpu {

                                               sound-dai = <&ssi1 0>;

                               };

 

                               dailink0_master: simple-audio-card,codec {

                                               sound-dai = <&sgtl5000>;

                                               clocks = <&mclk>;

                               };

 

                };

 

                mclk: asvmpc {

                               #clock-cells = <0>;

                               compatible = "fixed-clock";

                               clock-frequency = <12288000>;

                };

 

&ssi1 {

                #sound-dai-cells = <1>;

                status = "okay";

                fsl,audmux-port = <MX27_AUDMUX_PPCR2_SSI_PINS_2>;

                fsl,port-config = <

                               (IMX_AUDMUX_V1_PCR_SYN |

 
IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0))

                >;

};

 

&audmux {

                pinctrl-names = "default";

                pinctrl-0 = <&pinctrl_ssi2>;

                status = "okay";

                fsl,audmux-port = <MX27_AUDMUX_HPCR1_SSI0>;

                fsl,port-config = <

                               (IMX_AUDMUX_V1_PCR_SYN |

 
IMX_AUDMUX_V1_PCR_TFCSEL(MX27_AUDMUX_PPCR2_SSI_PINS_2) |

                               IMX_AUDMUX_V1_PCR_TFSDIR |

                               IMX_AUDMUX_V1_PCR_TCLKDIR |

 
IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_PPCR2_SSI_PINS_2))

                >;

};

 

&i2c1 {

                clock-frequency = <100000>;

                pinctrl-names = "default";

                pinctrl-0 = <&pinctrl_i2c1>;

                status = "okay";

 

                sgtl5000: sgtl5000@0a {

                               #sound-dai-cells = <0>;

                               compatible = "fsl,sgtl5000";

                               reg = <0x0a>;

                               clocks = <&mclk>;

                               micbias-resistor-k-ohms = <2>;

                               micbias-voltage-m-volts = <2250>;

                               VDDA-supply = <&reg_2p8v>;

                                VDDIO-supply = <&reg_2p8v>;

                };

};

 

pinctrl_ssi2: ssi2grp {

                               fsl,pins = <

                                               MX27_PAD_SSI2_FS__SSI2_FS 0x0

 
MX27_PAD_SSI2_RXDAT__SSI2_RXDAT 0x0

 
MX27_PAD_SSI2_TXDAT__SSI2_TXDAT 0x0

                                               MX27_PAD_SSI2_CLK__SSI2_CLK
0x0

                                               >;

                };

 

And the modules I have loaded before running < speaker test > :

 

# modprobe snd-soc-sgtl5000

[   23.274351] sgtl5000 0-000a: sgtl5000 revision 0x11

# modprobe snd-soc-simple-card

# modprobe snd-soc-fsl-ssi

[   79.752288] sgtl5000 0-000a: Using internal LDO instead of VDDD

# [   79.853711] asoc-simple-card sound: sgtl5000 <-> 10010000.ssi mapping
ok

# modprobe snd-soc-imx-audmux

 

Does anybody know what is the mistake?

 

Thank you for your help.

 

Best regards.

Alexandre Schnegg

 

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

* Re: speaker-test error using sgtl5000 and imx27
  2015-09-15  9:49 speaker-test error using sgtl5000 and imx27 Alexandre Schnegg
@ 2015-09-29 14:26 ` Alexandre Schnegg
  2015-09-29 16:11   ` Fabio Estevam
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexandre Schnegg @ 2015-09-29 14:26 UTC (permalink / raw)
  To: alsa-devel

Hello,

After a few researches, it seems to me that the problem come from the 
DMA. The SSI is set up correctly and waits for data from the DMA, but 
the DMA doesn't not seem to to do his job.

Does anyone can confirm me that the module imx_pcm_dma is working 
properly with Freescale imx27 and mainline kernel?

Anyone has got an audio codec working with the Freescale  imx27 and 
mainline kernel?

Thank you in advance for your help.

Best regards
Alexandre Schnegg

Le 15.09.2015 11:49, Alexandre Schnegg a écrit :
> Hello,
>
>   
>
> I would like to use the Freescale SGTl5000 audio codec with the Freescale
> imx27 processor.
>
>   
>
> Unfortunately, I get this error when I try to run < speaker-test >:
>
>   
>
> # speaker-test
>
>   
>
> speaker-test 1.0.28
>
>   
>
> Playback device is default
>
> Stream parameters are 48000Hz, S16_LE, 1 channels
>
> Using 16 octaves of pink noise
>
> Rate set to 48000Hz (requested 48000Hz)
>
> Buffer size range from 128 to 32768
>
> Period size range from 64 to 16384
>
> Using max buffer size 32768
>
> Periods = 4
>
> was set period_size = 8192
>
> was set buffer_size = 32768
>
> 0 - Front Left
>
> Write error: -5,Input/output error
>
> xrun_recovery failed: -5,Input/output error
>
> Transfer failed: Input/output error
>
>   
>
> The codec is connected to SSI2 pins and I would like to use the SSI0
> internal port in asynchronous mode (4 wires). The command interface is I2C1.
> The codec seems to work because it generates both bit and frame clocks (the
> codec is the master) but no data are coming from the processor. I'm using
> kernel 4.1.7 but I have got the same error with versions 3.19.8, 4.0.5 and
> 4.0.9. I have also tried the < imx-sgtl5000 > driver and I get the same
> error. I can use < alsamixer > with no issue.
>
>   
>
> Here are my device tree bindings:
>
>   
>
>                  sound {
>
>                                 compatible = "simple-audio-card";
>
>                                 simple-audio-card,name = "sgtl5000-audio";
>
>                                 simple-audio-card,format = "i2s";
>
>                                 simple-audio-card,bitclock-master =
> <&dailink0_master>;
>
>                                 simple-audio-card,frame-master =
> <&dailink0_master>;
>
>   
>
>                                 simple-audio-card,widgets =
>
>                                                 "Microphone", "Mic Jack",
>
>                                                 "Headphone", "Headphone
> Jack";
>
>   
>
>                                 simple-audio-card,routing =
>
>                                                 "MIC_IN", "Mic Jack",
>
>                                                 "Mic Jack", "Mic Bias",
>
>                                                 "Headphone Jack", "HP_OUT";
>
>   
>
>                                 simple-audio-card,cpu {
>
>                                                 sound-dai = <&ssi1 0>;
>
>                                 };
>
>   
>
>                                 dailink0_master: simple-audio-card,codec {
>
>                                                 sound-dai = <&sgtl5000>;
>
>                                                 clocks = <&mclk>;
>
>                                 };
>
>   
>
>                  };
>
>   
>
>                  mclk: asvmpc {
>
>                                 #clock-cells = <0>;
>
>                                 compatible = "fixed-clock";
>
>                                 clock-frequency = <12288000>;
>
>                  };
>
>   
>
> &ssi1 {
>
>                  #sound-dai-cells = <1>;
>
>                  status = "okay";
>
>                  fsl,audmux-port = <MX27_AUDMUX_PPCR2_SSI_PINS_2>;
>
>                  fsl,port-config = <
>
>                                 (IMX_AUDMUX_V1_PCR_SYN |
>
>   
> IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0))
>
>                  >;
>
> };
>
>   
>
> &audmux {
>
>                  pinctrl-names = "default";
>
>                  pinctrl-0 = <&pinctrl_ssi2>;
>
>                  status = "okay";
>
>                  fsl,audmux-port = <MX27_AUDMUX_HPCR1_SSI0>;
>
>                  fsl,port-config = <
>
>                                 (IMX_AUDMUX_V1_PCR_SYN |
>
>   
> IMX_AUDMUX_V1_PCR_TFCSEL(MX27_AUDMUX_PPCR2_SSI_PINS_2) |
>
>                                 IMX_AUDMUX_V1_PCR_TFSDIR |
>
>                                 IMX_AUDMUX_V1_PCR_TCLKDIR |
>
>   
> IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_PPCR2_SSI_PINS_2))
>
>                  >;
>
> };
>
>   
>
> &i2c1 {
>
>                  clock-frequency = <100000>;
>
>                  pinctrl-names = "default";
>
>                  pinctrl-0 = <&pinctrl_i2c1>;
>
>                  status = "okay";
>
>   
>
>                  sgtl5000: sgtl5000@0a {
>
>                                 #sound-dai-cells = <0>;
>
>                                 compatible = "fsl,sgtl5000";
>
>                                 reg = <0x0a>;
>
>                                 clocks = <&mclk>;
>
>                                 micbias-resistor-k-ohms = <2>;
>
>                                 micbias-voltage-m-volts = <2250>;
>
>                                 VDDA-supply = <&reg_2p8v>;
>
>                                  VDDIO-supply = <&reg_2p8v>;
>
>                  };
>
> };
>
>   
>
> pinctrl_ssi2: ssi2grp {
>
>                                 fsl,pins = <
>
>                                                 MX27_PAD_SSI2_FS__SSI2_FS 0x0
>
>   
> MX27_PAD_SSI2_RXDAT__SSI2_RXDAT 0x0
>
>   
> MX27_PAD_SSI2_TXDAT__SSI2_TXDAT 0x0
>
>                                                 MX27_PAD_SSI2_CLK__SSI2_CLK
> 0x0
>
>                                                 >;
>
>                  };
>
>   
>
> And the modules I have loaded before running < speaker test > :
>
>   
>
> # modprobe snd-soc-sgtl5000
>
> [   23.274351] sgtl5000 0-000a: sgtl5000 revision 0x11
>
> # modprobe snd-soc-simple-card
>
> # modprobe snd-soc-fsl-ssi
>
> [   79.752288] sgtl5000 0-000a: Using internal LDO instead of VDDD
>
> # [   79.853711] asoc-simple-card sound: sgtl5000 <-> 10010000.ssi mapping
> ok
>
> # modprobe snd-soc-imx-audmux
>
>   
>
> Does anybody know what is the mistake?
>
>   
>
> Thank you for your help.
>
>   
>
> Best regards.
>
> Alexandre Schnegg
>
>   
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: speaker-test error using sgtl5000 and imx27
  2015-09-29 14:26 ` Alexandre Schnegg
@ 2015-09-29 16:11   ` Fabio Estevam
  2015-09-29 18:22   ` gianluca
  2015-09-30  6:48   ` Alexandre Schnegg
  2 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2015-09-29 16:11 UTC (permalink / raw)
  To: Alexandre Schnegg; +Cc: alsa-devel, Eric Bénard

On Tue, Sep 29, 2015 at 11:26 AM, Alexandre Schnegg <aschnegg@digger.ch> wrote:
> Hello,
>
> After a few researches, it seems to me that the problem come from the DMA.
> The SSI is set up correctly and waits for data from the DMA, but the DMA
> doesn't not seem to to do his job.
>
> Does anyone can confirm me that the module imx_pcm_dma is working properly
> with Freescale imx27 and mainline kernel?
>
> Anyone has got an audio codec working with the Freescale  imx27 and mainline
> kernel?

I don't have access to my mx27pdk at the moment. I am adding Eric on
Cc in case he could test audio on the imx27-eukrea board.

Regards,

Fabio Estevam

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

* Re: speaker-test error using sgtl5000 and imx27
  2015-09-29 14:26 ` Alexandre Schnegg
  2015-09-29 16:11   ` Fabio Estevam
@ 2015-09-29 18:22   ` gianluca
  2015-09-30  6:28     ` Alexandre Schnegg
  2015-09-30  6:48   ` Alexandre Schnegg
  2 siblings, 1 reply; 6+ messages in thread
From: gianluca @ 2015-09-29 18:22 UTC (permalink / raw)
  To: Alexandre Schnegg, alsa-devel

On 09/29/2015 04:26 PM, Alexandre Schnegg wrote:
> Hello,
>
> After a few researches, it seems to me that the problem come from the
> DMA. The SSI is set up correctly and waits for data from the DMA, but
> the DMA doesn't not seem to to do his job.
>
> Does anyone can confirm me that the module imx_pcm_dma is working
> properly with Freescale imx27 and mainline kernel?
>
> Anyone has got an audio codec working with the Freescale  imx27 and
> mainline kernel?
>
> Thank you in advance for your help.
>
> Best regards
> Alexandre Schnegg
>
> Le 15.09.2015 11:49, Alexandre Schnegg a écrit :
>> Hello,
>>
>>
>> I would like to use the Freescale SGTl5000 audio codec with the Freescale
>> imx27 processor.
>>
>>

I faced a problem like that but in the opposite way: I was unable to 
record anything from mic or line-in.
I saw all logic levels running, but no interrupt never catched by the 
driver. Because of the CLKMUX_SEL was not set. Strangely it worked in 
playback mode. But not for record. :-/

Have you read this?

https://community.freescale.com/message/540885#540885

> I had finally got a solution to this issue: the HW_DIGCTL_CTRL_SAIF_CLKMUX_SEL was not set.
>

On the platform init code you have to call:

>     mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);


Obviously the correct function for iMX27 will be to find in:

> drivers/clk/imx/clk-imx27.c

Good luck.

>> Unfortunately, I get this error when I try to run < speaker-test >:
>>
>>
>> # speaker-test
>>
>>
>> speaker-test 1.0.28
>>
>>
>> Playback device is default
>>
>> Stream parameters are 48000Hz, S16_LE, 1 channels
>>
>> Using 16 octaves of pink noise
>>
>> Rate set to 48000Hz (requested 48000Hz)
>>
>> Buffer size range from 128 to 32768
>>
>> Period size range from 64 to 16384
>>
>> Using max buffer size 32768
>>
>> Periods = 4
>>
>> was set period_size = 8192
>>
>> was set buffer_size = 32768
>>
>> 0 - Front Left
>>
>> Write error: -5,Input/output error
>>
>> xrun_recovery failed: -5,Input/output error
>>
>> Transfer failed: Input/output error
>>
>>
>> The codec is connected to SSI2 pins and I would like to use the SSI0
>> internal port in asynchronous mode (4 wires). The command interface is
>> I2C1.
>> The codec seems to work because it generates both bit and frame clocks
>> (the
>> codec is the master) but no data are coming from the processor. I'm using
>> kernel 4.1.7 but I have got the same error with versions 3.19.8, 4.0.5
>> and
>> 4.0.9. I have also tried the < imx-sgtl5000 > driver and I get the same
>> error. I can use < alsamixer > with no issue.
>>
>>
>> Here are my device tree bindings:
>>
>>
>>                  sound {
>>
>>                                 compatible = "simple-audio-card";
>>
>>                                 simple-audio-card,name =
>> "sgtl5000-audio";
>>
>>                                 simple-audio-card,format = "i2s";
>>
>>                                 simple-audio-card,bitclock-master =
>> <&dailink0_master>;
>>
>>                                 simple-audio-card,frame-master =
>> <&dailink0_master>;
>>
>>
>>                                 simple-audio-card,widgets =
>>
>>                                                 "Microphone", "Mic Jack",
>>
>>                                                 "Headphone", "Headphone
>> Jack";
>>
>>
>>                                 simple-audio-card,routing =
>>
>>                                                 "MIC_IN", "Mic Jack",
>>
>>                                                 "Mic Jack", "Mic Bias",
>>
>>                                                 "Headphone Jack",
>> "HP_OUT";
>>
>>
>>                                 simple-audio-card,cpu {
>>
>>                                                 sound-dai = <&ssi1 0>;
>>
>>                                 };
>>
>>
>>                                 dailink0_master:
>> simple-audio-card,codec {
>>
>>                                                 sound-dai = <&sgtl5000>;
>>
>>                                                 clocks = <&mclk>;
>>
>>                                 };
>>
>>
>>                  };
>>
>>
>>                  mclk: asvmpc {
>>
>>                                 #clock-cells = <0>;
>>
>>                                 compatible = "fixed-clock";
>>
>>                                 clock-frequency = <12288000>;
>>
>>                  };
>>
>>
>> &ssi1 {
>>
>>                  #sound-dai-cells = <1>;
>>
>>                  status = "okay";
>>
>>                  fsl,audmux-port = <MX27_AUDMUX_PPCR2_SSI_PINS_2>;
>>
>>                  fsl,port-config = <
>>
>>                                 (IMX_AUDMUX_V1_PCR_SYN |
>>
>> IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0))
>>
>>                  >;
>>
>> };
>>
>>
>> &audmux {
>>
>>                  pinctrl-names = "default";
>>
>>                  pinctrl-0 = <&pinctrl_ssi2>;
>>
>>                  status = "okay";
>>
>>                  fsl,audmux-port = <MX27_AUDMUX_HPCR1_SSI0>;
>>
>>                  fsl,port-config = <
>>
>>                                 (IMX_AUDMUX_V1_PCR_SYN |
>>
>> IMX_AUDMUX_V1_PCR_TFCSEL(MX27_AUDMUX_PPCR2_SSI_PINS_2) |
>>
>>                                 IMX_AUDMUX_V1_PCR_TFSDIR |
>>
>>                                 IMX_AUDMUX_V1_PCR_TCLKDIR |
>>
>> IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_PPCR2_SSI_PINS_2))
>>
>>                  >;
>>
>> };
>>
>>
>> &i2c1 {
>>
>>                  clock-frequency = <100000>;
>>
>>                  pinctrl-names = "default";
>>
>>                  pinctrl-0 = <&pinctrl_i2c1>;
>>
>>                  status = "okay";
>>
>>
>>                  sgtl5000: sgtl5000@0a {
>>
>>                                 #sound-dai-cells = <0>;
>>
>>                                 compatible = "fsl,sgtl5000";
>>
>>                                 reg = <0x0a>;
>>
>>                                 clocks = <&mclk>;
>>
>>                                 micbias-resistor-k-ohms = <2>;
>>
>>                                 micbias-voltage-m-volts = <2250>;
>>
>>                                 VDDA-supply = <&reg_2p8v>;
>>
>>                                  VDDIO-supply = <&reg_2p8v>;
>>
>>                  };
>>
>> };
>>
>>
>> pinctrl_ssi2: ssi2grp {
>>
>>                                 fsl,pins = <
>>
>>
>> MX27_PAD_SSI2_FS__SSI2_FS 0x0
>>
>> MX27_PAD_SSI2_RXDAT__SSI2_RXDAT 0x0
>>
>> MX27_PAD_SSI2_TXDAT__SSI2_TXDAT 0x0
>>
>>
>> MX27_PAD_SSI2_CLK__SSI2_CLK
>> 0x0
>>
>>                                                 >;
>>
>>                  };
>>
>>
>> And the modules I have loaded before running < speaker test > :
>>
>>
>> # modprobe snd-soc-sgtl5000
>>
>> [   23.274351] sgtl5000 0-000a: sgtl5000 revision 0x11
>>
>> # modprobe snd-soc-simple-card
>>
>> # modprobe snd-soc-fsl-ssi
>>
>> [   79.752288] sgtl5000 0-000a: Using internal LDO instead of VDDD
>>
>> # [   79.853711] asoc-simple-card sound: sgtl5000 <-> 10010000.ssi
>> mapping
>> ok
>>
>> # modprobe snd-soc-imx-audmux
>>
>>
>> Does anybody know what is the mistake?
>>
>>
>> Thank you for your help.
>>
>>
>> Best regards.
>>
>> Alexandre Schnegg
>>
>>
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>
>


-- 
Eurek s.r.l.                          |
Electronic Engineering                | http://www.eurek.it
via Celletta 8/B, 40026 Imola, Italy  | Phone: +39-(0)542-609120
p.iva 00690621206 - c.f. 04020030377  | Fax:   +39-(0)542-609212
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: speaker-test error using sgtl5000 and imx27
  2015-09-29 18:22   ` gianluca
@ 2015-09-30  6:28     ` Alexandre Schnegg
  0 siblings, 0 replies; 6+ messages in thread
From: Alexandre Schnegg @ 2015-09-30  6:28 UTC (permalink / raw)
  To: gianluca, alsa-devel

Le 29.09.2015 20:22, gianluca a écrit :
> On 09/29/2015 04:26 PM, Alexandre Schnegg wrote:
>> Hello,
>>
>> After a few researches, it seems to me that the problem come from the
>> DMA. The SSI is set up correctly and waits for data from the DMA, but
>> the DMA doesn't not seem to to do his job.
>>
>> Does anyone can confirm me that the module imx_pcm_dma is working
>> properly with Freescale imx27 and mainline kernel?
>>
>> Anyone has got an audio codec working with the Freescale  imx27 and
>> mainline kernel?
>>
>> Thank you in advance for your help.
>>
>> Best regards
>> Alexandre Schnegg
>>
>> Le 15.09.2015 11:49, Alexandre Schnegg a écrit :
>>> Hello,
>>>
>>>
>>> I would like to use the Freescale SGTl5000 audio codec with the 
>>> Freescale
>>> imx27 processor.
>>>
>>>
>
> I faced a problem like that but in the opposite way: I was unable to 
> record anything from mic or line-in.
> I saw all logic levels running, but no interrupt never catched by the 
> driver. Because of the CLKMUX_SEL was not set. Strangely it worked in 
> playback mode. But not for record. :-/
>
> Have you read this?
>
> https://community.freescale.com/message/540885#540885
>
>> I had finally got a solution to this issue: the 
>> HW_DIGCTL_CTRL_SAIF_CLKMUX_SEL was not set.
>>
>
> On the platform init code you have to call:
>
>> mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
>
>
> Obviously the correct function for iMX27 will be to find in:
>
>> drivers/clk/imx/clk-imx27.c
I cannot find an equivalent function in this file.

The imx27 doesn't have a SAIF unit. It has a SSI unit.

Thank you for your reply.
>
> Good luck.
>
>>> Unfortunately, I get this error when I try to run < speaker-test >:
>>>
>>>
>>> # speaker-test
>>>
>>>
>>> speaker-test 1.0.28
>>>
>>>
>>> Playback device is default
>>>
>>> Stream parameters are 48000Hz, S16_LE, 1 channels
>>>
>>> Using 16 octaves of pink noise
>>>
>>> Rate set to 48000Hz (requested 48000Hz)
>>>
>>> Buffer size range from 128 to 32768
>>>
>>> Period size range from 64 to 16384
>>>
>>> Using max buffer size 32768
>>>
>>> Periods = 4
>>>
>>> was set period_size = 8192
>>>
>>> was set buffer_size = 32768
>>>
>>> 0 - Front Left
>>>
>>> Write error: -5,Input/output error
>>>
>>> xrun_recovery failed: -5,Input/output error
>>>
>>> Transfer failed: Input/output error
>>>
>>>
>>> The codec is connected to SSI2 pins and I would like to use the SSI0
>>> internal port in asynchronous mode (4 wires). The command interface is
>>> I2C1.
>>> The codec seems to work because it generates both bit and frame clocks
>>> (the
>>> codec is the master) but no data are coming from the processor. I'm 
>>> using
>>> kernel 4.1.7 but I have got the same error with versions 3.19.8, 4.0.5
>>> and
>>> 4.0.9. I have also tried the < imx-sgtl5000 > driver and I get the same
>>> error. I can use < alsamixer > with no issue.
>>>
>>>
>>> Here are my device tree bindings:
>>>
>>>
>>>                  sound {
>>>
>>>                                 compatible = "simple-audio-card";
>>>
>>>                                 simple-audio-card,name =
>>> "sgtl5000-audio";
>>>
>>>                                 simple-audio-card,format = "i2s";
>>>
>>> simple-audio-card,bitclock-master =
>>> <&dailink0_master>;
>>>
>>>                                 simple-audio-card,frame-master =
>>> <&dailink0_master>;
>>>
>>>
>>>                                 simple-audio-card,widgets =
>>>
>>>                                                 "Microphone", "Mic 
>>> Jack",
>>>
>>>                                                 "Headphone", "Headphone
>>> Jack";
>>>
>>>
>>>                                 simple-audio-card,routing =
>>>
>>>                                                 "MIC_IN", "Mic Jack",
>>>
>>>                                                 "Mic Jack", "Mic Bias",
>>>
>>>                                                 "Headphone Jack",
>>> "HP_OUT";
>>>
>>>
>>>                                 simple-audio-card,cpu {
>>>
>>>                                                 sound-dai = <&ssi1 0>;
>>>
>>>                                 };
>>>
>>>
>>>                                 dailink0_master:
>>> simple-audio-card,codec {
>>>
>>>                                                 sound-dai = 
>>> <&sgtl5000>;
>>>
>>>                                                 clocks = <&mclk>;
>>>
>>>                                 };
>>>
>>>
>>>                  };
>>>
>>>
>>>                  mclk: asvmpc {
>>>
>>>                                 #clock-cells = <0>;
>>>
>>>                                 compatible = "fixed-clock";
>>>
>>>                                 clock-frequency = <12288000>;
>>>
>>>                  };
>>>
>>>
>>> &ssi1 {
>>>
>>>                  #sound-dai-cells = <1>;
>>>
>>>                  status = "okay";
>>>
>>>                  fsl,audmux-port = <MX27_AUDMUX_PPCR2_SSI_PINS_2>;
>>>
>>>                  fsl,port-config = <
>>>
>>>                                 (IMX_AUDMUX_V1_PCR_SYN |
>>>
>>> IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0))
>>>
>>>                  >;
>>>
>>> };
>>>
>>>
>>> &audmux {
>>>
>>>                  pinctrl-names = "default";
>>>
>>>                  pinctrl-0 = <&pinctrl_ssi2>;
>>>
>>>                  status = "okay";
>>>
>>>                  fsl,audmux-port = <MX27_AUDMUX_HPCR1_SSI0>;
>>>
>>>                  fsl,port-config = <
>>>
>>>                                 (IMX_AUDMUX_V1_PCR_SYN |
>>>
>>> IMX_AUDMUX_V1_PCR_TFCSEL(MX27_AUDMUX_PPCR2_SSI_PINS_2) |
>>>
>>>                                 IMX_AUDMUX_V1_PCR_TFSDIR |
>>>
>>>                                 IMX_AUDMUX_V1_PCR_TCLKDIR |
>>>
>>> IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_PPCR2_SSI_PINS_2))
>>>
>>>                  >;
>>>
>>> };
>>>
>>>
>>> &i2c1 {
>>>
>>>                  clock-frequency = <100000>;
>>>
>>>                  pinctrl-names = "default";
>>>
>>>                  pinctrl-0 = <&pinctrl_i2c1>;
>>>
>>>                  status = "okay";
>>>
>>>
>>>                  sgtl5000: sgtl5000@0a {
>>>
>>>                                 #sound-dai-cells = <0>;
>>>
>>>                                 compatible = "fsl,sgtl5000";
>>>
>>>                                 reg = <0x0a>;
>>>
>>>                                 clocks = <&mclk>;
>>>
>>>                                 micbias-resistor-k-ohms = <2>;
>>>
>>>                                 micbias-voltage-m-volts = <2250>;
>>>
>>>                                 VDDA-supply = <&reg_2p8v>;
>>>
>>>                                  VDDIO-supply = <&reg_2p8v>;
>>>
>>>                  };
>>>
>>> };
>>>
>>>
>>> pinctrl_ssi2: ssi2grp {
>>>
>>>                                 fsl,pins = <
>>>
>>>
>>> MX27_PAD_SSI2_FS__SSI2_FS 0x0
>>>
>>> MX27_PAD_SSI2_RXDAT__SSI2_RXDAT 0x0
>>>
>>> MX27_PAD_SSI2_TXDAT__SSI2_TXDAT 0x0
>>>
>>>
>>> MX27_PAD_SSI2_CLK__SSI2_CLK
>>> 0x0
>>>
>>>                                                 >;
>>>
>>>                  };
>>>
>>>
>>> And the modules I have loaded before running < speaker test > :
>>>
>>>
>>> # modprobe snd-soc-sgtl5000
>>>
>>> [   23.274351] sgtl5000 0-000a: sgtl5000 revision 0x11
>>>
>>> # modprobe snd-soc-simple-card
>>>
>>> # modprobe snd-soc-fsl-ssi
>>>
>>> [   79.752288] sgtl5000 0-000a: Using internal LDO instead of VDDD
>>>
>>> # [   79.853711] asoc-simple-card sound: sgtl5000 <-> 10010000.ssi
>>> mapping
>>> ok
>>>
>>> # modprobe snd-soc-imx-audmux
>>>
>>>
>>> Does anybody know what is the mistake?
>>>
>>>
>>> Thank you for your help.
>>>
>>>
>>> Best regards.
>>>
>>> Alexandre Schnegg
>>>
>>>
>>> _______________________________________________
>>> Alsa-devel mailing list
>>> Alsa-devel@alsa-project.org
>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>
>>
>>
>
>

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: speaker-test error using sgtl5000 and imx27
  2015-09-29 14:26 ` Alexandre Schnegg
  2015-09-29 16:11   ` Fabio Estevam
  2015-09-29 18:22   ` gianluca
@ 2015-09-30  6:48   ` Alexandre Schnegg
  2 siblings, 0 replies; 6+ messages in thread
From: Alexandre Schnegg @ 2015-09-30  6:48 UTC (permalink / raw)
  To: alsa-devel

Here are some more informations:

The SSI unit seems to be configured properly but in the SSI interrupt 
status register, the flag TUE0 is set. From the imx27 reference manual:

    Transmitter Underrun Error 0. This flag is set when the TXSR is
    empty (no data to be transmitted), the
    TDE0 flag is set and a transmit time slot occurs. When a transmit
    underrun error occurs, the previous data
    is retransmitted. In Network mode, each time slot requires data
    transmission (unless masked through
    STMSK register), when the transmitter is enabled (TE is set).
    The TUE0 flag causes an interrupt if TIE and TUE0_EN are set.
    The TUE0 bit is cleared by POR and SSI reset. It is also cleared by
    reading the SISR with TUE0 bit set,
    followed by writing to the STX0 register.
    0 Default interrupt is issued to the Core.
    1 Exception interrupt is issued to the Core.

Since the data should be written in the TX fiffo by the DMA I think the 
problem come from it.

To be sure that the problem doesn't come from the codecs, I have tried 
with a TI's TLV320aic23, still not working.

I have tested "aplay /usr/share/sounds/alsa/Front_Left.wav " with 
"snd-dummy" and the command return as expected, but with any codec with 
"simple-card" the command doesn't return.

With kernel 4.3-rc2 I have an error message that I haven't before:

    [ 2951.569027] fsl-ssi-dai 10010000.ssi: Failed to get DMA channel
    capabilities, falling back to period counting: -6
    [ 2951.590684] fsl-ssi-dai 10010000.ssi: Failed to get DMA channel
    capabilities, falling back to period counting: -6

What does it mean ?

Le 29.09.2015 16:26, Alexandre Schnegg a écrit :
> Hello,
>
> After a few researches, it seems to me that the problem come from the 
> DMA. The SSI is set up correctly and waits for data from the DMA, but 
> the DMA doesn't not seem to to do his job.
>
> Does anyone can confirm me that the module imx_pcm_dma is working 
> properly with Freescale imx27 and mainline kernel?
>
> Anyone has got an audio codec working with the Freescale  imx27 and 
> mainline kernel?
>
> Thank you in advance for your help.
>
> Best regards
> Alexandre Schnegg
>
> Le 15.09.2015 11:49, Alexandre Schnegg a écrit :
>> Hello,
>>
>>
>> I would like to use the Freescale SGTl5000 audio codec with the 
>> Freescale
>> imx27 processor.
>>
>>
>> Unfortunately, I get this error when I try to run < speaker-test >:
>>
>>
>> # speaker-test
>>
>>
>> speaker-test 1.0.28
>>
>>
>> Playback device is default
>>
>> Stream parameters are 48000Hz, S16_LE, 1 channels
>>
>> Using 16 octaves of pink noise
>>
>> Rate set to 48000Hz (requested 48000Hz)
>>
>> Buffer size range from 128 to 32768
>>
>> Period size range from 64 to 16384
>>
>> Using max buffer size 32768
>>
>> Periods = 4
>>
>> was set period_size = 8192
>>
>> was set buffer_size = 32768
>>
>> 0 - Front Left
>>
>> Write error: -5,Input/output error
>>
>> xrun_recovery failed: -5,Input/output error
>>
>> Transfer failed: Input/output error
>>
>>
>> The codec is connected to SSI2 pins and I would like to use the SSI0
>> internal port in asynchronous mode (4 wires). The command interface 
>> is I2C1.
>> The codec seems to work because it generates both bit and frame 
>> clocks (the
>> codec is the master) but no data are coming from the processor. I'm 
>> using
>> kernel 4.1.7 but I have got the same error with versions 3.19.8, 
>> 4.0.5 and
>> 4.0.9. I have also tried the < imx-sgtl5000 > driver and I get the same
>> error. I can use < alsamixer > with no issue.
>>
>>
>> Here are my device tree bindings:
>>
>>
>>                  sound {
>>
>>                                 compatible = "simple-audio-card";
>>
>>                                 simple-audio-card,name = 
>> "sgtl5000-audio";
>>
>>                                 simple-audio-card,format = "i2s";
>>
>> simple-audio-card,bitclock-master =
>> <&dailink0_master>;
>>
>>                                 simple-audio-card,frame-master =
>> <&dailink0_master>;
>>
>>
>>                                 simple-audio-card,widgets =
>>
>>                                                 "Microphone", "Mic 
>> Jack",
>>
>>                                                 "Headphone", "Headphone
>> Jack";
>>
>>
>>                                 simple-audio-card,routing =
>>
>>                                                 "MIC_IN", "Mic Jack",
>>
>>                                                 "Mic Jack", "Mic Bias",
>>
>>                                                 "Headphone Jack", 
>> "HP_OUT";
>>
>>
>>                                 simple-audio-card,cpu {
>>
>>                                                 sound-dai = <&ssi1 0>;
>>
>>                                 };
>>
>>
>>                                 dailink0_master: 
>> simple-audio-card,codec {
>>
>>                                                 sound-dai = <&sgtl5000>;
>>
>>                                                 clocks = <&mclk>;
>>
>>                                 };
>>
>>
>>                  };
>>
>>
>>                  mclk: asvmpc {
>>
>>                                 #clock-cells = <0>;
>>
>>                                 compatible = "fixed-clock";
>>
>>                                 clock-frequency = <12288000>;
>>
>>                  };
>>
>>
>> &ssi1 {
>>
>>                  #sound-dai-cells = <1>;
>>
>>                  status = "okay";
>>
>>                  fsl,audmux-port = <MX27_AUDMUX_PPCR2_SSI_PINS_2>;
>>
>>                  fsl,port-config = <
>>
>>                                 (IMX_AUDMUX_V1_PCR_SYN |
>>
>>   IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0))
>>
>>                  >;
>>
>> };
>>
>>
>> &audmux {
>>
>>                  pinctrl-names = "default";
>>
>>                  pinctrl-0 = <&pinctrl_ssi2>;
>>
>>                  status = "okay";
>>
>>                  fsl,audmux-port = <MX27_AUDMUX_HPCR1_SSI0>;
>>
>>                  fsl,port-config = <
>>
>>                                 (IMX_AUDMUX_V1_PCR_SYN |
>>
>>   IMX_AUDMUX_V1_PCR_TFCSEL(MX27_AUDMUX_PPCR2_SSI_PINS_2) |
>>
>>                                 IMX_AUDMUX_V1_PCR_TFSDIR |
>>
>>                                 IMX_AUDMUX_V1_PCR_TCLKDIR |
>>
>>   IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_PPCR2_SSI_PINS_2))
>>
>>                  >;
>>
>> };
>>
>>
>> &i2c1 {
>>
>>                  clock-frequency = <100000>;
>>
>>                  pinctrl-names = "default";
>>
>>                  pinctrl-0 = <&pinctrl_i2c1>;
>>
>>                  status = "okay";
>>
>>
>>                  sgtl5000: sgtl5000@0a {
>>
>>                                 #sound-dai-cells = <0>;
>>
>>                                 compatible = "fsl,sgtl5000";
>>
>>                                 reg = <0x0a>;
>>
>>                                 clocks = <&mclk>;
>>
>>                                 micbias-resistor-k-ohms = <2>;
>>
>>                                 micbias-voltage-m-volts = <2250>;
>>
>>                                 VDDA-supply = <&reg_2p8v>;
>>
>>                                  VDDIO-supply = <&reg_2p8v>;
>>
>>                  };
>>
>> };
>>
>>
>> pinctrl_ssi2: ssi2grp {
>>
>>                                 fsl,pins = <
>>
>> MX27_PAD_SSI2_FS__SSI2_FS 0x0
>>
>>   MX27_PAD_SSI2_RXDAT__SSI2_RXDAT 0x0
>>
>>   MX27_PAD_SSI2_TXDAT__SSI2_TXDAT 0x0
>>
>> MX27_PAD_SSI2_CLK__SSI2_CLK
>> 0x0
>>
>>                                                 >;
>>
>>                  };
>>
>>
>> And the modules I have loaded before running < speaker test > :
>>
>>
>> # modprobe snd-soc-sgtl5000
>>
>> [   23.274351] sgtl5000 0-000a: sgtl5000 revision 0x11
>>
>> # modprobe snd-soc-simple-card
>>
>> # modprobe snd-soc-fsl-ssi
>>
>> [   79.752288] sgtl5000 0-000a: Using internal LDO instead of VDDD
>>
>> # [   79.853711] asoc-simple-card sound: sgtl5000 <-> 10010000.ssi 
>> mapping
>> ok
>>
>> # modprobe snd-soc-imx-audmux
>>
>>
>> Does anybody know what is the mistake?
>>
>>
>> Thank you for your help.
>>
>>
>> Best regards.
>>
>> Alexandre Schnegg
>>
>>
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>

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

end of thread, other threads:[~2015-09-30  6:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-15  9:49 speaker-test error using sgtl5000 and imx27 Alexandre Schnegg
2015-09-29 14:26 ` Alexandre Schnegg
2015-09-29 16:11   ` Fabio Estevam
2015-09-29 18:22   ` gianluca
2015-09-30  6:28     ` Alexandre Schnegg
2015-09-30  6:48   ` Alexandre Schnegg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.