Hello!
I have some problems with pulseaudio for gst-launch-1.0.
Actually I can use simple command line test with following logs:
$> GST_DEBUG=3,pulse*:9 gst-launch-1.0 pulsesrc ! autoaudiosink
Setting pipeline to PAUSED ...
0:00:00.146182796 732 0xaaaab6d3fb30 DEBUG pulse pulsesink.c:2226:gst_pulsesink_query_getcaps:<autoaudiosink0-actual-sink-pulse> caps audio/x-raw, format=(string){ S16LE, S16BE, F32LE, F32BE, S32LE, S32BE, S24LE, S24BE, S24_32LE, S24_32BE, U8 }, layout=(string)interleaved, rate=(int)[ 1, 384000 ], channels=(int)[ 1, 32 ]; audio/x-alaw, rate=(int)[ 1, 384000 ], channels=(int)[ 1, 32 ]; audio/x-mulaw, rate=(int)[ 1, 384000 ], channels=(int)[ 1, 32 ]; audio/x-ac3, framed=(boolean)true; audio/x-eac3, framed=(boolean)true; audio/x-dts, framed=(boolean)true, block-size=(int){ 512, 1024, 2048 }; audio/mpeg, mpegversion=(int)1, mpegaudioversion=(int)[ 1, 3 ], parsed=(boolean)true; audio/mpeg, mpegversion=(int){ 2, 4 }, framed=(boolean)true, stream-format=(string)adts
0:00:00.146336422 732 0xaaaab6d3fb30 INFO pulse pulsesink.c:3254:gst_pulsesink_change_state:<autoaudiosink0-actual-sink-pulse> new pa main loop thread
0:00:00.146838551 732 0xaaaab6d3fb30 DEBUG pulse pulsesink.c:1836:gst_pulsesink_create_ringbuffer:<autoaudiosink0-actual-sink-pulse> creating ringbuffer
0:00:00.147029803 732 0xaaaab6d3fb30 DEBUG pulse pulsesink.c:1838:gst_pulsesink_create_ringbuffer:<autoaudiosink0-actual-sink-pulse> created ringbuffer @0xaaaab6e40030
0:00:00.147105553 732 0xaaaab6d3fb30 INFO pulse pulsesink.c:533:gst_pulseringbuffer_open_device:<autoaudiosink0-actual-sink-pulse> new context with name gst-launch-1.0, pbuf=0xaaaab6e40030, pctx=0xaaaab6e26980
0:00:00.148039936 732 0xaaaab6d3fb30 LOG pulse pulsesink.c:550:gst_pulseringbuffer_open_device:<autoaudiosink0-actual-sink-pulse> connect to server (NULL)
0:00:00.148443189 732 0xaaaab6d3fb30 LOG pulse pulsesink.c:427:gst_pulsering_context_state_cb: got new context state 1
0:00:00.152361345 732 0xaaaab6d3fb30 LOG pulse pulsesink.c:427:gst_pulsering_context_state_cb: got new context state 5
0:00:00.152458346 732 0xaaaab6d3fb30 LOG pulse pulsesink.c:433:gst_pulsering_context_state_cb: signaling
0:00:00.152554472 732 0xaaaab6d3fb30 WARN pulse pulsesink.c:617:gst_pulseringbuffer_open_device:<autoaudiosink0-actual-sink-pulse> error: Failed to connect: Connection refused
0:00:00.152844599 732 0xaaaab6d3fb30 DEBUG pulse pulsesink.c:340:gst_pulsering_destroy_context:<pulseringbuffer0> destroying ringbuffer 0xaaaab6e40030
0:00:00.152908100 732 0xaaaab6d3fb30 DEBUG pulse pulsesink.c:354:gst_pulsering_destroy_context:<pulseringbuffer0> releasing context with name gst-launch-1.0, pbuf=0xaaaab6e40030, pctx=0xaaaab6e26980
0:00:00.152959725 732 0xaaaab6d3fb30 DEBUG pulse pulsesink.c:360:gst_pulsering_destroy_context:<pulseringbuffer0> destroying final context with name gst-launch-1.0, pbuf=0xaaaab6e40030, pctx=0xaaaab6e26980
0:00:00.153154977 732 0xaaaab6d3fb30 DEBUG pulse pulsesink.c:340:gst_pulsering_destroy_context:<pulseringbuffer0> destroying ringbuffer 0xaaaab6e40030
0:00:00.153214352 732 0xaaaab6d3fb30 INFO pulse pulsesink.c:3236:gst_pulsesink_release_mainloop:<autoaudiosink0-actual-sink-pulse> terminating pa main loop thread
0:00:00.231180477 732 0xaaaab6d3fb30 DEBUG pulse pulsesrc.c:997:gst_pulsesrc_open:<pulsesrc0> opening device
0:00:00.231943233 732 0xaaaab6d3fb30 DEBUG pulse pulsesrc.c:1012:gst_pulsesrc_open:<pulsesrc0> connect to server (NULL)
0:00:00.236367893 732 0xaaaab6d3fb30 WARN pulse pulsesrc.c:1016:gst_pulsesrc_open:<pulsesrc0> error: Failed to connect: Connection refused
ERROR: from element /GstPipeline:pipeline0/GstPulseSrc:pulsesrc0: Failed to connect: Connection refused
Additional debug info:
../git/ext/pulse/pulsesrc.c(1016): gst_pulsesrc_open (): /GstPipeline:pipeline0/GstPulseSrc:pulsesrc0
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
I have no idea what audio server needs for pulsesrc, probably it needs some /dev/audioX, but on this machine there is no /dev/audioX available, may be there is some issue here.
Also I have this audio devices on gst-device-monitor-1.0:
root@imx8qxp-var-som:~# gst-device-monitor-1.0
Probing devices...
(gst-device-monitor-1.0:520): GStreamer-CRITICAL **: 08:36:22.486: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed
(gst-device-monitor-1.0:520): GStreamer-CRITICAL **: 08:36:22.499: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed
...
Device found:
name : wm8904-audio
class : Audio/Sink
caps : audio/x-raw, format={ (string)S32LE, (string)S24_32LE, (string)S16LE }, layout=interleaved, rate=[ 8000, 96000 ], channels=2, channel-mask=0x0000000000000003
properties:
device.api = alsa
device.class = sound
alsa.card = 0
alsa.card_name = wm8904-audio
alsa.driver_name = simple-card
alsa.name = wm8904-audio
alsa.id = wm8904audio
alsa.mixername = ""
alsa.components = ""
gst-launch-1.0 ... ! alsasink device="hw:0\,0"
Device found:
name : wm8904-audio
class : Audio/Source
caps : audio/x-raw, format={ (string)S32LE, (string)S24_32LE, (string)S16LE }, layout=interleaved, rate=[ 8000, 96000 ], channels=2, channel-mask=0x0000000000000003
properties:
device.api = alsa
device.class = sound
alsa.card = 0
alsa.card_name = wm8904-audio
alsa.driver_name = simple-card
alsa.name = wm8904-audio
alsa.id = wm8904audio
alsa.mixername = ""
alsa.components = ""
gst-launch-1.0 alsasrc device="hw:0\,0" ! ...
I have tried also with alsasrc record and play:
root@imx8qxp-var-som:~# GST_DEBUG=3,alsa*:9 gst-launch-1.0 -v alsasrc device="hw:0,0" ! audioconvert ! vorbisenc ! oggmux ! filesink location=alsasrc.ogg
0:00:00.123746529 864 0xaaaafccd5c70 DEBUG alsa gstalsaelement.c:70:alsa_element_init: binding text domain gst-plugins-base-1.0 to locale dir /usr/share/locale
0:00:00.125168673 864 0xaaaafccd5c70 DEBUG alsa gstalsasrc.c:300:gst_alsasrc_init:<GstAlsaSrc@0xaaaafcdb8270> initializing
0:00:00.140407715 864 0xaaaafccd5c70 DEBUG alsa gstalsasrc.c:328:gst_alsasrc_getcaps:<alsasrc0> device not open, using template caps
0:00:00.140810881 864 0xaaaafccd5c70 DEBUG alsa gstalsasrc.c:328:gst_alsasrc_getcaps:<alsasrc0> device not open, using template caps
0:00:00.141142165 864 0xaaaafccd5c70 DEBUG alsa gstalsasrc.c:328:gst_alsasrc_getcaps:<alsasrc0> device not open, using template caps
0:00:00.141795106 864 0xaaaafccd5c70 DEBUG alsa gstalsasrc.c:328:gst_alsasrc_getcaps:<alsasrc0> device not open, using template caps
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
0:00:00.155190712 864 0xaaaafcb23b60 FIXME default gstutils.c:4025:gst_pad_create_stream_id_internal:<alsasrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:00.155554499 864 0xaaaafcb23b60 INFO alsa gstalsasrc.c:346:gst_alsasrc_getcaps:<alsasrc0> template caps audio/x-raw, format=(string){ F64LE, F64BE, F32LE, F32BE, S32LE, S32BE, U32LE, U32BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, S16LE, S16BE, U16LE, U16BE, S8, U8 }, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]; audio/x-iec958, format=(string)U32LE, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)2
0:00:00.155851654 864 0xaaaafcb23b60 DEBUG alsa gstalsa.c:196:gst_alsa_detect_formats:<alsasrc0> audio/x-iec958
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
0:00:00.155952789 864 0xaaaafcb23b60 LOG alsa gstalsa.c:30:gst_alsa_detect_rates:<alsasrc0> probing sample rates ...
0:00:00.156008295 864 0xaaaafcb23b60 DEBUG alsa gstalsa.c:49:gst_alsa_detect_rates:<alsasrc0> Min. rate = 8000 (8000)
0:00:00.156054924 864 0xaaaafcb23b60 DEBUG alsa gstalsa.c:50:gst_alsa_detect_rates:<alsasrc0> Max. rate = 96000 (96000)
0:00:00.156100804 864 0xaaaafcb23b60 LOG alsa gstalsa.c:372:gst_alsa_detect_channels:<alsasrc0> probing channels ...
0:00:00.156161685 864 0xaaaafcb23b60 DEBUG alsa gstalsa.c:416:gst_alsa_detect_channels:<alsasrc0> Min. channels = 2 (2)
0:00:00.156208315 864 0xaaaafcb23b60 DEBUG alsa gstalsa.c:417:gst_alsa_detect_channels:<alsasrc0> Max. channels = 2 (2)
0:00:00.156328827 864 0xaaaafcb23b60 INFO alsa gstalsasrc.c:356:gst_alsasrc_getcaps:<alsasrc0> returning caps audio/x-raw, format=(string){ S32LE, S24_32LE, S16LE }, layout=(string)interleaved, rate=(int)[ 8000, 96000 ], channels=(int)2, channel-mask=(bitmask)0x0000000000000003
New clock: GstAudioSrcClock
0:00:00.158278400 864 0xaaaafcb23b60 DEBUG alsa gstalsasrc.c:406:set_hwparams:<alsasrc0> buffer time 200000, min 2993, max 2972155
0:00:00.158365408 864 0xaaaafcb23b60 DEBUG alsa gstalsasrc.c:412:set_hwparams:<alsasrc0> period time 10000, min 1496, max 185715
0:00:00.158448292 864 0xaaaafcb23b60 DEBUG alsa gstalsasrc.c:418:set_hwparams:<alsasrc0> periods min 2, max 1985
0:00:00.158584931 864 0xaaaafcb23b60 DEBUG alsa gstalsasrc.c:433:set_hwparams:<alsasrc0> period time 10068 buffer time 201360 set correctly
0:00:00.182139690 864 0xaaaafcb23b60 DEBUG alsa gstalsasrc.c:478:set_hwparams:<alsasrc0> buffer size : 8880
0:00:00.182233075 864 0xaaaafcb23b60 DEBUG alsa gstalsasrc.c:481:set_hwparams:<alsasrc0> period size : 444
0:00:00.182459348 864 0xaaaafcb23b60 DEBUG alsa gstalsasrc.c:834:gst_alsasrc_prepare:<alsasrc0> Hardware setup:
stream : CAPTURE
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 44100
exact rate : 44100 (44100/1)
msbits : 16
buffer_size : 8880
period_size : 444
period_time : 10068
0:00:00.182580360 864 0xaaaafcb23b60 DEBUG alsa gstalsasrc.c:839:gst_alsasrc_prepare:<alsasrc0> Software setup:
tstamp_mode : ENABLE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 444
period_event : 0
start_threshold : 0
stop_threshold : 8880
silence_threshold: 0
silence_size : 0
boundary : 4998995586381250560
0:00:00.182830135 864 0xaaaafcb23b60 WARN alsa pcm_hw.c:1360:snd_pcm_hw_get_chmap: alsalib error: Cannot read Channel Map ctl
: No such file or directory
0:00:00.182935146 864 0xaaaafcb23b60 LOG alsa gstalsa.c:860:alsa_detect_channels_mapping:<alsasrc0> ALSA driver does not implement channels mapping API
/GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-buffer-time = 201360
/GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-latency-time = 10068
Redistribute latency...
/GstPipeline:pipeline0/GstAlsaSrc:alsasrc0.GstPad:src: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)44100, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src: caps = audio/x-raw, rate=(int)44100, channels=(int)2, format=(string)F32LE, layout=(string)interleaved, channel-mask=(bitmask)0x0000000000000003
/GstPipeline:pipeline0/GstVorbisEnc:vorbisenc0.GstPad:sink: caps = audio/x-raw, rate=(int)44100, channels=(int)2, format=(string)F32LE, layout=(string)interleaved, channel-mask=(bitmask)0x0000000000000003
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)44100, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPipeline:pipeline0/GstVorbisEnc:vorbisenc0: last-message = encoding at quality level 0.30
Redistribute latency...
0:00:00.246260682 864 0xaaaafcb23b60 FIXME basesink gstbasesink.c:3395:gst_base_sink_default_event:<filesink0> stream-start event without group-id. Consider implementing group-id handling in the upstream elements
0:00:00.246644846 864 0xaaaafcb23b60 WARN audioencoder gstaudioencoder.c:980:gst_audio_encoder_finish_frame:<vorbisenc0> Can't copy metadata because input buffer disappeared
Some scope of issues
root@imx8qxp-var-som:~# GST_DEBUG=3,alsa*:9 gst-launch-1.0 filesrc location=alsasrc.ogg ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink
Setting pipeline to PAUSED ...
0:00:00.164507605 885 0xaaab1e302810 WARN pulse pulsesink.c:617:gst_pulseringbuffer_open_device:<autoaudiosink0-actual-sink-pulse> error: Failed to connect: Connection refused
0:00:00.169726634 885 0xaaab1e302810 DEBUG alsa gstalsaelement.c:70:alsa_element_init: binding text domain gst-plugins-base-1.0 to locale dir /usr/share/locale
0:00:00.170570574 885 0xaaab1e302810 DEBUG alsa gstalsasink.c:266:gst_alsasink_init:<GstAlsaSink@0xaaab1e325a30> initializing alsasink
0:00:00.170680208 885 0xaaab1e302810 DEBUG alsa gstalsasink.c:308:gst_alsasink_getcaps:<autoaudiosink0-actual-sink-alsa> device not open, using template caps
0:00:00.234804418 885 0xaaab1e302810 LOG alsa gstalsasink.c:911:gst_alsasink_open:<autoaudiosink0-actual-sink-alsa> Opened device default
0:00:00.241689951 885 0xaaab1e302810 LOG alsa gstalsasink.c:911:gst_alsasink_open:<autoaudiosink0-actual-sink-alsa> Opened device default
0:00:00.243218194 885 0xaaab1e302810 WARN basesrc gstbasesrc.c:3688:gst_base_src_start_complete:<filesrc0> pad not activated yet
Pipeline is PREROLLING ...
0:00:00.245038710 885 0xaaab1e3144c0 WARN oggdemux gstoggdemux.c:3417:gst_ogg_demux_do_seek:<'':src_47b83c1f> Locking on pts 0:00:00.480362811
0:00:00.246162796 885 0xaaab1e3144c0 DEBUG alsa gstalsa.c:198:gst_alsa_detect_formats:<autoaudiosink0-actual-sink-alsa> skipping non-raw format or iec958 format
0:00:00.246275055 885 0xaaab1e3144c0 DEBUG alsa gstalsa.c:198:gst_alsa_detect_formats:<autoaudiosink0-actual-sink-alsa> skipping non-raw format or iec958 format
0:00:00.246317183 885 0xaaab1e3144c0 DEBUG alsa gstalsa.c:198:gst_alsa_detect_formats:<autoaudiosink0-actual-sink-alsa> skipping non-raw format or iec958 format
0:00:00.246358937 885 0xaaab1e3144c0 DEBUG alsa gstalsa.c:198:gst_alsa_detect_formats:<autoaudiosink0-actual-sink-alsa> skipping non-raw format or iec958 format
0:00:00.246417816 885 0xaaab1e3144c0 LOG alsa gstalsa.c:30:gst_alsa_detect_rates:<autoaudiosink0-actual-sink-alsa> probing sample rates ...
0:00:00.246481696 885 0xaaab1e3144c0 DEBUG alsa gstalsa.c:49:gst_alsa_detect_rates:<autoaudiosink0-actual-sink-alsa> Min. rate = 4000 (4000)
0:00:00.246528575 885 0xaaab1e3144c0 DEBUG alsa gstalsa.c:50:gst_alsa_detect_rates:<autoaudiosink0-actual-sink-alsa> Max. rate = 2147483647 (-1)
0:00:00.246574578 885 0xaaab1e3144c0 LOG alsa gstalsa.c:372:gst_alsa_detect_channels:<autoaudiosink0-actual-sink-alsa> probing channels ...
0:00:00.246624707 885 0xaaab1e3144c0 DEBUG alsa gstalsa.c:416:gst_alsa_detect_channels:<autoaudiosink0-actual-sink-alsa> Min. channels = 1 (1)
0:00:00.246670836 885 0xaaab1e3144c0 DEBUG alsa gstalsa.c:417:gst_alsa_detect_channels:<autoaudiosink0-actual-sink-alsa> Max. channels = 8 (10000)
0:00:00.247879554 885 0xaaab1e3144c0 DEBUG alsa gstalsa.c:498:gst_alsa_open_iec958_pcm:<autoaudiosink0-actual-sink-alsa> Generated device string "default"
0:00:00.257634559 885 0xaaab1e3144c0 LOG alsa gstalsasink.c:348:gst_alsasink_getcaps:<autoaudiosink0-actual-sink-alsa> Add pass-through capabilities
...
Also I can test output sound and it works, like:
root@imx8qxp-var-som:~# gst-launch-1.0 audiotestsrc ! autoaudiosink
So the issue on the source audio device
Also I can run another Linux image and micro also works
My system configuration:
Custom yocto distro Linux imx8qxp-var-som 5.15.60 Kirkstone
Let me summarize the yocto configuration:
DISTRO_FEATURES_BACKFILL_CONSIDERED:remove = " pulseaudio"
DISTRO_FEATURES_BACKFILL:append = " pulseaudio"
DISTRO_FEATURES:append = " alsa"
Can someone help me to resolve the problem on audio source solution. It doesn't matter use pulsesrc or alsasrc.
Thanks in advance, Anton
pls try this:
The pipeline described below shows the process to obtain this type of audio file and save it as an Ogg Vorbis file:
$ gst-launch-1.0 -v pulsesrc ! audioconvert ! vorbisenc ! oggmux ! filesink location=alsasrc.ogg
Hello, the result of command will be the same as on the first code block on my question before. The issue:
<autoaudiosink0-actual-sink-pulse> error: Failed to connect: Connection refused
I've made some progress and suppose that I have no configuration for micro.
Can you help me to configure micro input for the yocto build? Totally I have connected micro to the right channel on the LINEIN1_RP pin on the var-som-mx8x
since you use the third party company bsp, suggest that you can compare your bsp with nxp bsp, which can support this already