linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v4l-utils] Add options to v4l2-ctrl to save/load settings to/from a file
@ 2018-11-24 17:52 Antonio Ospite
  2019-01-03 18:00 ` [RFC PATCH 0/5] v4l2-ctl: list controls values in a machine-readable format Antonio Ospite
  0 siblings, 1 reply; 11+ messages in thread
From: Antonio Ospite @ 2018-11-24 17:52 UTC (permalink / raw)
  To: linux-media

Hi,

AFAIK every time a new v4l device is initialized (e.g. USB webcam
plugged in) the driver sets the controls to the default value decided by
the author in the source code.

It is then the responsibility of each v4l2 applications to save and
restore any variation to the controls values made by the user if this is
required.

I was looking for a more generic way to set some controls to non-default
values in a more persistent way, my main use case is to avoid *manually*
setting "Power Line Frequency" to 50Hz every time I plug in the webcam.

Something like what alsactrl[0] does with mixer settings.
Maybe pipewire will do that?

In the mean time, inspired by [1] I cleaned up the concept and published
it as v4l2-persistent-settings[2], the idea is that the user can save
the current state of a device and it would be restored automatically via
a udev rule the next time the device is initialized.

For that, the current device state has to be stored into a file.

For now I am massaging the output of "v4l2-ctl -l", saving that to
a file, and then parsing the file to generate something I can pass to
"v4l2-ctl --set-ctrl"; however it would be handier if v4l2-ctl had
a native mechanism to export and import settings.

v4l2ctrl from v4l2ucp[3] has options to save settings to a file and
reload them from a file, but I would like to use v4l2-ctl instead which
is actively maintained.

What about adding such options to v4l2-ctl?

Thank you,
   Antonio

[0] http://git.alsa-project.org/?p=alsa-utils.git;a=tree;f=alsactl;hb=HEAD
[1] https://superuser.com/questions/471597/linux-v4l-webcam-make-settings-stick
[2] https://git.ao2.it/v4l2-persistent-settings.git/
[3] https://sourceforge.net/projects/v4l2ucp/

-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-01-10 12:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-24 17:52 [v4l-utils] Add options to v4l2-ctrl to save/load settings to/from a file Antonio Ospite
2019-01-03 18:00 ` [RFC PATCH 0/5] v4l2-ctl: list controls values in a machine-readable format Antonio Ospite
2019-01-03 18:00   ` [RFC PATCH 1/5] v4l2-ctl: list controls with menus when OptAll is specified Antonio Ospite
2019-01-03 18:00   ` [RFC PATCH 2/5] v4l2-ctl: list once when both OptListCtrls and OptListCtrlsMenus are there Antonio Ospite
2019-01-03 18:01   ` [RFC PATCH 3/5] v4l2-ctl: use a dedicated function to print the control class name Antonio Ospite
2019-01-03 18:01   ` [RFC PATCH 4/5] v4l2-ctl: abstract the mechanism used to print the list of controls Antonio Ospite
2019-01-03 18:01   ` [RFC PATCH 5/5] v4l2-ctl: add an option to list controls in a machine-readable format Antonio Ospite
2019-01-07 10:18     ` Hans Verkuil
2019-01-09 21:15       ` Antonio Ospite
2019-01-10 12:05         ` Hans Verkuil
2019-01-07 10:21   ` [RFC PATCH 0/5] v4l2-ctl: list controls values " Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).