Git Product home page Git Product logo

Comments (4)

dev-foo-bar avatar dev-foo-bar commented on July 21, 2024

Stupid question - as far as I understand the fuser command it checks if the camera is used by a process.

Quote from the manpage

fuser displays the PIDs of processes using the specified files or file systems. 

To be honest, I have not so much experience with pipewire. But even with pipewire fuser should be a reliable source if the camera is in use or not. If I am wrong - please correct me. New knowledge is always welcome on my side :-)

from ha-mqtt-iot.

W-Floyd avatar W-Floyd commented on July 21, 2024

In my case, pipewire and wireplumber both are reported as using it even when the camera isn't actually in use.

from ha-mqtt-iot.

dev-foo-bar avatar dev-foo-bar commented on July 21, 2024

Interesting - I run pipewire and I have not the issue - but to be honest, I am not very familiar with pipewire. Yesterday I had a video conference and the sensors works well. I use Arch Linux - and if I am correct you as well (acorrding to your config template :-))

from ha-mqtt-iot.

esenliyim avatar esenliyim commented on July 21, 2024

More than a year later...

fuser and lsof remain to be not very good for detecting whether or not the camera is in active use. fuser just gives a list of PIDs and nothing else, which is quite useless, but lsof might be usable.

I've been observing the output from lsof and as @W-Floyd said, wireplumb and pipewire are always there no matter what the camera is doing. Even if it's sitting idle without recording, those two are there. But when I start using the camera actively, on the browser or inside the Zoom desktop app or whatever, they appear as new processes in the lsof output AND they look different. They always appear like this:

image

One process as two lines in the output, one with mem as the file descriptor. Firefox does the same. Discord does the same. Maybe that can be used to detect that the camera is currently being used to capture video. Though I don't know what those mean exactly, so it might not be as useful as I wish.

Also, for some reason, Cheese doesn't show up on lsof even when it's actively using the camera. That means there are ways around lsof too.

from ha-mqtt-iot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.