Electron playing hide and seek!?


#1

Gents. And Ladies. I’m having an exasperating problem with my electron browser

It is used on an Amazon AWS Windows Server 2012 R2 instance to stream download a broadcast. Also on the AWS box is a C# tool I wrote that essentially: starts electron and passes a URL, starts ffmpeg which records the screen using a screen/audio capture dshow filter, then uploads the resulting mp4 and shuts down the AWS instance. We have rights to record the broadcast, don’t worry

Because the broadcast happens inside of a custom flash app we wrote together with some other widgets on the page that only work in Chrome/Electron, I cannot switch to another browser to “solve” my problem:

The problem is simply, 50% of the time (i.e. every other time a broadcast is recorded), the electron browser DOES launch (because we hear the broadcast audio OK in the recording) but it doesn’t draw itself on the screen - the recording is of a blank desktop (bearing only the tool that starts ffmpeg/electron shows a nice countdown timer)

The server instance has no lock screen, auto logout, or screensaver. It does have a power management setting that turns the monitor off after 15 minutes which may be relevant

Even more curious, if I connect VNCviewer to the VNCserver (the tool runs in a logged-on context) that the AWS instance is running then at the moment that VNC connects and I start seeing the remote desktop, the browser suddenly appears onscreen, drawing itself as if nothing was wrong. It pops up in the recording at that point and is recorded successfully

I have no explanation for the inconsistency of the 50% thing - literally if I start camera#1 now, it’ll record a blank desktop. And if I start it again in an hour, it will record just fine, the browser will show etc. If i start it in 2 hours, i’ll get another blank desktop. And so it continues, flip flopping like that. Sometimes electron shows, sometimes it doesnt

Remember that this server is a virtual one, with virtual hardware and in an ideal world, would never be connected to or looked at from one recording to the next - it would simply boot up windows, launch the tool ,the tool launches electron and ffmpeg, The broadcast is recorded and the tool shuts the machine down ready to go again in a few hours time

Can anyone think of anything in the electron code that would make it decide not to draw itself on screen even when it’s running? (Unless someone goes any looks at it with VNC)

For the record, IE and firefox don’t behave like this - they show up reliably, as does the main window to the C# tool that controls it all. It’s purely Chrome/Electron that seem to be choosy about whether they draw themselves or not (and they play audio regardless- recorded audio is always OK)


#2

So you have this problem in both Chrome and Electron? If so, I would think that it is an underlying Chromium bug and not something in Electron’s control?


#3

Tis true, it first appeared she we used chrome so we tied swapping browsers out, one of the lads turned up electron and for starters it looked like electron was going to work out… Then when it was put into production it started behaving exactly like chrome

The thing that really puzzled me, I was under he impression that chrome and electron are two different executable wrappers round the same rendering engine. I conceived that electron is a relatively hollow exe around the viewport that shows blink/chromium and I wasn’t expecting it to be the case that the whole window is invisible… If I’d been able to see the outline of the window, just with no web rendering in the page viewport that would have made sense… I’m just totally nonplussed as to why he exe doesn’t draw, when the other exe does

I’ve started experimenting disabling the power plan setting for turning the monitor off after X minutes to see if this helps. I did also have a wondering whether its windows itself that doesn’t draw certain types of window if it be,I eves there is no point(no one looking)


#4

Is there a chromium mailing list or community that I could pose the q to?


#5

This is where I would start:

https://code.google.com/p/chromium/issues/list

Sorry I couldn’t be more help :frowning:


#6

Complete shot in the dark here, but try setting your browser window position to a fixed x and y. My reasoning goes back to when I studied graphics in C++. Sometimes with remote connections, the program wouldn’t be able to find the edges of the monitor quite right. So perhaps electron is trying to center itself on a monitor it cant find the size of.