imx6q, help on alsa capture->play audio

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6q, help on alsa capture->play audio

1,416 Views
angelo_d
Senior Contributor I

Dear all,

i am in the need to play some audio, captured from a very similar si476x radio chip, and played with main cs42888 codec or hdmi.

My board is very similar to sabreauto.

While piping arecord | aplay from si476x -> cs42888 works fine, piping si476x -> hdmi-imx-soc have issues.

Likely, hdmi is too fast, and after some seconds i get a buffer underrun and hear a small cut.

Looking the 2 pcm stream details (si476x capture device and hdmi playing device), i see

Hardware PCM card 1 'imx-hdmi-soc' device 0 subdevice 0

Its setup is:

  stream       : PLAYBACK

  access       : RW_INTERLEAVED

  format       : S16_LE

  subformat    : STD

  channels     : 2

  rate         : 44100

  exact rate   : 44100 (44100/1)

  msbits       : 16

  buffer_size  : 6144

  period_size  : 768

  period_time  : 17414

  tstamp_mode  : NONE

  period_step  : 1

  avail_min    : 768

  period_event : 0

  start_threshold  : 2147483647

  stop_threshold   : 6144

  silence_threshold: 0

  silence_size : 0

  boundary     : 1610612736

  appl_ptr     : 0

  hw_ptr       : 0

Hardware PCM card 2 'imx-audio-si4745' device 0 subdevice 0

Its setup is:

  stream       : CAPTURE

  access       : RW_INTERLEAVED

  format       : S16_LE

  subformat    : STD

  channels     : 2

  rate         : 44100

  exact rate   : 44100 (44100/1)

  msbits       : 16

  buffer_size  : 2048

  period_size  : 1024

  period_time  : 23219

  tstamp_mode  : NONE

  period_step  : 1

  avail_min    : 1024

  period_event : 0

  start_threshold  : 2147483647

  stop_threshold   : 2048

  silence_threshold: 0

  silence_size : 0

  boundary     : 1073741824

  appl_ptr     : 0

  hw_ptr       : 0

Starting ...

As you can see, the 2 pcm devices have different period size.

This should means, as seen, that player is faster.

One thing i suspect is the fact the fm chip is clocked by 32768 Khz ext ref clock, while hdmi should be clocked from something derived from 24Mhz. Could this be an issue ?

thanks

Best regards

angelo

Labels (2)
0 Kudos
Reply
4 Replies

235 Views
subash_p
Contributor III

Hi angelo_d

Can I know how did you piped the si476x -> cs42888, it's advantageous for me to integrate for si475x -> wm8960


Regards

subash.p

Tags (1)
0 Kudos
Reply

1,025 Views
jimmychan
NXP TechSupport
NXP TechSupport

which bsp are you using?

0 Kudos
Reply

1,025 Views
saurabh206
Senior Contributor III

Hi

Angelo

You can prepare custom application for your requirement.

Please refer following link.

A Minimal ALSA Loopback Program · GitHub

Thanks

Saurabh

0 Kudos
Reply

1,025 Views
angelo_d
Senior Contributor I

hi Saurabh,

thanks for the link.

I already tried an alsalib based custom tool, based on the "latency" alsa sample code, but i get "buffer underrun" at the same way. Underrun only means that, even if i set the same samplerate cor captuire device (fm radio chip) and player (hdmi), hdmi is strangely faster to play.