wasapi2sink - Could not open resource for writing

Nirbheek Chauhan nirbheek.chauhan at gmail.com
Wed Apr 6 07:52:24 UTC 2022

Hi Jonas,

Ideally you should use the GstDeviceMonitor API for discovering
devices and creating elements that use those devices. That will always
do the right thing.


You can test this by running:

gst-device-monitor-1.0 Audio/Sink

Here is the source code for that:



On Wed, Apr 6, 2022 at 4:15 AM Jonas Kvinge via gstreamer-devel
<gstreamer-devel at lists.freedesktop.org> wrote:
> Hi,
> When using an audio playbin with wasapi2sink on Windows 11 and setting
> the audio device I'm getting the following error :
> Domain: 2662 Code: 6 Error: "Could not open resource for writing."
> Debug: "../sys/wasapi2/gstwasapi2ringbuffer.cpp(324):
> gst_wasapi2_ring_buffer_post_open_error ():
> /GstBin:audiobin/GstWasapi2Sink:pipeline-3-wasapi2sink:\nFailed to open
> device"
> The same devices works fine with wasapisink.
> Example device is: {}.{82631c85-c597-497e-b082-2f80df4461e1}
> I get this using CLSID_MMDeviceEnumerator
> Do you need to set the device differently with wasapi2sink?
> Jonas

More information about the gstreamer-devel mailing list