Re: [LAD] Jack not starting MOD-Duos Audio Interface Driver

From: Rafael Guayer <rafael@email-addr-hidden>
Date: Thu Oct 23 2014 - 19:00:20 EEST

Hi Clemens,

The plataform driver and the I2S hardware on the ARM SoC supports sample
resolutions of 16, 20 and 24 bits, and word sizes of 16, 20, 24 and 32
bits. Signed, little or big endian.

The i2s-DMA plataform driver and hardware, only 8, 16 and 32 bits transfers
are possible.

The problem is the CODEC (CS4245 Cirrus Logic), that, for I2S format,
supports only 24 bit resolution in 32 bit words, signed, litle endian (
SNDRV_PCM_FMTBIT_S24_LE).

In the i2s plataform driver, in *_hw_params, when params_format(params) ==
SNDRV_PCM_FMTBIT_S24_3LE, it configured the I2S word size to 24 bits, and
that didn't work on the CODEC.

I did some printk on the 3 drivers *_hw_param and jack is passing S24_3LE,
so I had to change on the i2s driver to configure 32bit word size for
S24_3LE to make it work. But I am patching this plataform drivers anyway,
it was lacking the capture dma *_pcm_prepare.

What is this widely used format for 24bits on ALSA?
SNDRV_PCM_FMTBIT_FLOAT_LE?

Jack only starts when I put SNDRV_PCM_FMTBIT_S24_LE on the plataform
drivers and in the codec driver.

The sound only works when i change the i2s plataform driver to set 32bit
word size for SNDRV_PCM_FMTBIT_S24_3LE.

This is a pastebin of jack output with and without SNDRV_PCM_FMTBIT_S24_LE
on the codec driver.

http://pastebin.com/qhtaPEtW

What is the format i should put on the drivers so Jack works with 24bit
sample resolution and 32 bit word size?

The drivers (work in progress full of comments and printks) are available
at:

Machine:
https://github.com/portalmod/linux-sunxi/tree/sunxi-3.4.61-r1-rt77-i2s-cs4245/sound/soc/sunxi
(mod-duo.c)
Plataform:
https://github.com/portalmod/linux-sunxi/tree/sunxi-3.4.61-r1-rt77-i2s-cs4245/sound/soc/sunxi/i2s
(sunxi-i2s.c and sunxi-i2sdma.c)
Codec:
https://github.com/portalmod/linux-sunxi/tree/sunxi-3.4.61-r1-rt77-i2s-cs4245/sound/soc/codecs
(cs4245.c)

Thanks in advance.

Best regards,

2014-10-23 10:37 GMT-02:00 Clemens Ladisch <clemens@email-addr-hidden>:

> Rafael Guayer wrote:
> > I solved this by adding the format S24_3LE to:
> >
> > aSoC Codec Driver snd_soc_dai_driver->formats
> > aSoC Plataform Driver (DMA) snd_pcm_hardware->formats
> > aSoC Plataform Driver (I2S) snd_soc_dai_driver->capture->formats and
> snd_soc_dai_driver->playback->formats
> >
> > The codec CS4245 only works with 32 bit word size
>
> This does not matter.
>
> Please specify the exact format that is supported by the platform driver.
> (ALSA has three different 24-bit formats, and the most widely used one
> does not have "24" in its name. So please specify how many sample bits
> are stored into how many memory bits, and how those are aligned.)
>
>
> Regards,
> Clemens
>

-- 
Rafael Guayer
www.portalmod.com <http://www.portalmod.com.br>

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Thu Oct 23 20:15:04 2014

This archive was generated by hypermail 2.1.8 : Thu Oct 23 2014 - 20:15:05 EEST