Webradio - High CPU usage by web browser

Raspberry Pi related support

Webradio - High CPU usage by web browser

Postby andfor » 16 Feb 2018, 11:55

HI,

I have just noticed a strange issue when running Rune UI through a web-browser. If I am listening to a radio station the web browser will sometimes show nearly 25% CPU utilization. This happens when the browser is open on the Playback page. For most stations, If I refresh the UI this drops to around 2%.

There are some stations that won't display the radio 'album art', just the place-holder Rune symbol. Refreshing the UI on these stations does nothing, CPU still 25%.

I am using Firefox. I am using a modified version of Rune 0.4b on an Rpi3. I have altered the UI files to my own liking, mostly cosmetic, but I did change the behaviour of selecting radio stations to a single-click 'Add, Replace and Play' (see: radio-stream-selection-t5746.html).

Any help tracking down the cause of this would be appreciated.

Many thanks.
User avatar
andfor
 
Posts: 57
Joined: 26 Jun 2017, 15:48
Location: Birmingham, UK

Re: Webradio - High CPU usage by web browser

Postby hondagx35 » 16 Feb 2018, 13:17

Hi andfor,

please open the developer console on your Firefox browser and check for errors.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Webradio - High CPU usage by web browser

Postby andfor » 18 Feb 2018, 13:41

***EDIT: I have edited this question to include more information.

Hi Frank,

I have had a look at the developer console and have some more information about how this error occurs. Here's the sequence:

1) Select webradio stream and this error warning occurs:

Empty string passed to getElementById().
jquery-2.1.0.min.1424619780.js:2:23965[/quote]

2) Navigate to 'Playback' screen. Again:

Empty string passed to getElementById().
jquery-2.1.0.min.1424619780.js:2:23965


3) I have noticed that high CPU usage occurs when the track progress wheel starts filling up as in the image below:

Image

4) BUT.... If I click anywhere on the blue progress wheel the CPU usage drops to nothing and i get the following error:


Image

4) If I select another radio station, CPU usage shoots back up again on navigating to the 'Playback' screen.

5) Reloading the webpage causes the CPU to return to normal and the progress wheel is now greyed out as below:

Image

...and I get this error:

Source map error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Resource URL: http://192.168.0.6/js/vendor/hammer.min.1518951835.js
Source Map URL: hammer.min.js.map


I hope that's enough information to reproduce the problem or at least to help me try and fix it on my installation.

Thanks for the help!
User avatar
andfor
 
Posts: 57
Joined: 26 Jun 2017, 15:48
Location: Birmingham, UK

Re: Webradio - High CPU usage by web browser

Postby andfor » 16 Mar 2018, 11:58

Hi,

I was just wondering if there was any opinion as to what is happening here? The problem seems to be with navigating to the Playback screen using the 'Playback' button along the bottom bar. This doesn't reload the page (like selecting 'Playback' from the dropdown menu does) so my best guess is that it's something to do with the progress wheel attempting to treat an infinite radio stream like a music file that has a finite length.

Anyway, I don't have the technical proficiency to follow the errors and debug this so any help or insight would be welcome.

Many thanks
User avatar
andfor
 
Posts: 57
Joined: 26 Jun 2017, 15:48
Location: Birmingham, UK

Re: Webradio - High CPU usage by web browser

Postby andfor » 29 Mar 2018, 09:06

No ideas?

I realise nobody wants to chase rabbits down holes on my behalf, but any pointers as to what might be happening would be appreciated. Where do I start? And does anyone else see the same behaviour? Is it present on a stock install? (I have modified mine).

It's not a huge deal because I can just reload the page every time I select a radio stream to bring down the CPU usage, but that is a bit annoying.

Thanks again.
User avatar
andfor
 
Posts: 57
Joined: 26 Jun 2017, 15:48
Location: Birmingham, UK

Re: Webradio - High CPU usage by web browser

Postby hondagx35 » 29 Mar 2018, 21:20

Hi andfor,

i can reproduce your issue.

I will take a look at it as soon as possible.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Webradio - High CPU usage by web browser

Postby andfor » 29 Mar 2018, 23:26

Thanks Frank. Good to know it's not just me.
User avatar
andfor
 
Posts: 57
Joined: 26 Jun 2017, 15:48
Location: Birmingham, UK

Re: Webradio - High CPU usage by web browser

Postby irishwill2008 » 30 Mar 2018, 12:33

I just had similar issue but pointing to: bootstrap-select.min

I fixed this by removing both
Code: Select all
//# sourceMappingURL=bootstrap-select.js.map
&&
Code: Select all
/*! etc code
which is the commented out code in the file. This fixed my issue.

Perhaps there is comments in the hammer file? My version of rune doesnt have a hammer file to check for you :(
irishwill2008
 
Posts: 157
Joined: 26 Jul 2016, 14:49
Location: Ireland

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 13 guests