hdmi2csi + audio + gstreamer

I finally got my hdmi2csi board, and have had a lot of success with everything including audio. I’m now stuck with 1 issue, and I hope someone can point me in the right direction.

When I capture audio using arecord, all is well… but when I switch to a gstreamer pipeline, it seems to get stuck at 44100hz audio, even though the source is 48000hz. The result is that the audio is pitch-shifted down making voices sound like they’re all sucking on some sulfur hexafluoride. Does anyone know how to get alsasrc to override the rate?

Capturing the audio to a file using arecord looks like this:

arecord -f S16_LE -c 2 -r 48000 -d 5 -D hw:1,0 test.wav

My pipeline looks like this:

gst-launch-1.0 alsasrc ! 'audio/x-raw, format=S16LE, rate=48000, channels=2' ! autoaudiosink

It doesn’t seem to matter what I put into the “rate” field. I would have expected putting bad rates in there to pitch-up or pitch-down the audio. I have tried to force the rate up & down using “audiorate” in the pipeline, and this does start to sound correct… except that it starts to get static then dies.

Anyone have any ideas?

Oddly enough, I just tried capturing the output direct from arecord, and passing it to gstreamer… and it seems to get the right rate… but there is quite a bit of static still present.

arecord -f S16_LE -c 2 -r 48000 -D hw:1,0 - | gst-launch-1.0 fdsrc fd=0 ! decodebin ! autoaudiosink


scratch that… the audio gets progressively worse, until all audio is lost. (total time until audio is completely lost is approximately 7.5 minutes)

I’m kinda baffled. The recorded file has no static… and has no issues recording for extended periods of time. The moment I throw it into gstreamer (live) … I get static… and eventually audio drops out.

What is the alsasrc in the case? Please share information ‘arecord -l’

And are we able to reproduce the issue on default board? Are you on r28.1 or r24.2.1?

card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 0: ADMAIF1 CIF ADMAIF1-0 []
  Subdevices: 0/1
  Subdevice #0: subdevice #0

I actually setup an alsa alias for that & specified the rate… and all is working now. I just found it very strange that alsa kept defaulting to 44100.

in /etc/asound.conf I added:

pcm.hdmiinb48 {
        format S16_LE
        rate 48000
        type hw
        card 1
        device 0

then used the gstreamer pipeline like this:

gst-launch-1.0 alsasrc device=hdmiinb48 ! 'audio/x-raw, format=S16LE, rate=48000, channels=2' ! autoaudiosink

Good to hear that you figured it out and share with us.