anbox stream sdk js screen option not working

Bug #1983740 reported by Terence
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Anbox Cloud
Fix Released
Undecided
Gary.Wang

Bug Description

I'm using 1.14.2 with anbox-stream-sdk.js 1.14.1

 * @param options.screen {object} Display settings for the Android instance to create
     * @param [options.screen.width=1280] {number} Screen width in pixel
     * @param [options.screen.height=720] {number} Screen height in pixel
     * @param [options.screen.fps=60] {number} Desired number of frames per second
     * @param [options.screen.density=240] {number} Pixel density

Trying to create an instance using the screen options example (1280*520) is not working also is there anyway we can resize the screen accordingly?

https://raw.githubusercontent.com/anbox-cloud/anbox-streaming-sdk/master/examples/js/example.html
https://raw.githubusercontent.com/anbox-cloud/anbox-streaming-sdk/master/js/anbox-stream-sdk.js

Revision history for this message
Simon Fels (morphis) wrote :

Hey Terence,

Can you tell us more about what is not working?
Is it that the screen doesn't show any video or is the resolution not applied?
Are you trying to join an existing streaming session?

> is not working also is there anyway we can resize the screen accordingly?

You cannot change the screen resolution of an already started Android instance currently.

Changed in anbox-cloud:
status: New → Incomplete
assignee: nobody → Simon Fels (morphis)
Revision history for this message
Terence (terencetwork) wrote :

1) We tried to change the width , height settings and added density (DPI to 480), it does not seems to have any different when we tweak the value, downloaded displayinfo (app) to check the DPI and it still showing

720x1280 (240dpi)

(Should be 1280*720 instead of 720*1280)

2) We are trying to create a new application

3) Yes, i understand that we can't change the resolution once the instance is created

4) I'm running anbox 1.14.2 with anbox-stream-sdk.js 1.14.1 and g5g.2xlarge

    let stream = new AnboxStream({
        connector: connector,
        targetElement: "anbox-stream",
        screen: {
            width: 720,
            height: 1280,
            fps: 60,
            density: 480,
        },
        controls: {
            keyboard: true
        },
        callbacks: {
            error: error => {
                window.alert("AnboxStream failed: " + error.message);
            },
            requestCameraAccess: () => {
                return window.confirm("Anbox Cloud requires to access the camera device")
            }
        }
    });

Revision history for this message
Simon Fels (morphis) wrote :

Thanks!

Can you also share the output of the bug-report command from within a container? E.g. you can run

$ amc exec <container id> -- /usr/bin/bug-report

Revision history for this message
Terence (terencetwork) wrote :

There's no output...

Revision history for this message
Simon Fels (morphis) wrote :

What do you mean by that?

Is the container still running or stopped? Did the shell command return a non-zero exit code?

Revision history for this message
Terence (terencetwork) wrote :

ubuntu@ip-192-168-3-249:~/anbox-streaming-sdk/examples/js$ amc list
+----------------------+---------------+---------+---------+------------------------------+------+---------------+-----------------------------+
| ID | APPLICATION | TYPE | STATUS | TAGS | NODE | ADDRESS | ENDPOINTS |
+----------------------+---------------+---------+---------+------------------------------+------+---------------+-----------------------------+
| cbove5kldf6s3mu82ua0 | android11 | regular | running | session=cbove5m3j8db0gr79n3g | lxd0 | 192.168.100.3 | adb:192.168.100.3:5559/tcp |
| | | | | | | | adb:192.168.3.249:10001/tcp |
+----------------------+---------------+---------+---------+------------------------------+------+---------------+-----------------------------+
ubuntu@ip-192-168-3-249:~/anbox-streaming-sdk/examples/js$ amc exec cbove5kldf6s3mu82ua0 -- /usr/bin/bug-report
ubuntu@ip-192-168-3-249:~/anbox-streaming-sdk/examples/js$

No Output

Revision history for this message
Terence (terencetwork) wrote :

I read the code for /usr/bin/bug-report

It's output will be in a .log file, i've capture the log and uploaded here

Revision history for this message
Simon Fels (morphis) wrote :

Thanks! I forgot that the tool produces a file instead of dumping to stdout.

Checking the log Anbox is configured with 1280x720@60

Aug 10 02:52:43 ams-cbphqlcldf6g28hdijjg anbox-starter[144]: I0810 02:52:43.275903 228 platform.cpp:151] Using display configuration: 1280x720@60

So looks like the problem is further up in the chain.

Can you confirm that from within the dashboard you can create a streaming session in both landscape and portrait and it works correct (both simply flip width/height)?

Revision history for this message
Terence (terencetwork) wrote :

Yes dashboard work perfectly

However while using the sdk js it does not, would it it be possible to provide a full sample code of dashboard example in the GitHub ?

Revision history for this message
Simon Fels (morphis) wrote :

Yes, we have an example which demonstrates how to use the SDK. Have a look at https://github.com/anbox-cloud/anbox-streaming-sdk/tree/master/examples/js

You may want to add the following to make the video element fit correctly for your purposes:

- <div id="anbox-stream"></div>
+ <div id="anbox-stream" style="width: 50vw; height: 50vh;"></div>

Revision history for this message
Terence (terencetwork) wrote :

I've found the issue,

Screen should be part of AnboxStreamGatewayConnector settings not AnboxStream settings

Line 35 to 39 should be moved to line 23 - 27

https://github.com/anbox-cloud/anbox-streaming-sdk/blob/master/examples/js/example.html

The document has to be updated too
https://anbox-cloud.io/docs/howto/stream/web-client

Revision history for this message
Gary.Wang (gary-wzl77) wrote :

Thanks for the report.
You're right the key `Screen` should be part of AnboxStreamGatewayConnector settings rather than AnboxStream settings.
And the bug is only partially fixed in our examples
(E.g. enhanced_webview_streaming
https://github.com/anbox-cloud/anbox-streaming-sdk/blob/master/examples/android/enhanced_webview_streaming/app/src/main/assets/index.html)

but not for
- webview_streaming
- web app
- documentation

I created an internal ticket track for this which is going to be fixed in the upcoming 1.15.0 release.

Thanks.

BR
Gary

Changed in anbox-cloud:
assignee: Simon Fels (morphis) → Gary.Wang (gary-wzl77)
status: Incomplete → Confirmed
milestone: none → 1.15.0
Gary.Wang (gary-wzl77)
Changed in anbox-cloud:
status: Confirmed → Fix Committed
Simon Fels (morphis)
Changed in anbox-cloud:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.