# Enabling dynamic resolution with UVC sink

**URL:** <https://discourse.gstreamer.org/t/enabling-dynamic-resolution-with-uvc-sink/4112>\
**Category:** Plugin and library development\
**Created:** [February 11, 2025, 12:47pm UTC](https://discourse.gstreamer.org/t/enabling-dynamic-resolution-with-uvc-sink/4112 "2025-02-11T12:47:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vtilakece](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/v/858c86/32.png) [@vtilakece](https://discourse.gstreamer.org/u/vtilakece)\
**Post date:** [February 11, 2025, 12:47pm UTC](https://discourse.gstreamer.org/t/enabling-dynamic-resolution-with-uvc-sink/4112/1 "2025-02-11T12:47:21Z")

</div>

Hello, I am testing UVCsink app on a embedded board. When I connect the cameracontrols app and open the uvcstream configured on the embedded device, I notice that it works for a predefined resolution.

When the camera controls host requests, a new resolution, the uvcsink plugin does not let it with the error message: " Device or resource busy" and lets the cameracontrols app run in the static original resolution/caps.

Is it possible to enable uvcsink based events such as STREAM\_ON , Send reconfigure and catch them as a signal? If that would be possible, I would like to change caps dynamically in my gstreamer application.

Thank you

---

<div class="post-metadata">

**Author:** ![mgrzeschik](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/mgrzeschik/32/1157_2.png) [@mgrzeschik](https://discourse.gstreamer.org/u/mgrzeschik)\
**Post date:** [February 11, 2025, 3:26pm UTC](https://discourse.gstreamer.org/t/enabling-dynamic-resolution-with-uvc-sink/4112/2 "2025-02-11T15:26:11Z")

</div>

What is the cameracontrols app? If the app is running on the host, it should be possible to switch resolutions on the fly. The uvcsink is exposing its predefined formats/resolutions via configfs. Whatever the host is seeing from the descriptors should be possible to get via the uvc gadget. It’s the applications work to gaurantee that the format/res is available from the source via the caps on the uvcsink.

If you mean like switching the exporting formats from the gadget side? That would rather not be possible since the host is expecting something that it actually has allocated memory. It should not be possible to send the host something else then it expects.

For the first case though, there should be everything available to switch resoltions.

Thanks

---

<div class="post-metadata">

**Author:** ![vtilakece](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/v/858c86/32.png) [@vtilakece](https://discourse.gstreamer.org/u/vtilakece)\
**Post date:** [February 13, 2025, 11:03am UTC](https://discourse.gstreamer.org/t/enabling-dynamic-resolution-with-uvc-sink/4112/3 "2025-02-13T11:03:56Z")

</div>

Hi @mgrzeschik

thanks for the quick response. Yes, the configfs is set up to have 2 resolutions 1080p, 720p YUYV format. I see it also exposed at the Cameracontrols app. This is just a GUI client that opens the UVC stream on a Linux-NUC. [GitHub - soyersoyer/cameractrls: Camera controls for Linux](https://github.com/soyersoyer/cameractrls.git)

I have attached a screenshot where the host side client output resource busy

 ![uvc-controls](https://discourse.gstreamer.org/uploads/default/original/2X/f/f50db5a504d67b3ba97f843a4957cb97b9760dca.png)  
My pipeline is serving FHD stream:

```auto
gst-launch-1.0 -e -v qtiqmmfsrc camera=0 name=camsrc ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! videoconvert ! video/x-raw,format=YUY2,
width=1920,height=1080,framerate=30/1 ! tee name=t t. ! queue max-size-buffers=30 ! uvcsink message-forward=true async-handling=true v4l2sink::device=/dev/video4

```

I logged some info at the uvc host selected and the reconfigure events:

5403476 e[32m 1711e[00m 0x55baa20640 e[37mDEBUG e[00m e[00m uvcsink uvc.c:261:uvc\_events\_process\_data:e[00m setting commit control  
Width from debug = 1920, Height = 1080  
0:00:36.175803789 e[32m 1711e[00m 0x55baa20640 e[36mINFO e[00m e[00m uvcsink gstuvcsink.c:638:gst\_uvc\_sink\_task:e[00m UVC host selected video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string){ 2:4:7:1 }, framerate=(fraction)30/1  
0:00:36.175860976 e[32m 1711e[00m 0x55baa20640 e[37mDEBUG e[00m e[00m uvcsink gstuvcsink.c:590:gst\_uvc\_sink\_task:e[00m UVC\_EVENT\_STREAMON  
0:00:36.196043372 e[32m 1711e[00m 0x55baa20400 e[37mDEBUG e[00m e[00m uvcsink gstuvcsink.c:417:gst\_uvc\_sink\_sinkpad\_idle\_probe:e[00m **Send reconfigure**  
0:00:36.197007955 e[32m 1711e[00m 0x55baa20520 e[37mDEBUG e[00m e[00m uvcsink gstuvcsink.c:295:gst\_uvc\_sink\_query:e[00m caps video/x-raw, format=**(string)YUY2, width=(int)1920, height=(int)1080**, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string){ 2:4:7:1 }, framerate=(fraction)30/1  
0:00:36.197028632 e[32m 1711e[00m 0x55baa20520 e[37mDEBUG e[00m e[00m uvcsink gstuvcsink.c:379:gst\_uvc\_sink\_to\_v4l2sink:e[00m switching to v4l2sink

state\_changed\_cb called

state\_changed\_cb called

0:00:36.214429466 e[32m 1711e[00m 0x55baa20520 e[37mDEBUG e[00m e[00m uvcsink gstuvcsink.c:295:gst\_uvc\_sink\_query:e[00m caps video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string){ 2:4:7:1 }, framerate=(fraction)30/1  
0:00:47.257857066 e[32m 1711e[00m 0x55baa20640 e[37mDEBUG e[00m e[00m uvcsink gstuvcsink.c:607:gst\_uvc\_sink\_task:e[00m UVC\_EVENT\_SETUP  
0:00:47.257988889 e[32m 1711e[00m 0x55baa20640 e[37mDEBUG e[00m e[00m uvcsink uvc.c:403:uvc\_events\_process\_setup:e[00m bRequestType a1 bRequest 87 wValue 0200 wIndex 0200 wLength 0002  
0:00:47.258026024 e[32m 1711e[00m 0x55baa20640 e[37mDEBUG e[00m e[00m uvcsink uvc.c:363:uvc\_events\_parse\_control:e[00m UVC\_PU\_BRIGHTNESS\_CONTROL: GET\_DEF  
0:00:47.258947014 e[32m 1711e[00m 0x55baa20640 e[37mDEBUG e[00m e[00m uvcsink gstuvcsink.c:607:gst\_uvc\_sink\_task:e[00m UVC\_EVENT\_SETUP  
0:00:47.259010139 e[32m 1711e[00m 0x55baa20640 e[37mDEBUG e[00m e[00m uvcsink uvc.c:403:uvc\_events\_process\_setup:e[00m bRequestType a1 bRequest 81 wValue 0200 wIndex 0000 wLength 0001  
0:00:47.259033576 e[32m 1711e[00m 0x55baa20640 e[37mDEBUG e[00m e[00m uvcsink uvc.c:352:uvc\_events\_parse\_control:e[00m UVC\_VC\_REQUEST\_ERROR\_CODE\_CONTROL  
0:01:23.616962781 e[32m 1711e[00m 0x55baa20640 e[37mDEBUG e[00m e[00m uvcsink gstuvcsink.c:599:gst\_uvc\_sink\_task:e[00m UVC\_EVENT\_STREAMOFF  
0:01:23.631585073 e[32m 1711e[00m 0x55baa20400 e[37mDEBUG e[00m e[00m uvcsink gstuvcsink.c:417:gst\_uvc\_sink\_sinkpad\_idle\_probe:e[00m **Send reconfigure**  
0:01:23.631704135 e[32m 1711e[00m 0x55baa20400 e[37mDEBUG e[00m e[00m uvcsink gstuvcsink.c:352:gst\_uvc\_sink\_to\_fakesink:e[00m switching to fakesink

state\_changed\_cb called

0:01:23.632669291 e[32m 1711e[00m 0x55baa20520 e[37mDEBUG e[00m e[00m uvcsink gstuvcsink.c:295:gst\_uvc\_sink\_query:e[00m caps video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string){ 2:4:7:1 }, framerate=(fraction)30/1
