Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post Reply
cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

Hi,

I have an HDMI to USB video capture device that emulates a webcam. I am able to see the HDMI feed from another device on the Odroid camera app. On the camera app, selecting the full HD resolution gives me a nice picture.

However when I load skype or duo or zoom, these apps pick up the first very basic 640 x 480 resolution from the video capture device giving me a terribly distorted image. Is there a way to change some setting in android to force these apps to use the 1280x720 resolution from the video capture device? Perhaps some way to intervene and disable the other resolutions enumerated by the capture device?

Thanks

Anil

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

Bump - any ideas here? Is there some configuration setting I can use to force apps to use a specific resolution available from the camera?

User avatar
odroid
Site Admin
Posts: 36385
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1431 times
Been thanked: 980 times
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by odroid »

We have no idea since Zoom/Due/Skype are not open-source.
BTW, what happens if you run those apps just after closing the stock camera app?

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

Does not seem to make a difference. I was asking more from the point of view of the android OS itself whether there is a way to configure it in the hardware abstraction layer or something.

User avatar
odroid
Site Admin
Posts: 36385
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1431 times
Been thanked: 980 times
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by odroid »

If you modify the UVC device driver source code in the kernel, you might be able to change the minimum resolution of USB webcam probably.
Or, you can try something like that in the camera HAL code.
But we have no experience of such modification.

User avatar
voodik
Posts: 1974
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: armenian, english, russian
Location: Armenia
Has thanked: 47 times
Been thanked: 308 times
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by voodik »

Do you want make some tests with Android 11?
I am added External camera native support to it.
It more configurable and also have a config for minimum resolution.
These users thanked the author voodik for the post:
cloud9ine (Wed Jan 06, 2021 7:57 pm)
Buy me a beer ;)
https://www.paypal.me/voodikjan
BTC: 377wXjEr3QsDDzRqfMco3a41wicrsv3Sfs
--------------------------------------------------------
dump logs
(dmesg; logcat -d; lsusb) | curl -F 'f:1=<-' ix.io
--------------------------------------------------------
ADB enhanced PuTTY :!:
https://github.com/voodik/puttyadb/releases

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

Oh wow. Sure I'm up to try. Do you mean I will get global setting for minimum resolution? Or in each app?

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

voodik wrote:
Tue Jan 05, 2021 1:36 pm
Do you want make some tests with Android 11?
I am added External camera native support to it.
It more configurable and also have a config for minimum resolution.
I installed your release of LineageOS 18.1 from here (viewtopic.php?f=178&t=40804) and tried skype. Still see the same issue. Could you please let me know where to modify the minimum camera resolution?

User avatar
voodik
Posts: 1974
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: armenian, english, russian
Location: Armenia
Has thanked: 47 times
Been thanked: 308 times
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by voodik »

cloud9ine wrote:
Wed Jan 06, 2021 7:55 pm
voodik wrote:
Tue Jan 05, 2021 1:36 pm
Do you want make some tests with Android 11?
I am added External camera native support to it.
It more configurable and also have a config for minimum resolution.
I installed your release of LineageOS 18.1 from here (viewtopic.php?f=178&t=40804) and tried skype. Still see the same issue. Could you please let me know where to modify the minimum camera resolution?

Its global setting which camera report, so all aps use this setting.
Btw.
I make some tests with Skype, yes by default Skype picks 640x480.
When I set minimum resolution e.g. 1280x720 (and clean cache for Skype app!) then Skype pick up this resolution but on other end image is Scaled (like zoom in).
Just tested Skype with normal phone, not rooted, no custom ROM with 20MP front sensor.

Code: Select all

Device 1 is open. Client instance dump:
    Client priority score: 0 state: 2
    Client PID: 17319
    Client package: com.skype.raider
Client2[1] (0xf61e5140) PID: 17319, dump:
  State: PREVIEW
  Current parameters:
    Preview size: 640 x 360
    Preview FPS range: 8 - 30
    Preview HAL pixel format: 0x11
    Preview transform: 5
    Picture size: 640 x 360
    Jpeg thumbnail size: 246 x 184
    Jpeg quality: 90, thumbnail quality: 90
its picking low res 640 x 360. So I think it skype limitation.
But of course Phone cameras have a better fps and quality.

So back to External camera native HAL, which I modified to make it more configurable in future.
In theory I can make any camera parameter configurable, but there was a lot of parameters and I don't know which one make sense.
So for now I just added additional config for camera facing(front/back). Later I will try make minimum resolution configurable for each cam device(for now it global for all cameras).
Also this HAL support higher resolutions and frame rates, which also configurable.
It good you already installed Los-18, this feature not released yet, I will prepare test build for you in 1 hour and post link here.
Buy me a beer ;)
https://www.paypal.me/voodikjan
BTC: 377wXjEr3QsDDzRqfMco3a41wicrsv3Sfs
--------------------------------------------------------
dump logs
(dmesg; logcat -d; lsusb) | curl -F 'f:1=<-' ix.io
--------------------------------------------------------
ADB enhanced PuTTY :!:
https://github.com/voodik/puttyadb/releases

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

Awesome, thank you so much! I'll definitely try your test build and let you know if it solves my issue!

User avatar
voodik
Posts: 1974
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: armenian, english, russian
Location: Armenia
Has thanked: 47 times
Been thanked: 308 times
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by voodik »

cloud9ine wrote:
Wed Jan 06, 2021 8:22 pm
Awesome, thank you so much! I'll definitely try your test build and let you know if it solves my issue!
https://drive.google.com/file/d/1nWUcwM ... sp=sharing

After update you can find config file in

Code: Select all

/odm/external_camera_config.xml
For view HAL logs you can use

Code: Select all

logcat | egrep 'CamPrvdr|ExtCam'
in case of troubles add your device id to ignore list then old legacy hal will be used for your camera

Code: Select all

        <ignore> <!-- Internal video devices to be ignored by external camera HAL -->
            <id>0</id>
             ............
            <id>sync</id>
        </ignore>
These users thanked the author voodik for the post:
odroid (Mon Jan 11, 2021 9:30 am)
Buy me a beer ;)
https://www.paypal.me/voodikjan
BTC: 377wXjEr3QsDDzRqfMco3a41wicrsv3Sfs
--------------------------------------------------------
dump logs
(dmesg; logcat -d; lsusb) | curl -F 'f:1=<-' ix.io
--------------------------------------------------------
ADB enhanced PuTTY :!:
https://github.com/voodik/puttyadb/releases

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

Thanks! About to give it a try now.

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

Hey, I forgot to follow up on this. This actually solved the issue in Google duo. Skype won't load a camera feed at all ever since I raised the camera minimum streaming resolution. And zoom gets stuck saying "connecting" when attempting to join a meeting but it was already doing that on the Lineage OS 18 and it 18.1 builds even before making this change.

I really appreciate you going out of your way to provide me a test build!

User avatar
voodik
Posts: 1974
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: armenian, english, russian
Location: Armenia
Has thanked: 47 times
Been thanked: 308 times
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by voodik »

cloud9ine wrote:
Mon Jan 11, 2021 3:34 am
Hey, I forgot to follow up on this. This actually solved the issue in Google duo. Skype won't load a camera feed at all ever since I raised the camera minimum streaming resolution. And zoom gets stuck saying "connecting" when attempting to join a meeting but it was already doing that on the Lineage OS 18 and it 18.1 builds even before making this change.

I really appreciate you going out of your way to provide me a test build!
It strange, because i make tests with, fb messenger, whatsup, telegram, skype, duo and zoom. All this programs working. Can you dump logcat? Just before dump incrase log buffer size to 16 mb from developer options.
Buy me a beer ;)
https://www.paypal.me/voodikjan
BTC: 377wXjEr3QsDDzRqfMco3a41wicrsv3Sfs
--------------------------------------------------------
dump logs
(dmesg; logcat -d; lsusb) | curl -F 'f:1=<-' ix.io
--------------------------------------------------------
ADB enhanced PuTTY :!:
https://github.com/voodik/puttyadb/releases

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

http://ix.io/2LGL

Not sure what was different this time but I was able to join the meeting but Zoom said failed to load camera

User avatar
voodik
Posts: 1974
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: armenian, english, russian
Location: Armenia
Has thanked: 47 times
Been thanked: 308 times
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by voodik »

cloud9ine wrote:
Tue Jan 12, 2021 5:24 am
http://ix.io/2LGL

Not sure what was different this time but I was able to join the meeting but Zoom said failed to load camera
Unfortunately ix.io trims log.
Can you dump log from terminal and upload e.g. to google drive?

Code: Select all

logcat -d -f /sdcard/log.log
Buy me a beer ;)
https://www.paypal.me/voodikjan
BTC: 377wXjEr3QsDDzRqfMco3a41wicrsv3Sfs
--------------------------------------------------------
dump logs
(dmesg; logcat -d; lsusb) | curl -F 'f:1=<-' ix.io
--------------------------------------------------------
ADB enhanced PuTTY :!:
https://github.com/voodik/puttyadb/releases

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »


cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »


User avatar
voodik
Posts: 1974
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: armenian, english, russian
Location: Armenia
Has thanked: 47 times
Been thanked: 308 times
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by voodik »

cloud9ine wrote:
Tue Jan 12, 2021 4:06 pm
https://drive.google.com/file/d/1lwlO8q ... sp=sharing

Google drive link.
No, it still not full log. 5 kb only.
Buy me a beer ;)
https://www.paypal.me/voodikjan
BTC: 377wXjEr3QsDDzRqfMco3a41wicrsv3Sfs
--------------------------------------------------------
dump logs
(dmesg; logcat -d; lsusb) | curl -F 'f:1=<-' ix.io
--------------------------------------------------------
ADB enhanced PuTTY :!:
https://github.com/voodik/puttyadb/releases

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

Yeah looks like that is all it is collecting when I run your command. I am running the command immediately after opening zoom.

If I just run logcat without arguments and try to redirect the output to a file, it just hangs.

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

Here you go. I was using a terminal emulator before and it was getting a sandbox I think.

https://drive.google.com/file/d/1B9dTCi ... sp=sharing

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

By the way, Zoom is not stuck connecting anymore. It is able to join the meeting. It is just unable to pull the camera feed (preview window is black and Zoom throws error "Failed to access camera")

User avatar
voodik
Posts: 1974
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: armenian, english, russian
Location: Armenia
Has thanked: 47 times
Been thanked: 308 times
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by voodik »

cloud9ine wrote:
Thu Jan 14, 2021 3:46 am
Here you go. I was using a terminal emulator before and it was getting a sandbox I think.

https://drive.google.com/file/d/1B9dTCi ... sp=sharing
Still nothing about zoom and camera process, so log not full.
You can setup adb access via USB, and you will get root shell.
Again check you increased log buffer size to 16 mb, make fresh reboot.
Open zoom try to join meeting and then dump logs.

Here is a ADB enhanced PuTTY, it better than windows cmd for shell access.
https://github.com/voodik/puttyadb/releases
putty1.jpg
putty1.jpg (142.31 KiB) Viewed 94 times
putty2.jpg
putty2.jpg (153.69 KiB) Viewed 94 times
Buy me a beer ;)
https://www.paypal.me/voodikjan
BTC: 377wXjEr3QsDDzRqfMco3a41wicrsv3Sfs
--------------------------------------------------------
dump logs
(dmesg; logcat -d; lsusb) | curl -F 'f:1=<-' ix.io
--------------------------------------------------------
ADB enhanced PuTTY :!:
https://github.com/voodik/puttyadb/releases

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

Hopefully this worked:

https://drive.google.com/file/d/1uU3ScN ... sp=sharing

This time, I was unable to join the meeting. I tried several times. Zoom was trying to access the camera for the preview window though and showing a black screen. So, hopefully you can get some clues about camera access from that.

User avatar
voodik
Posts: 1974
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: armenian, english, russian
Location: Armenia
Has thanked: 47 times
Been thanked: 308 times
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by voodik »

cloud9ine wrote:
Thu Jan 14, 2021 4:36 am
Hopefully this worked:

https://drive.google.com/file/d/1uU3ScN ... sp=sharing

This time, I was unable to join the meeting. I tried several times. Zoom was trying to access the camera for the preview window though and showing a black screen. So, hopefully you can get some clues about camera access from that.

Code: Select all

Camera2-Parameters: set: Requested preview size 640 x 480 is not supported
Apps have an some cached settings/parameters. If you change minimal resolution at least clean app cache. If this not help clean app data(or uninstall/install again).


My logs

Code: Select all

01-14 03:56:50.583  3103  3403 I CameraService: CameraService::connect call (PID -1 "us.zoom.videomeetings", camera ID 1) for HAL version default and Camera API version 1
01-14 03:56:50.584  3103  3403 I Camera2ClientBase: Camera 1: Opened. Client: us.zoom.videomeetings (PID 7301, UID 10170)
.....
01-14 03:56:50.595  3055  7391 I ExtCamDevSsn@3.4: configureStreams: request stream 1280x720
01-14 03:56:50.623  3055  7391 I ExtCamDevSsn@3.4: configureV4l2StreamLocked: V4L2 buffer size is 1843789
01-14 03:56:51.833  3055  7391 I ExtCamDevSsn@3.4: configureV4l2StreamLocked: start V4L2 streaming 1280x720@30.000000fps
Buy me a beer ;)
https://www.paypal.me/voodikjan
BTC: 377wXjEr3QsDDzRqfMco3a41wicrsv3Sfs
--------------------------------------------------------
dump logs
(dmesg; logcat -d; lsusb) | curl -F 'f:1=<-' ix.io
--------------------------------------------------------
ADB enhanced PuTTY :!:
https://github.com/voodik/puttyadb/releases

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

Thanks a lot! Clearing cache helps zoom and Skype pick up the camera now. But zoom still seems to be unable to join the meeting. Any hints about that in the log?

Skype is cutting off the video feed like you mentioned. So I'll focus on Zoom and Duo.

cloud9ine
Posts: 17
Joined: Thu Dec 31, 2020 10:31 am
languages_spoken: english
ODROIDs: Odroid N2 plus
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Force Zoom / Duo / Skype to use specific resolution of USB webcam

Post by cloud9ine »

Looks like I am able to join the zoom meeting if I start the meeting from my PC instead of from my phone - thanks again for your help!

Post Reply

Return to “Android”

Who is online

Users browsing this forum: No registered users and 0 guests