i.MX6 SSI ALSA simultaneous Capture and Playback not working for mono streams

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX6 SSI ALSA simultaneous Capture and Playback not working for mono streams

2,116 Views
vismayshah
Contributor II

Hi All,

We are using i.MX6 SSI (Synchronous Serial Interface) with AUDMUX to connect Audio Codec chip LM49350 and we are using linux kernel 3.0.35. SSI being I2S Slave and Codec as I2S Master. in our design audio codec has single Speaker , so we need to play Mono Streams , playing stereo streams makes volume level low, as in stereo stream volume gets divided into two channels (left channel and right channel) and as we can play single stream , volume comes with stereo stream is low.

That's why we made changes in Audio Codec driver as follows:

struct snd_soc_dai_driver codec_dai[ ] = {

      .playback = {

                    .channels_min = 1,

                    .channels_max =2,

                    ....

                },

     .capture = {

                    .channels_min = 1,

                    .channels_max =2,

                    ....

                },

}

When we have channels_min = 1  , when gstreamer queries for hardware capabilities it knows hardware works with mono (channels = 1) as well as stereo (channels = 2) and then it selects Mono , so in that case when we do simultaneous Audio Capture and Playback , after some time we are able to do capture but no playback.

To resolve the issue of playback stops in mono after some time , we found , When we make channels_min = 2 , when gstreamer queries for hardware capabilities it knows hardware only works with stereo ( channels min = channels max = 2 ) so it selects stereo , and in that case simultaneous Audio Capture and Playback works fine , but however as we have single speaker we find volume level down.

So is there any limitation on SSI that it only supports Stereo streams for simultaneous capture and playback ?

Anyone has come across such issue? Please help on this. Any help would be greatly appreciated.

Regards,

Vismay

Labels (3)
Tags (4)
2 Replies

135 Views
vismayshah
Contributor II

Hi All,

It seems making channels_min = 2 for SSI is the only solution.

When I make channels min = channels max = 2 , and then play Mono iMX SSI will play it as stereo and same data will be sent for both Left and Right channels and then i needed to modify Audio codec settings to utilize both Left and Right Channels for Speaker. So issue seems to be closed.

Regards,

Vismay

135 Views
venkatesh_pvsm
Contributor II

Hi Vismayshah,

    We are also got same issue with imx6soo->wm8960 codec, Simultaneous not working in our audio settings.

Audio recording side 16 bit mono and playback also mono only.But simultaneous is not working.

We trying for simultaneous process that time first we enabled the playback after enabled capture ,after that playback got full noise capture recording the what ever playing that time.

     We are modified sound/soc/codecs/wm8960.c

static struct snd_soc_dai_driver wm8960_dai = {

//      .name = "wm8960",

        .name = "wm8960-hifi",

        .playback = {

                .stream_name = "Playback",

//              .channels_min = 1,

                .channels_min = 2,

                .channels_max = 2,

        .capture = {

                .stream_name = "Capture",

               .channels_min = 1,

                .channels_max = 2,

};

sound/soc/imx/imx-ssi.c

static struct snd_soc_dai_driver imx_ssi_dai = {

        .playback = {1,

           .channels_min = 2, //venkat

                .channels_max = 2,

        },

        .capture = {

              .channels_min = 2, //venkat

                .channels_max = 2,        },

        .ops = &imx_ssi_pcm_dai_ops,

};

sound/soc/imx/imx-pcm-dma-mx2.c

static struct snd_pcm_hardware snd_imx_hardware = {

        .channels_min = 2,

        .channels_max = 2,

};

  This above settings modification its enough or not in SSI with stereo mode,We need capture only mono mode.

Thanks by,

Venkat

0 Kudos