about 4k video error in Cobalt browser - cobalt

Current status
-current status image
Desired result
-I wish the video was played without stopping.
During the 4k video test in Cobalt version (10.52708), the video stops after a certain amount of time and only the loading progress is returned.
Did I make the wrong porting?
Then why are these problems occurring?
I would be grateful if you could answer the question.
Thank you.

First of all, how often do you see this issue? Can you also test with Cobalt RC_9 branch? master is under very active development
In the mean time, I will analyze our server log for your playback from our server. By the way, when did you take the screenshot picture? I need the exact time and your time zone.

Can you give me the values of SB_MEDIA_SOURCE_BUFFER_STREAM_AUDIO_MEMORY_LIMIT and SB_MEDIA_SOURCE_BUFFER_STREAM_VIDEO_MEMORY_LIMIT in configuration_public.h? As Daniel suggested, upgrade to COBALT_9 may solve this issue.

Related

Why does PageSpeed Insights keeps returning a high TTI (Time to Interactive) for a simple game?

I submitted my app/game/PWA to PageSpeed Insights and it keeps giving me TTI values > 7000ms and TBT values > 2000ms, as it can be seen in the screenshot below (the overall score for a mobile experience is around 63):
I read what those values mean over and over, but I just cannot make them lower!
What is most annoying, is that when accessing the page in a real-life browser, I don't need to wait 7 seconds for the page to become interactive, even with a clear cache!!!
The game can be accessed here and its source is here.
What comforts me is that Google's own game, Doodle Cricket also scores terribly. In fact, PageSpeed Insights gives it an overall score of "?".
Summing up: is there a way to tell PageSpeed Insights the page is actually a game with only a simple canvas in it and that it is indeed interactive as soon as the first frame is rendered on the canvas (not 7 seconds later)?
UPDATE: Partial Solution
Thanks to #Graham Ritchie's answer, I was able to detect the two slowest points, simulating a mid-tier mobile phone:
Loading/Compiling WebAssembly files: there was not much I could do about this, and this alone consumes almost 1.5 seconds...
Loading the main script file, script.min.js: I split the file into two, since almost two thirds of this file are just string constants, and I started loading them asynchronously, both using async to load the main script and delay loading the other string constants, which has saved more than 1.2 seconds from the load time.
The improvements have also saved some time on better mobile devices/desktop devices.
The commit diff is here.
UPDATE 2: Improving the Tooling
For anyone who gets here from Google, two extra tips that I forgot to mention before...
Use the CLI Lighthouse tool rather than the website (both for localhost and for internet websites): npm install -g lighthouse, then call lighthouse --view http.... (or use any other arguments as necessary).
If running on a notebook, make sure it is not running on the battery, but actually connected to a power source 😅
Summing up: is there a way to tell PageSpeed Insights the page is actually a game with only a simple canvas in it and that it is indeed interactive as soon as the first frame is rendered on the canvas (not 7 seconds later)?
No and unfortunately I think you have missed one key piece of the puzzle as to why those numbers are so high.
Page Speed Insights uses throttling on the Network AND the CPU to simulate a mid-tier mobile phone on a 4G connection.
The CPU throttling is your issue.
If I run your game within the "performance" tab on Google Chrome Developer Tools with "4x slowdown" on the CPU I get a few long tasks, one of which takes 5.19s to run!
Your issue isn't page weight as the site is lightweight it is JavaScript execution time.
You would have to look through your code and see why you have a task that takes so long to run, look for nested loops as they are normally the issue!
There are several other tasks that take 1-2 seconds total between them but that 5 second task is the main culprit!
Hopefully that clears things up a bit, any questions just ask.

Program to identify if a file is not written

