#Logiech 920 webcam is up and running and I have autofocus dialed in. Exposure won't stick.

164 messages · Page 1 of 1 (latest)

full hearth
#

I put the exposure setting in the same way as the autofocus but it doesn't seem to be sticking.
https://imgur.com/a/sEM8D5c
When I SSH into the camera and use "v4l2-ctl -d /dev/video0 --set-ctrl=exposure_absolute=130" I can see the camera visibly darken. The same thing with brightness.
However when I put it in the crowsnest.conf and restart it has not changed.
https://pastebin.com/Nr1VrJhY Conig

patent glade
#

Easiest way to confirm is make your change, restart crowsnest.
ssh in your sbc
v4l2-ctl -L

#

The values should match

#

We found some where’d behaviors with the Logitech cams, so maybe you found the next

full hearth
#

I am still within the return policy on this one... is there something you recommend more than this camera?

#

Wanting decent picture quality

patent glade
#

The camera works perfect, I use it myself. But e.g for the focus_auto we found that we need to set the manual value trwice after going from auto to manual

#

So make the test as describt and if you really find it is not working get a screenshot in

full hearth
#

my picture is just insane washed out

#

I tried chaning some of the values

#

ok

patent glade
#

Now as a test put in the exposure value twice (I will not type that all in

full hearth
#

ok

patent glade
#

Restart crowsnest and check again

full hearth
#

Like this?

patent glade
#

The auto_priority you can remove complete the value0 is the default

#

You removed the setting of the manual mode!

full hearth
#

I did?

patent glade
#

Yes I do not see expose_auto=1 in there

full hearth
#

like so?

patent glade
#

Copy the line in here as text so that I can copy and modify ig

full hearth
#

okm

#

[crowsnest]
log_path: ~/printer_data/logs/crowsnest.log
log_level: verbose # Valid Options are quiet/verbose/debug
delete_log: true # Deletes log on every restart, if set to true

[cam 1]
mode: mjpg # mjpg/rtsp
port: 8080 # Port
device: /dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920_8A4DA16F-video-index0 # See Log for available ...
resolution: 1920x1080 # widthxheight format
max_fps: 30
v4l2ctl: focus_auto=0,focus_absolute=55,brightness=115,exposure_absolute=115,exposure_absolute=115,exposure_auto=1,exposure_auto=1

If Hardware Supports this it will be forced, ohterwise ignored/coerced.

#custom_flags: # You can run the Stream Services with custom flags.
#v4l2ctl: # Add v4l2-ctl parameters to setup your camera, see Log what your cam is capable of.

patent glade
#
v4l2ctl: focus_auto=0,focus_absolute=55,brightness=115,exposure_auto=1,exposure_absolute=115,exposure_absolute=115
full hearth
patent glade
#

And if you set that now in here manually it works?

full hearth
#

Kinda weird I set it to 115 and now it says 77

patent glade
#

That is why I always recommend to test the values manual via ssh first. Than make the setup in crowsnest and check it after the next restart

#

So if you now try to set 77 does it stay or change again

full hearth
#

Set as 200 and gives me 156

#

Ill try 200

#

200 in crowsnest config still shoots out 312

#

wtf

patent glade
#

Have you the double value in, do you restart crowsnest correctly

full hearth
#

I am not sure I hit save and restart at top

#

restarted it manually still 312

patent glade
#

I am not sure if it works, with save and restart never tested that. For me it takes 2-3 minutes after a crowsnest restart and the log

#

Than I need to work with @wet bloom to find out if we find something. But that will take a while.

full hearth
#

Okay. Thanks for the effort

patent glade
#

Get your values in, first start it manually and if that works you could add it as cronjob starting at reboot

wet bloom
#

Is your Issue related to exposure settings? If yes, it is exposure_auto. You set it to 1 which means it trys to set all exposure settings by firmware, this ignores then what ever you setup. Needs to be exposure_auto=0

#

Or does it ignore other settings also?

patent glade
#

exposure_auto=1 is manual mode

wet bloom
#

Yes, 0 should turn it off completly even the entry doesn show it.

#

If that doesn't help we need to do some research on it 🤷‍♂️

patent glade
#

It allows only 1 and 3

wet bloom
#

What is about auto_white_balance? Could this lead to the same behavior?

patent glade
#

But yes we need to do more research

#

No clue and no time now, we will do that internal

wet bloom
#

Kk..

full hearth
wet bloom
#

But does it apply to all settings or only to exposure?

full hearth
#

When I set it to anything other than 1 or 3 crowsnest won’t start

wet bloom
#

But what about the other tweaks? Do they apply or do they fail all?

full hearth
#

ah it seems like focus works, absolute focus works, couldnt get exposure to work, couldnt get brigtness to work

patent glade
#

Brightness worked you programmed 115 and get 115

wet bloom
#

Ok.. @patent glade I think we should try setting v4l after stream starts. @full hearth Stay tuned. Will prepare something, dont know how fast I can do it but is on my todo.

full hearth
#

Okay mate I genuinely appreciate the help

full hearth
#

Not even sure how to do that patch but I wasn't sure if this info would help at all

wet bloom
#

Well, I took a look .. that commit is from 2014 and I think ist already present in the actual used kernel. Prove me wrong but I think, that Logitech did once again a good job to mess this workaround up in newer models.

muted fox
#

so ill wade in with my experience. I recently set this up and see similar issues. If i use ssh to set its works and every few boots it works fine si i know the setting are acceptable.

I find when it fails i loose white balance temperature, focus absolute and exposure. I assume as the auto modes are not setting they fail.

Happy to test any fixes or collect data if needed.

My settings are

white_balance_temperature_auto=0,gain=0,white_balance_temperature=5000,sharpness=255,exposure_auto=1,exposure_absolute=156,exposure_auto_priority=0,focus_auto=0,focus_absolute=60

full hearth
#

Ok so I copied your settings exactly and they worked. At first I am like"hooray!"
The exposure however is too low for my setting so I ONLY change the exposure from 156 to 200.
reload crowsnest and it's set to 200 in the config file but when I check via ssh with v4l2 it is still at 156.
Okay... I use v4l2 and change it manually and find that 265 is the perfect level.
change to 265 in the text file reload and.... v4l2 now says it is 77
Wtf!

wet bloom
#

It seems, I need some workaround for that specific model

#

But it may take time, have to fix major bug in sonar first

full hearth
#

Not trying to rush you at all. Just trying to add as much info as possible. You guys are freaking amazing. I appreciate all the help!

wet bloom
#

Any input is welcome. Helps a lot to develop without being able to test myself

muted fox
#

I appriciate you are busy. do we have an ETA when this possible fix might be available for testing? anything we can do that could help?

wet bloom
#

Currently no ETA, but is not forgotten...

wet bloom
#

@muted fox @full hearth Could you be kind test something ?

#

Please patch crowsnest main script

#

Move v4l2_control behind construct_streamer

#

And restart crowsnest

#

If that helps, I need to check if that works with others also

full hearth
#

Yes I am happy to test something

#

let me try when I get home tonight

#

When you say behind, you mean move v4l2_control to past line 69/under construct_streamer?

patent glade
#

Yes

#

So L67 before L70

full hearth
#

Sorry I am a bit confused. Is this the crowsnest.conf?

patent glade
#

No it is the source code.

#

SSH in your pi

#

Use a editor e.g.
nano crowsnest/crowsnest
Modify the file and after that restart crowsnest

full hearth
#

gotcha thank you

#

Like this?

#

The exposure on this camera just will not let me set it lol

wet bloom
# full hearth

Wait a second... Is it a display error on my phone, or are you using dashes between parameters and values?

#

If thats tje case then its simply not setting these because tje used field separator is an equal sign...

#

parameter=value

full hearth
#

I think I have it correctly …

patent glade
#

Wait a minute it changed the value as it is not default anymore

#

We seen that while manual input with v4l2 that the number you set is not the number you get

#

So compare the numbers from your svreenshot against the numbers in your log

wet bloom
full hearth
#

The problem is it seems to default to that 156 value and won’t change based on what I input

wet bloom
#

Let me wrap my head around. Exposure should regulate how long the sensor is exposed to light from the lens basicly right? What if you change the lighning from the scene? Does it affekt that value? If yes I could imagine the logic of automode is reversed on that firmware, so exposure_auto=3 is manual and 1 is auto...

patent glade
#

Honestly saying I am not sure if that is worth the time we spend. You can Google it the C920 has an fw bug and will forgot the expose setting anytime a new stream is initiated.

#

That’s nothing we can fix with playing around with the position when we start what

full hearth
#

I will try that and let you know.

muted fox
#

I am not sure the logic is reversed in the C920 as it sets perfectly in SSH with V4L2 so the settings are correct, also multiple restarts it does finally work. I need to test the new fix now its been moved. but need to know the best way to install the new commits as they are not in the master.

patent glade
#

@wet bloom

wet bloom
#

The intressting part is do you apply them before or after ustreamer runs? We werent able to roproduce that 🤷‍♂️

muted fox
#

I assume after as the service is running then I SSH and set them from the CLI and the stream looks good.

wet bloom
#

Could you test something please? Stop crowsnest, disable crowsnest service, reboot. After reboot set some values, then start crowsnest and see if they stay. My guess is the cam resets this values after ustreamer starts

muted fox
#

do I need to remove the V4L2 settings line in the Crowsnest cfg?

#

I saw you added a new V4L2 post start. I can't test this as I need to get the updated commits to my setup. What is the best way to switch switch to the ayucamstream branch?

wet bloom
wet bloom
#

If that works I have to add something that checks all parameters and re-set them if needed

muted fox
#

ok. Ill test later and let you know. Thanks

wet bloom
muted fox
#

Ok. So I might have some good info.
Disabling Crowsnest, Reboot and manually setting the commands then restarting crowsnest causes only whitebalance to change its value. Below is what I set

white_balance_temperature_auto=0,gain=0,white_balance_temperature=5000,sharpness=255,exposure_auto=1,exposure_absolute=156,exposure_auto_priority=0,focus_auto=0,focus_absolute=60

However. setting these values using the V4L2 command showed up some erratic results. some times I could apply the above line and it will work. othertimes I need to reapply it 2-3 times to make it work. and sometimes I just had to break it down to make it work as it would not find some of the functions until the other successfully set.

#

I am going to try this but can you set the commands in batches. so have the commands apply all the auto - manual then the settings?

#

So in the CLI if i set it that way it does not complain.

#

so maybe having the option to set the v4l2 commands in batches would be good and maybe apply once the ustream has started it should work. is there a reason for it being done earlier?

wet bloom
#

Well, they are applied one by one in order how they are positioned in your v4l2ctl: line, maybe I could work something out with a control loop, but this will cause a slow startup then

muted fox
#

I think some settings need a few seconds to apply before the other is available to set

#

If I set them all in one line it fails. but 2 lines works fine

#

pi@raspberrypi:~ $ v4l2-ctl -d /dev/video0 -c white_balance_temperature_auto=0,exposure_auto=1,focus_auto=0,exposure_auto_priority=0
pi@raspberrypi:~ $ v4l2-ctl -d /dev/video0 -c gain=0,white_balance_temperature=5000,sharpness=255,exposure_absolute=156,focus_absolute=60

#

could you not have it loop through the number of lines in the .cfg and apply them like this? then if you want it individul you set 10 of them in the cfg

#

[cam 1]
mode: mjpg # mjpg/rtsp
port: 8080 # Port
device: /dev/video0 # See Log for available ...
resolution: 1920x1080 # widthxheight format
max_fps: 15 # If Hardware Supports this it will be forced, ohterwise ignored/coerced.
#custom_flags: # You can run the Stream Services with custom flags.
v4l2ctl: white_balance_temperature_auto=0,exposure_auto=1,focus_auto=0,exposure_auto_priority=0
v4l2ctl: gain=0,white_balance_temperature=5000,sharpness=255,exposure_absolute=156,,focus_absolute=60

or

[cam 1]
mode: mjpg # mjpg/rtsp
port: 8080 # Port
device: /dev/video0 # See Log for available ...
resolution: 1920x1080 # widthxheight format
max_fps: 15 # If Hardware Supports this it will be forced, ohterwise ignored/coerced.
#custom_flags: # You can run the Stream Services with custom flags.
v4l2ctl: white_balance_temperature_auto=0
v4l2ctl: exposure_auto=1
v4l2ctl: focus_auto=0
v4l2ctl: exposure_auto_priority=0
v4l2ctl: gain=0,white_balance_temperature=5000,sharpness=255,exposure_absolute=156,,focus_absolute=60

#

additionally have a wait option for those that need it.

#

[cam 1]
mode: mjpg # mjpg/rtsp
port: 8080 # Port
device: /dev/video0 # See Log for available ...
resolution: 1920x1080 # widthxheight format
max_fps: 15 # If Hardware Supports this it will be forced, ohterwise ignored/coerced.
#custom_flags: # You can run the Stream Services with custom flags.
v4l2ctl: white_balance_temperature_auto=0,exposure_auto=1,focus_auto=0,exposure_auto_priority=0
wait: 30 #In Millisecond
v4l2ctl: gain=0,white_balance_temperature=5000,sharpness=255,exposure_absolute=156,,focus_absolute=60

#

would allow flexibility depending on the camera and speed to respond

wet bloom
#

With multiline it wont work because crudini cant handle that

#

The last overwrites the first

muted fox
#

do you have maybe 3 variables which can be used if needed?

[cam 1]
mode: mjpg # mjpg/rtsp
port: 8080 # Port
device: /dev/video0 # See Log for available ...
resolution: 1920x1080 # widthxheight format
max_fps: 15 # If Hardware Supports this it will be forced, ohterwise ignored/coerced.
#custom_flags: # You can run the Stream Services with custom flags.
wait_time: 20 #time to delay between commands
v4l2ctl1: white_balance_temperature_auto=0,exposure_auto=1,focus_auto=0,exposure_auto_priority=0
v4l2ctl2: gain=0,white_balance_temperature=5000,sharpness=255,exposure_absolute=156,,focus_absolute=60

v4l2ctl3: used if needed to layer commands with delays

#

This means just using 1 is the same speed to boot as now.
using 2/3 would run with a delay before the next batch is run?

wet bloom
#

@patent glade What do you think about that?

wet bloom
muted fox
#

So just a wait option? so one command but the ability to slow the comands by x ms. probably only used by a few.

Still need to see if ustreamer starting will clear it. it only seemed to do the whitebalance however.

patent glade
#

For me that feels rather complicated. I am not sure if most users would be willing to find out what to split

#

Why not simple have 1 list and a wait time and that time will be executed between any parameter

#

As I understands the c920 bug a stream start will always make it forgot it and than you are lost again

#

The stream stop if you do not watch the cam

muted fox
#

Can we reapply each time the stream starts? so its part of the stream start process? or at least have that as an option in the config to enable that?

#

Whats annoying is I bought this cam of recommendations it was a good option! So keen to help this to be made working. its a bit hit an miss restarting the crowsnest service to loosing the settings.

wet bloom
#

I could implement some configure able wait time, but in the end there isnt much we can do, if the firmware of that cam is that kind of picky

wet bloom
#

If you compare old C920 and the newest model hardware and firmware wise, they might differ in an unwanted fashion.

#

But, if you stop activly watching and ustreamer drops their clients, there is no possibilty to restart crowsnest on that event.

muted fox
#

I would need to test the ustreamer dropping causing the settings to fail. not sure it does. I think it holds.
I have no idea what edition of the C920 I have. just its the Pro HD version

wet bloom
#

@muted fox Could you please share your v4l2ctl: line again please ? Wanna test something

muted fox
#

white_balance_temperature_auto=0,gain=0,white_balance_temperature=5000,sharpness=255,exposure_auto=1,exposure_absolute=156,exposure_auto_priority=0,focus_auto=0,focus_absolute=60

#

I recently tried it reordered too with all the auto settings first.

wet bloom
#

Thats what I want to filter out first, thats why I asked for the whole line

lavish igloo
#

Was just reading through this chain to see if there was a fix for the C920 issue yet. It is seeming like a fix might be more involved than practical if I am reading things correctly?

balmy grove
#

Logitech cams have a lot of different problems and it's hard to fix them all. So yeah it can be hard to fix it and maybe it's impossible. Don't know if kwad investigated on it any further

wet bloom
#

My future plan is to mimic udev rules via a custom script with a few hookup points, because you cant make it right for several setups and/or camera combo's. Therefor I plan to add a section that is avle to call a script where users can run shell commands on its own. Dont know how it will look in the end, but users should be able to make its own customization if needed.