chrome stopped detecting Rasberry pi camera

Asked by Saurabh on 2021-03-27

Hello ,

I have installed Ubuntu Desktop 20.10 in Rasberry Pi 4 . I even installed Chromium browser . Initially Chromium browser use to detect the Raspberry pi official DSI camera and I did some zoom call in browser using that . However 3 weeks back it stopped detecting and the problem persists till now . Interestingly Firefox browser is able to detect the camera . I am suspecting after updates it would have cause the problem and I didn't noticed that .

I have tried most of option suggested in different forum but no luck . Any clue or help is greatly appreciated .

Thanks in advance.

With Regards,
Saurabh

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2021-03-31
Last reply:
2021-03-31

How did you install the browser? If you used a snap then it may need to grant the application access to the webcam. Have you checked the permissions in the browser to allow it to use the webcam?

Saurabh (saurabh81) said : #2

Hi actionparsnip ,

Thanks for your response . Yes I did it via snap and have checked both . In SNAP under the chromium app permission the Camera permission is given .In Chromium browser settings I have enabled the camera and for the online website I am using for testing I gave the Camera permission under site settings . Infact these were initial trouble shooting steps I did .

Still it doesnt works :(.

With regards,
Saurabh

Saurabh (saurabh81) said : #3

Hello Experts,

Any pointers here !!. Any place to check the logs as why the camera is not getting detected in chromium browser ?

Also can anyone confirm if the they are able to access Raspberry pi camera using chromium browser with Ubuntu Desktop 20.10 installed in Rasberry Pi 4 . That would at least indicate I am missing something and it is supported .

Thanks in advance.

With Regards,
Saurabh Kumar Pandey

Saurabh (saurabh81) said : #4

Hi All ,

I was searching for logs and came up with this kernel logs that are pointing to chromium . Not sure why the access are denied even though I have given all permission in SNAP .

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Mar 31 20:30:05 satwik-desktop kernel: [ 892.049527] kauditd_printk_skb: 514 callbacks suppressed
Mar 31 20:30:05 satwik-desktop kernel: [ 892.049534] audit: type=1400 audit(1617202805.962:592): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/run/udev/data/+sdio:mmc1:0001:3" pid=3224 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Mar 31 20:30:05 satwik-desktop kernel: [ 892.052893] audit: type=1400 audit(1617202805.966:593): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/run/udev/data/+sdio:mmc1:0001:1" pid=3224 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Mar 31 20:30:05 satwik-desktop kernel: [ 892.054950] audit: type=1400 audit(1617202805.970:594): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/run/udev/data/+sdio:mmc1:0001:2" pid=3224 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Mar 31 20:30:05 satwik-desktop kernel: [ 892.067824] audit: type=1400 audit(1617202805.982:595): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/run/udev/data/c510:0" pid=3224 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Mar 31 20:30:06 satwik-desktop kernel: [ 892.106988] audit: type=1400 audit(1617202806.022:596): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/run/udev/data/c153:1" pid=3224 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Mar 31 20:30:06 satwik-desktop kernel: [ 892.109031] audit: type=1400 audit(1617202806.022:597): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/run/udev/data/c153:0" pid=3224 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Mar 31 20:30:06 satwik-desktop kernel: [ 892.121759] audit: type=1400 audit(1617202806.038:598): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/run/udev/data/c509:0" pid=3224 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Mar 31 20:30:06 satwik-desktop kernel: [ 892.171198] audit: type=1400 audit(1617202806.086:599): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/run/udev/data/c3:93" pid=3224 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Mar 31 20:30:06 satwik-desktop kernel: [ 892.171701] audit: type=1400 audit(1617202806.086:600): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/run/udev/data/c3:246" pid=3224 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Mar 31 20:30:06 satwik-desktop kernel: [ 892.172119] audit: type=1400 audit(1617202806.086:601): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/run/udev/data/c2:116" pid=3224 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Manfred Hampl (m-hampl) said : #5

It seems that apparmor denies access to the camera. You have to check the apparmor profiles and either disable apparmor or create/modify a profile for chromium that allows accessing the camera.

Saurabh (saurabh81) said : #6

Hi Manfred Hampl,

Thanks . I will check it today and get back if it works .

With Regards,
Saurabh Kumar Pandey

Saurabh (saurabh81) said : #7

Hi Manfred Hampl,

To pinpoint that issue is only because of apparmor denial I wanted to disable apparmor first . I tried the option suggested in https://ubuntu.com/server/docs/security-apparmor and used the command below but was not successful.

1. Tried the commands
sudo systemctl stop apparmor.service
sudo systemctl disable apparmor.service

Checked by testing camera in chrome . Same problem and I see the denial log again . Restarted PI and tested but still the same problem .

2. Tried moving all the profiles from enforce to complain mode .

sudo aa-complain /etc/apparmor.d/*

Most of the profiles moved except snap.chromium.chromium . Retesed and no luck .

As my requirement to have pi camera in chrome was time pressing I found another option to load chrome from debian repository without snap and it worked . And the camera also works .(Double confirms that it is Ubuntu Snap issue). Copying below the

https://askubuntu.com/questions/1204571/how-to-install-chromium-without-snap

So the root problem still remains unsolved . But atleast have a workaround . Thanks to all for the support .

With Regards,
Saurabh Kumar Pandey

Can you help with this problem?

Provide an answer of your own, or ask Saurabh for more information if necessary.

To post a message you must log in.