Firstly, I'm not a programmer so please excuse me if my question lacks technical accuracy.
Basically I have a situation where I have a camera recording a timelapse, taking a photograph at predetermined intervals (in this case 60 seconds) and then saving the image to a Dropbox folder.
I regularly monitor the Dropbox folder to ensure the images are being captured, but there have been situations where the camera has failed and I've not been aware for 24hours or so.
Ideally what I am looking for is a small program that can monitor the Dropbox folder and report back (perhaps by email) to say if an image capture has failed.
There are two parameters that I'd need to set; the interval (in this case every 60 seconds) and the period over which the camera is running (in this case 6am - 6pm).
I've managed to find several different programs that will monitor if a file is written to a folder, but not a program to determine if a file has NOT been written.
Just wanted to ask the community if this would be possible and whether anybody would be able to help?
Many thanks in advance for your advice.
Jamie
The only way to do this is to read the memory addresses and find if there is anything with the extension .temp. Other than that, you'd have to be on Linux.
Looping through memory, especially in this day and age with 32GB-64GB of RAM becoming commonplace, it is highly inefficient to do this.
Essentially, no, I don't believe there is any way to practically do this.

How to get native sample rate of audio driver (Windows)

I have a simple sample mixer, when profiling I noticed that ~40-50% of the time is being spent resampling (44.1 => 48kHz, they must do something more sophisticated than lerp).
This step is gone when I open the playback device (DSound in my case) in 48kHz mode.
Question is: is there a way to query audio driver's default (native) sample rate to avoid resampling?
I tried searching the web/docs but found nothing, I thought this might be a simple API call.
Thanks.
In case you are still curious, I had the same question and had trouble finding answers. Someone pointed me in the right direction, and I was able to get a working code example for getting playback properties (Win >= Vista). You can only do this in Windows higher than XP, but that is where resampling from 44.1 to 48 can sound bad (XP had better default resampling). How do you get the current sample rate of Windows audio playback?

Why is codeigniter $this->load->view rendering so slow?

I have been using codeigniter for quite sometimes and i really love it. But for some reason i am not sure why but rendering a view in 1 of my application takes 18-23 whole seconds. Well i really wonder why as such time is to be taken for rendering the output.
I am sure about this as i measured the time from it reaching the Index Page till the data collection / preparation from the system. All took not less then a second. Just this rendering of the view page screwed up - taking 19 / 23 random seconds.
I really want to understand why as so and will like to get a proper through solution to work around on the same.
As for now i am caching the output and storing it and playing around with it but i too know it is not so full proof solution. There must be a way to analyze as where and why the rendering takes so much time on the server. If anyone knows anything about the same, please please do update / share on the same.
Have you tried using XDebug? There are a lot of online resources for how to use it in profiling your PHP apps, such as this one by Eric Hogue.
But if you included some sample code of what is happening in your controller and view then perhaps we could offer some specific guidance in this instance.
Removing a call to $this->carabiner->empty_cache(); speeds up our views quite a bit.

Flex 4 > spark.components.VideoPlayer > How to switch bit rate?

The VideoPlayer (possibly VideoDisplay also) component is capable of somehow automatically picking the best quality video on the list it's given. An example is here:
http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/spark/components/mediaClasses/DynamicStreamingVideoItem.html#includeExamplesSummary
I cannot find the answers to below questions.
Assuming that the server that streams recorded videos is capable of switching across same videos with different bit rates and streaming them from any point within their timelines:
Is the bandwidth test/calculation within this component only done before the video starts playing, at which point it picks the best video source and never uses the other ones? Or, does it continuously or periodically execute its bandwidth tests and does it accordingly switch between video sources during the playback?
Does it support setting the video source through code and can its automatic switching between video sources be turned off (in case I want to provide this functionality to the user in the form of some button/dropdown or similar)? I know that the preferred video source can be set, but this only means that that video source will be tested/attempted first.
What other media servers can be used with this component, besides the one provided by Adobe, to achieve automated and manual switching between different quality of same video?
Obviously, I'd like to create a player that is smart enough to automatically switch between different quality of videos, and that will support manual instructions related to which source to play - both without interrupting the playback, or at least without restarting it (minor interruptions acceptable). Also, the playback needs to be able to start at any given point within the video, after enough data has been buffered (of course), but most importantly, I want to be able to start the playback beyond what's buffered. A note or two about fast-forwarding is not going to hurt, if anyone knows anything.
Thank you for your time.

Resources