Audio Capture Problem

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

Audio Capture Problem

1,550 Views
bandarulavanya
Contributor V

Hi All,

we are using wm8960 audio codec in 3.14.28 kernel version it's working fine from the command line if i am recording using arecord -f S16_LE -r 44100 audio.wav

And even using gstreamer pipeline also it's working fine.

we require the mixing of audio, video  using gstreamer

gst-launch-1.0 -e imxv4l2src device=/dev/video0 ! queue ! vpuenc ! h264parse ! mux. alsasrc ! queue ! audioconvert ! voaacenc ! mux. mp4mux name=mux ! filesink location='test.mp4'

it is also working fine when we are implementing same thing from the source it's working some time only, But with the same source we are recording only audio or only video it's not giving any problem.

Only in the case of both audio and video together it's giving problem in audio so that it's not recording any thing i found that after starting audio it's entering in the following functions of pcm.c

In working case:

continuously getting the print of "snd_pcm_common_ioctl1" from sound/core/pcm_native.c and executing the case        " case SNDRV_PCM_IOCTL_SYNC_PTR:"

Non working case:

initial very less time got "snd_pcm_common_ioctl1" after some time it's entered 6 to 7 times in        

"case SNDRV_PCM_IOCTL_DELAY:" and from there entered in to the " case SNDRV_PCM_STATE_SUSPENDED:"  of snd_pcm_delay function. how can i solve the issue.

If any one worked on these things kindly help me to sort it out.

Thanks & Regards,

Lavanya

Labels (1)
0 Kudos
6 Replies

1,188 Views
igorpadykov
NXP Employee
NXP Employee

Hi Lavanya

could you try with pulsesrc as described in attached Linux Guide

sect.7.3.7 Audio/Video recording

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

0 Kudos

1,188 Views
bandarulavanya
Contributor V

Hi igorpadykov,

when i tried from the command line

gst-launch-1.0 -e imxv4l2src device=/dev/video0 ! queue ! vpuenc ! h264parse ! mux. alsasrc ! queue ! audioconvert ! voaacenc ! mux. mp4mux name=mux ! filesink  -- working

every time it works fine but when i tried to pass caps with this some time it's working some time it's not working.

gst-launch-1.0 -e imxv4l2src device=/dev/video0 ! 'video/x-raw,framerate=30/1,width=1280,height=720' ! clockoverlay ! queue ! vpuenc bitrate=1024 ! h264parse ! mux. alsasrc device=plughw:0,0 ! 'audio/x-raw,rate=8000,channels=2,depth=16,width=16,endianness=1234,signed=true' ! queue ! audioconvert ! voaacenc bitrate=8000 ! mux. flvmux streamable=true name=mux ! filesink location=test.mp4 sync=false  -- not working

attached the log here:

Non-Working:

LAV 20: snd_pcm_common_ioctl1
LAV 8: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 11: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 8: snd_pcm_common_ioctl1
LAV 11: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
New clock: GstAudioSrcClock
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
[INFO] ringBufferEnable 0, chromaInterleave 0, mapType 0, linear2TiledEnable 0
[WARN] VPU iram is less than needed, some parts don't uLAV 19: snd_pcm_common_ioctl1
se iram
LAV 1: snd_pcm_delay
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay

after that it's not giving anything

Working case:

LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 19: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 19: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 19: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
^Chandling interrupt.
Interrupt: Stopping pipeline .LAV 20: snd_pcm_common_ioctl1
..
EOS on shutdown enabled -- Forcing EOS on the pipeline
Waiting for EOS...LAV 20: snd_pcm_common_ioctl1

LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
Got EOS from element "pipeline0".LAV 19: snd_pcm_common_ioctl1

EOS received - stopping pipelinLAV 20: snd_pcm_common_ioctl1
e...
Execution ended after 0:00:LAV 1: snd_pcm_delay
02.161966667
Setting pipeline toLAV 20: snd_pcm_common_ioctl1
 PAUSED ...
LAV 20: snd_pcm_common_ioctl1
LAV 19: snd_pcm_common_ioctl1
LAV 1: snd_pcm_delay
Setting pipeline to READY ...
LAV 24: snd_pcm_common_ioctl1
LAV 11: snd_pcm_common_ioctl1
LAV 20: snd_pcm_common_ioctl1
LAV 24: snd_pcm_common_ioctl1
LAV 7: snd_pcm_common_ioctl1
LAV : imx_hifi_hw_free

*********play=1 capture=0 STOP FUNCTION  wm8960_set_dai_pll
Setting pipeline to NULL ...
LAV : imx_hifi_hw_free

*********play=1 capture=0 STOP FUNCTION  wm8960_set_dai_pll

In this working case continuously LAV 20: snd_pcm_common_ioctl1 this print is coming.

How can i solve this issue, kindly help me to sort it out i am new to gstreamer.

Thanks,

Lavanya

0 Kudos

1,188 Views
igorpadykov
NXP Employee
NXP Employee

Hi Lavanya

what bsp used in the case, could you try Demo Images from

i.MX 6 / i.MX 7 Series Software and Development Tool|NXP 

Best regards
igor

0 Kudos

1,188 Views
bandarulavanya
Contributor V

Hi igorpadykov,

I tried to record individual audio and video in that case it's working fine all the time.

But when i tried mux with audio and video in that case it's not working all the time.

Only Audio:

gst-launch-1.0 alsasrc device="hw:0,0" ! "audio/x-raw,rate=8000,channels=2,depth=16,width=16",endianness=1234,signed=true ! queue ! audioconvert ! avimux ! filesink location=/tmp/audio.avi

Only Video:

gst-launch-1.0 imxv4l2src device=/dev/video0 ! 'video/x-raw, format=I420, width=1280, height=720, interlaced=false, framerate=30/1' ! imxvpuenc_h264 bitrate=1024 ! filesink location=/tmp/file.mp4

MUX of audio and video:

gst-launch-1.0 -e imxv4l2src device=/dev/video0 ! 'video/x-raw,framerate=30/1,width=1280,height=720' ! clockoverlay ! queue ! vpuenc bitrate=1024 ! h264parse ! mux. alsasrc device=plughw:0,0 ! 'audio/x-raw,rate=8000,channels=2,depth=16,width=16,endianness=1234,signed=true' ! queue ! audioconvert ! voaacenc bitrate=8000 ! mux. flvmux streamable=true name=mux ! filesink location=test.mp4 sync=false

    Thanks in advance.

          

Thanks

Lavanya

0 Kudos

1,188 Views
igorpadykov
NXP Employee
NXP Employee

Hi Lavanya

could you try to test it using SabreSD demo board with Demo Images.

Best regards
igor

0 Kudos

1,188 Views
bandarulavanya
Contributor V

Hi igorpadykov ,

my audio codec is wm8960 and i used yocto setup 1.7 which is having 3.14 kernel version.

Thanks

Lavanya

0 Kudos