Commit Graph

18 Commits

Author SHA1 Message Date
George Kiagiadakis
43aa2d4952 scripts: don't use 'local' for file-wide scoped variables
Since all scripts run in a sandbox with their own global environment,
it means that they don't interfere with each other's global variables.
Therefore, all file-wide variables can be declared global without
any change in behavior. In my understanding, it is better to do so
because this means that any code accessing those variables is going
to access them directly from the global environment table with a simple
lookup rather than having each variable referenced in the local closure
of each function separately.
2023-09-29 23:13:28 +03:00
George Kiagiadakis
982bebe5aa scripts: use log topics 2023-05-19 20:12:08 +03:00
George Kiagiadakis
4f27d18bd3 log: rename "message" level to "notice" and print criticals with "E"
Syslog calls this level "notice" and I prefer it because we use it
to display significant messages that are not warnings, but they
are not really "standard", as GLib wants them to be. There is nothing
"standard" about log messages in general.

Also, make these notice messages be enabled at debug level 2, together
with warnings. The default log.level is 2 and it is a good idea to show
notices by default too.

Finally, show them in the log with "N" and also change criticals to be
shown with "E", meaning "error"... Then promote G_LOG_LEVEL_ERROR
messages to be shown with "F", meaning "fatal", because in fact these
messages are always fatal and always call abort(). Still, keep the term
"critical" in the functions to make sure that whoever uses them is aware
that this level is only for critical conditions and not suitable to
display any kind of error.
2023-05-18 16:19:49 +03:00
Julian Bouzas
360e0b3eaf scripts: use WpConf API to get configuration values
This patch also moves nested configuration objects that are not considered
settings from the wireplumber.settings section to its own configuration
section (eg the rules array, the spa plugin properties, etc...). This allows
those objects to be merged with other same sections defined in other files.
2023-04-17 07:48:18 -04:00
Julian Bouzas
6a612db57a config: make remaining non rule settings optional 2023-04-17 07:48:18 -04:00
Julian Bouzas
f1fbeaa661 m-lua-scripting: add fallback value for parse_{array|object}_safe() APIs 2023-04-17 07:48:18 -04:00
Julian Bouzas
42fc17b234 config: clean and comment all configuration that is not needed by default
Most of the configuration settings have a default value when they are loaded by
the Lua scripts if they are not present, so we leave them commented in the
configuration. This will make the configuration smaller when supporting layered
configuration, as all the commented sections will be part of the override files.
2023-04-17 07:48:16 -04:00
Ashok Sidipotu
66c63a91a9 monitors: Align nomenclature of the settings and rules 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
161c43b71a lua monitors: switch to wpsetttings
- switch alsa.lua, v4l2.lua & libcamera.lua
- remove the config/lua references for these scripts
- fix the wpsettings deps parsing bug.
2023-04-17 07:44:19 -04:00
Ashok Sidipotu
b78e441c79 libcamera.lua: add support for disabling nodes
Fixes #418
2023-02-22 14:13:17 +00:00
George Kiagiadakis
2ac384711d libcamera: give higher priority to external cameras
if you have plugged an external camera, that probably means you
prefer using that instead of the internal one
2022-05-31 12:15:11 +03:00
George Kiagiadakis
b44759ec3f libcamera: improve the front/back camera descriptions 2022-05-31 10:41:20 +03:00
George Kiagiadakis
6931050b7f v4l2/libcamera: set node.nick on nodes 2022-05-31 10:40:56 +03:00
George Kiagiadakis
2299c389b5 libcamera: set a user-friendly description for internal cameras 2022-05-30 11:06:46 +03:00
George Kiagiadakis
9ec2757d27 monitors: enable libcamera by default and set priority on all camera nodes
Currently v4l2 nodes will get higher priority than libcamera ones.
The default can be changed, of course, with wpctl.

Things are still not great if a camera is enumerated by both monitors.
The first node to be linked will grab the device and the second one
from the other subsystem will fail to negotiate.
2022-05-26 14:08:16 +03:00
Julian Bouzas
40b16974cf scripts: monitors: log warning if spa devices were not created successfully
Can happen if the user does not have the specific spa pluging installed.
2022-01-12 10:09:56 +00:00
Wim Taymans
45fae97036 libcamera: use the new manager object for monitoring 2021-11-15 11:58:14 +01:00
Wim Taymans
7907d39aff scripts: add libcamera monitor 2021-10-06 10:22:36 +02:00