wasapisrc: can't negotiate with microphone array
Describe your issue
On certain PC configurations, specifically a laptop that uses a "Realtek Microphone Array", wasapisrc
fails to negotiate/start streaming even with the simplest pipeline (wasapisrc ! fakesink
).
Expected Behavior
Audio/microphone streaming should work with wasapisrc
for microphone arrays.
Observed Behavior
Error output with debug:
>set GST_DEBUG=*:2,wasapisrc:6
>gst-launch-1.0.exe wasapisrc ! audio/x-raw ! fakesink
0:00:00.052790700 3968 0000000003261360 DEBUG wasapisrc gstwasapisrc.c:357:gst_wasapi_src_get_caps:<wasapisrc0> entering get caps
0:00:00.058956500 3968 0000000003261360 DEBUG wasapisrc gstwasapisrc.c:409:gst_wasapi_src_get_caps:<wasapisrc0> returning 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 ]
0:00:00.075215400 3968 0000000003261360 DEBUG wasapisrc gstwasapisrc.c:357:gst_wasapi_src_get_caps:<wasapisrc0> entering get caps
0:00:00.081403400 3968 0000000003261360 DEBUG wasapisrc gstwasapisrc.c:409:gst_wasapi_src_get_caps:<wasapisrc0> returning 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 ]
0:00:00.093858400 3968 0000000003261360 DEBUG wasapisrc gstwasapisrc.c:357:gst_wasapi_src_get_caps:<wasapisrc0> entering get caps
0:00:00.102311700 3968 0000000003261360 DEBUG wasapisrc gstwasapisrc.c:409:gst_wasapi_src_get_caps:<wasapisrc0> returning 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 ]
Use Windows high-resolution clock, precision: 1 ms
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
0:00:00.128832000 3968 0000000003269500 DEBUG wasapisrc gstwasapisrc.c:357:gst_wasapi_src_get_caps:<wasapisrc0> entering get caps
Got message #9 from element "fakesink0" (state-changed): 0:00:00.136763200 3968 0000000003269500 INFO wasapisrc gstwasapisrc.c:392:gst_wasapi_src_get_caps:<wasapisrc0> positions are: [ NONE NONE NONE NONE ]
GstMessageStateChanged, old-state=(GstState)null, new-state=(GstState)ready, pending-state=(GstState)void-pending;
0:00:00.142016900 3968 0000000003269500 DEBUG wasapisrc gstwasapisrc.c:409:gst_wasapi_src_get_caps:<wasapisrc0> returning caps audio/x-raw, format=(string)F32LE, layout=(string)interleaved, rate=(int)48000, channels=(int)4
Got message #10 from element "capsfilter0" (state-changed): ERROR: from element /GstPipeline:pipeline0/GstWasapiSrc:wasapisrc0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstWasapiSrc:wasapisrc0:
streaming stopped, reason not-negotiated (-4)
GstMessageStateChanged, old-state=(GstState)null, new-state=(GstState)ready, pending-state=(GstState)void-pending;
ERROR: pipeline doesn't want to preroll.
Got message #11 from element "wasapisrc0" (state-changed): GstMessageStateChanged, old-state=(GstState)null, new-state=(GstState)ready, pending-state=(GstState)void-pending;
Setting pipeline to NULL ...
Freeing pipeline ...
Setup
- Operating System: Windows 10
- Device: Computer: Laptop (Panasonic Toughbook FZ-55)
- GStreamer Version: v1.20.2
-
Command line:
wasapisrc ! fakesink
Steps to reproduce the bug
- Acquire PC with a microphone array.
- Run the launchline
wasapisrc ! fakesink
. - Observe error log; pipeline fails to start.
How reproducible is the bug?
Always
Solutions you have tried
These pipelines also fail:
autoaudiosrc ! fakesink
wasapisrc ! audioresample ! audioconvert ! autoaudiosink
directsoundsrc device="\{0D7BE1C4-C337-4A7D-8720-FE31408BA7AA\}" ! fakesink
Additional Information
device-monitor output
Device found:
name : Microphone Array (Realtek(R) Audio)
class : Audio/Source
caps : audio/x-raw, format={ (string)S16LE, (string)S8 }, layout=interleaved, rate=[ 1, 2147483647 ], channels=[ 1, 2 ]
properties:
device.api = directsound
device.guid = "\{0D7BE1C4-C337-4A7D-8720-FE31408BA7AA\}"
directsound.device.driver = "\{0.0.1.00000000\}.\{0d7be1c4-c337-4a7d-8720-fe31408ba7aa\}"
directsound.device.description = "Microphone\ Array\ \(Realtek\(R\)\ Audio\)"
gst-launch-1.0 directsoundsrc device="\{0D7BE1C4-C337-4A7D-8720-FE31408BA7AA\}" ! ...
Device found:
name : Microphone Array (Realtek(R) Audio)
class : Audio/Source
caps : audio/x-raw, format=F32LE, layout=interleaved, rate=48000, channels=4
properties:
device.api = wasapi
device.strid = "\{0.0.1.00000000\}.\{0d7be1c4-c337-4a7d-8720-fe31408ba7aa\}"
wasapi.device.description = "Microphone\ Array\ \(Realtek\(R\)\ Audio\)"
gst-launch-1.0 wasapisrc device="\{0.0.1.00000000\}.\{0d7be1c4-c337-4a7d-8720-fe31408ba7aa\}" ! ...