Android 4.4.3 spdif out not working

cancel
Showing results for 
Search instead for 
Did you mean: 

Android 4.4.3 spdif out not working

Jump to solution
358 Views
marcobologna
Contributor II

I use android 4.4.3 and I would like use the Spidif out.

In ALSA device list imx-spdif is listed as audio card 1

I configured the /hardware/imx/alsa/config_spdif.h as out, after

I tried by console tinyplay /test.wav -D 1 -d 0.

I check by oscilloscope the out and it works, but I not listen sound.

It seems mute audio.

I tried by console tinyplay also with sgtl5000 and HDMI and sound is ok.

How can I check?

The Android 4.4.3 can transmit the spdif audio?

I not have error or warning in all logs, but I not have out sound.

Thanks in advance for any help.

0 Kudos
1 Solution
157 Views
marcobologna
Contributor II

The problem was solved!!!!

The bit SCR_VAL_CLEAR to register SPDIF_SCR and is mask must be set to work..

The "validity" flag (bit 28 in each subframe, counting from preamble bit 0) was going out as 1 rather than 0, and per SP-DIF standard '1' denotes an *invalid* sample, like from a scratched CD giving read errors (though it's reversed again in i.MX6 SPDIF_SCR register, where the power-on default '0' in bit 5 means "send out 1s").

/kernel_imx/sound/soc/fsl/fsl_spdif.c

if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
   scr = SCR_TXFIFO_AUTOSYNC | SCR_TXFIFO_CTRL_NORMAL |
   SCR_TXSEL_NORMAL | SCR_USRC_SEL_CHIP |
-   SCR_TXFIFO_FSEL_IF8;

+   SCR_TXFIFO_FSEL_IF8 | SCR_VAL_CLEAR;

   mask = SCR_TXFIFO_AUTOSYNC_MASK | SCR_TXFIFO_CTRL_MASK |
   SCR_TXSEL_MASK | SCR_USRC_SEL_MASK |
-   SCR_TXFIFO_FSEL_MASK;

+   SCR_TXFIFO_FSEL_MASK | SCR_VAL_MASK;

   for (i = 0; i < SPDIF_TXRATE_MAX; i++)
   clk_prepare_enable(spdif_priv->txclk[i]);

}

View solution in original post

0 Kudos
2 Replies
158 Views
marcobologna
Contributor II

The problem was solved!!!!

The bit SCR_VAL_CLEAR to register SPDIF_SCR and is mask must be set to work..

The "validity" flag (bit 28 in each subframe, counting from preamble bit 0) was going out as 1 rather than 0, and per SP-DIF standard '1' denotes an *invalid* sample, like from a scratched CD giving read errors (though it's reversed again in i.MX6 SPDIF_SCR register, where the power-on default '0' in bit 5 means "send out 1s").

/kernel_imx/sound/soc/fsl/fsl_spdif.c

if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
   scr = SCR_TXFIFO_AUTOSYNC | SCR_TXFIFO_CTRL_NORMAL |
   SCR_TXSEL_NORMAL | SCR_USRC_SEL_CHIP |
-   SCR_TXFIFO_FSEL_IF8;

+   SCR_TXFIFO_FSEL_IF8 | SCR_VAL_CLEAR;

   mask = SCR_TXFIFO_AUTOSYNC_MASK | SCR_TXFIFO_CTRL_MASK |
   SCR_TXSEL_MASK | SCR_USRC_SEL_MASK |
-   SCR_TXFIFO_FSEL_MASK;

+   SCR_TXFIFO_FSEL_MASK | SCR_VAL_MASK;

   for (i = 0; i < SPDIF_TXRATE_MAX; i++)
   clk_prepare_enable(spdif_priv->txclk[i]);

}

View solution in original post

0 Kudos
157 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Marco

one can test with linux, please check sect.32.2 S/PDIF Tx Driver attached

Linux Manual, use nxp Linux 3.10.53 bsp

http://www.nxp.com/webapp/Download?colCode=L3.10.53_1.1.0_iMX6QDLS_Bundle&appType=license&location=n... 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos