Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Smart Screen SDK performance is too slow at X86 machine #9

Closed
6 tasks
yuan0258 opened this issue Dec 5, 2019 · 12 comments
Closed
6 tasks

Smart Screen SDK performance is too slow at X86 machine #9

yuan0258 opened this issue Dec 5, 2019 · 12 comments

Comments

@yuan0258
Copy link

yuan0258 commented Dec 5, 2019

IMPORTANT: Before you create an issue, please take a look at our Issue Reporting Guide.

Briefly summarize your issue:

I follow this instruction to build x86 ubuntu vesion smart screen sdk 2.0.1.
I try to use firefox(69.0.2 (64-bit))/chromium-browser(78.0.3904.108).
The performance is too slow(It need to take more than 5-10 sec to show UI)
Sometime it couldn't show weather display card.
Here is my log about running smart screen sdk as below
sampleapp_ss.log
The video is as below
https://vimeo.com/user105924617/review/377537751/25ee87777e

What is the expected behavior?

It should show up UI like this demo(< 3 sec)
https://www.youtube.com/watch?v=84x8I6XVF4I

What behavior are you observing?

The performance is too slow(It need to take more than 5-10 sec to show UI. Sometime it will delay to show UI until next command running)

Provide the steps to reproduce the issue, if applicable:

1.Run browser with
2.Run smart screen sdk
./modules/Alexa/SampleApp/src/SampleApp -C ~/sdk-folder/sdk-build/Integration/AlexaClientSDKConfig.json -C ~/sdk-folder/alexa-smart-screen-sdk/modules/GUI/config/guiConfigSamples/GuiConfigSample_TvOverlayLandscape.json -L DEBUG0 2>&1 | tee sampleapp_ss.log
3.Push a & say what's weather in Taipei.
4.Push a & say play music from tune-in

Tell us about your environment:

What version of the AVS Device SDK are you using?

  <1.15.0>

Tell us what hardware you're using:

  • [*] Desktop / Laptop
  • Raspberry Pi
  • Other - tell us more:

Tell us about your OS (Type & version):

  • [*] Linux
  • MacOS
  • Raspbian Stretch
  • Raspbian Jessy
  • Other - tell us more:
@eeduwj
Copy link

eeduwj commented Dec 6, 2019

Your Vimeo video seems not to be accessible.

I've the sample app running on Ubuntu as well (Ubuntu 18.04.3 and Google Chrome 78) and the Taipei weather shows up in less than 2.5 seconds. I started my stopwatch when the Alexa sample app console output was done with "THINKING" and started "SPEAKING" and stopped the watch when the GUI appeared in the browser.

Launching "tune-in" took around 5 seconds but that seems to include figuring out what the play. The GUI appears on the screen around 2 seconds after the audio starts playing.

My platform is an old industry PC (Hystou PC, Intel i5-3317U, 1.7 GHz x 2) which scores 18181 in the Codeload part of the Octane 2.0 benchmark (https://chromium.github.io/octane/). My work laptop scores around 30000.

It might be slower for you because you build the JetPack javascipt bundle in "development" mode and not in "production". In order to change that go to "modules/GUI/js/webpack.config.js" and after the "module.exports" line you need to change "mode: 'development'", into “mode: 'production” and remove the "devtool: 'inline-source-map'" line. That reduces the bundle.js file size.

@yuan0258
Copy link
Author

yuan0258 commented Dec 7, 2019

I upload video to YouTube link
https://youtu.be/tQUjKxg2KyE

@eeduwj
Copy link

eeduwj commented Dec 7, 2019

I see, yes that's very slow.
Could it be a slow Internet connection (low average bandwidth and/or high latency)?
It took around 18 seconds until the music started playing. That might be since it took a lot of time to buffer enough data to start playing. I tried it on my computer and the music started in less than 4 seconds. If the audio is already so slow then the visual parts would likely be slow as well.

@yuan0258
Copy link
Author

yuan0258 commented Dec 9, 2019

@eeduwj,
My PC platform is Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz x 4 which scores is 33680.
I already try to build JetPack with those config. It seems it could shrink main.bundle.js size from 4.3M to 668K. But the behavior is same with old one.
module.exports = {
mode: 'production',
//mode: 'development',
//devtool: 'inline-source-map',
context: SRC,
entry: {
'main': './main.tsx'
},

@yuan0258
Copy link
Author

yuan0258 commented Dec 9, 2019

@eeduwj ,
For ask weather case. The alexa cloud already replay audio but I doesn't see UI comes up immediately.
How could I know about when smart screen sdk get webpage from cloud?

@eeduwj
Copy link

eeduwj commented Dec 9, 2019

Your PC is fast enough unless some other process is taking up too many resources. I recommend starting "System Monitor" and monitoring the CPU history.

668KB for main.bundle.js is good as well.

Finding out when the Smart Screen SDK gets the visual elements for the webpage from the Amazon cloud can be done with Wireshark. But the HTTPS2 connection is encrypted. You can edit the file ".bash_profile" and add "export SSLKEYLOGFILE=~/.ssl-key.log" and then point Wireshark to this file. Then you can see (with times) the decrypted HTTP2 data transfer between the Smart Screen SDK and the Amazon cloud. That should tell you if the data is slow to arrive at your PC or if the delay is on your PC.

@yuan0258
Copy link
Author

I use those command to capture http2 connection
FILE_URL="file://$(pwd)//modules/GUI/index.html"
chromium-browser --ssl-key-log-file=./ssl-key.log "$FILE_URL" &

./modules/Alexa/SampleApp/src/SampleApp -C ~/sdk-folder/sdk-build/Integration/AlexaClientSDKConfig.json -C ~/sdk-folder/alexa-smart-screen-sdk/modules/GUI/config/guiConfigSamples/GuiConfigSample_TvOverlayLandscape.json -L DEBUG0 2>&1 | tee sampleapp_ss.log

Here is my wireshark packet.
eth0_localhost_wireshark.tar.gz

I only ask what's weather in Taipei
It seem the packet is normal get from alexa cloud. But it couldn't render in the meantime(See localhost_wireshark.pcapng)

@eeduwj
Copy link

eeduwj commented Dec 11, 2019

I had a look at your network capture file (eth0.pcapng). Unfortunately I can't see when the images for the weather are being received from the network. I can't see the decrypted, uncompressed data. But I can see at least the TLS data.
The interaction seems to start at around 3 seconds and there is a chunk of data of around 112 KB arriving between 10.73 sec and 11.49 sec and another chunk of data of around 199 KB between 17.10 sec - 17.6. If the latter data is for the visuals of the Taipei weather it would explain why the weather is displayed so late. My guess is a slow or otherwise problematic (Firewall, proxy, router) Internet connection.

@yuan0258
Copy link
Author

Our network is using Symmetric NAT.
Does it will impact speed of smart screen sdk to get content from internet?

@lynx-arul
Copy link
Contributor

Could you please enable Kayak skill or one of the other 3P skill that have APL enabled and try to run it through our SmartScreen SDK.
Please let us know the latency of that.

Also please provide us the logs while running the SmartScreen SDK in DEBUG 9 mode for the previous utterance ("What is the weather")
(ie. ./SampleApp -C ScreenConfig.json -C SmartScreenSDKConfig.json -L DEBUG9)

@yuan0258
Copy link
Author

yuan0258 commented Jan 7, 2020

@lynx-arul
I found it's network problem.
When I use cell phone 4G network to share to my PC.
The performance is good.
Maybe there is some network firewall will block this.
Those log is I capture by different network setting.
It seems download APL document take about 6 sec in ethernet
sampleapp_ss_DEBUG9_Fail_by_ethernet.zip
sampleapp_ss_DEBUG9_OK_BY_4G.zip

@lynx-arul
Copy link
Contributor

Great thanks a lot for letting us know.
I'll go ahead and close this ticket.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants