Enabling, disabling the Library

Clearing the cache is the “magic number” :smiley: :smiley:

  • it fixed the multiline problem on firefox
  • it fixed the layout problem I had in Firefox on my desktop. :smiley: :smiley:
  • and songs are now sorted correctly

I would suggest adding a recommendation to clear the browser caches when upgrading to the upcoming Volumio version with a great Library tab :smiley: .

Is there any type of debugging/logging information I can provide related to the problem with large libraries?

About the sorting. I have seen some strange behaviours when removing mounts, that might be cache related. I’ll remember to clear the cache next time and see what happens.

I absolutely agree on keeping the settings and layouts as simple as possible - that adds a sort of beauty to the project. If we see that there are several items that people probably want to be able to configure adding a new panel for example via an “Advanced” button nest to the on/off switch might be a good idea.

I have read that compilation is not an official tag, but I find it rather convenient. But as you say people organize (or don’t) their music very differently. I can partly fix my problem by moving the artist name into the title tag. Thne I can’t search on artists in compilations but I’ll get single albums.
I’m sure you will select a good solution. It will never be possible to satisfy everyone’s needs.

Maybe the rest of the community has something to add?? I can’t be the only who has tested the new improved features?

/Palle

Guide (starting with a brand new installed volumio) for people like me (Noobs^^)

with help of these guides:

1. Installing git
sudo apt-get update
sudo apt-get install git
mv /var/www /var/www-orig
mkdir /var/www

2.1 Creating a SSH Key (if you have one move to 3.)
ls -al ~/.ssh
if you see something like id_rsa.pub or id_dsa.pub go to 2.3
2.2
ssh-keygen -t rsa -C “your_email@here.com
enter a passphrase
ssh-agent -s
ssh-add ~/.ssh/id_rsa (if this goes wrong: ssh-agent -s)
2.3
go to github.com/settings/admin
click SSH Keys on the left side
add a key
Name: Volumio
Key: all text in ~/.ssh/id_rsa.pub (open with: nano ~/.ssh/id_rsa.pub)

3. Getting the New UI
git clone git@github.com:jotak/Volumio-UI.git /var/www
cd /var/www
git checkout -b act_library

4. “Installing” it
cd /var/www/updates (if this goes wrong do: git reset --hard origin/act_library)
./update.py

Restart Volumio, clear the browser cache and try the Library :wink:

At your own risk


everything works fine (it only took me some time), i can enable and disable the library, delete the current playlist (this is new, isn´t it?) and play music :smiley:

my suggestions:

  • bigger play and add to playlist buttons (maybe only wider)
  • center the play and the add to playlist icons on the buttons

bugs:

  • after pressing the clear queue, it jump for half a second to the playback and then back to the playlist (is this a bug?)
  • i have a lot of (Unknown, Unknown) songs, i guess you read the ID tags of the files? maybe you can use the file names if the tags are missing or empty

@Palle
Waaw, that’s great news!

If you have firebug installed or any similar javascript console tool, you can tell me if you get javascript errors when loading the page.
And for the server side, you can check on your pi the content of /var/log/nginx/error.log (not sure about the path, I cannot check it right now, but I think it is)

@joda
Thanks for the recap!
Actually, clearing the current playlist is a new feature by michelangelo, I didn’t do it.
I’ll try your layout suggestions.
I’m surprised you see “Unknown, Unknown” songs because it should already display the filename when tag information is not found… unless if your songs are actually tagged with artist=“Unknown” and album=“Unknown”

Thrilled by the progress! Just came back home, cloning your repo as of now, I’ll post my feedback soon. And I encourage all the members of the community to do the same. Everyone can make Volumio (and his listening experience) better by submitting their thoughts and suggestions.

Excellent work! The new version is so much better than previous version! Clever!

These are my findings and suggestions:

  • Performance is so much better, library loads instantaneously and I don’t have any error in console (chrome). Clever solution with lazy-loading!
  • In place of play and add, I would use the same system of file browsing (add, add and play, add replace and play). So we can mantain consistance beyond the system and save precious space (1 button instead of 2).
  • Instead of adding a new tab (better to have less tabs in small screens), I would add a voice in the browse section.
    I am now thinking of using files to show music per file (USB, NAS…) into one category. Library could be another category, and then WebRadio and the upcoming spotify integration as other categories . This way we’ll have better erghonomics and everything in one place. The user will be able to browse its music by file name or with the library tab.
  • I would elimitate scroll bars, as they steal precious space and they are not used so much
  • On smaller screens, I will eliminate browse by album.

Joel, amazing work! Really impressed by the speed of your solution and the look of it!

Now I am a bit out of my league but …
I installed Firebug and “started” it. Selected tab Console. I guessed it is the loadlib activity I need to track.
It never failed and I get no errors in the error -tab (or debug, information, …).
While adding another mount I checked the Loads times (200 OK xx.xxs) a couple of times (clearing browser cache in between) and got
14.18, 39.58, 22.43, 28,42 seconds. Then I added the last mount (pushing over the limit) and with no songs displayed I get 200 OK 38.02.
No errors shown. F5 and I get 32,67s.

Tail of /var/log/nginx/error.log is

2014/09/15 07:54:03 [error] 2524#0: *1422 FastCGI sent in stderr: "PHP message: >>>>> cfgdb_read(cfg_engine,dbh,sessionid,) >>>>> SELECT value from cfg_engine WHERE param="sessionid" PHP message: >>>>> cfgdb_read(cfg_engine,dbh,,) >>>>> SELECT * from cfg_engine" while reading response header from upstream, client: 192.MyClientIP, server: , request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.MyVolumioIP" 2014/09/15 07:54:04 [error] 2524#0: *1422 FastCGI sent in stderr: "PHP message: >>>>> cfgdb_read(cfg_engine,dbh,sessionid,) >>>>> SELECT value from cfg_engine WHERE param="sessionid" PHP message: >>>>> cfgdb_read(cfg_engine,dbh,,) >>>>> SELECT * from cfg_engine" while reading response header from upstream, client: 192.MyClientIP, server: , request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.MyVolumioIP" 2014/09/15 07:54:05 [error] 2524#0: *1422 FastCGI sent in stderr: "PHP message: >>>>> cfgdb_read(cfg_engine,dbh,sessionid,) >>>>> SELECT value from cfg_engine WHERE param="sessionid" PHP message: >>>>> cfgdb_read(cfg_engine,dbh,,) >>>>> SELECT * from cfg_engine" while reading response header from upstream, client: 192.MyClientIP, server: , request: "GET /_player_engine.php?state=&_=1410764034966 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.MyVolumioIP", referrer: "http://192.MyVolumioIP/index.php"

I get these 3 error entries every time I reload the Library tab (and there is a lot of them in the log file).

/Palle

Those PHP logs don’t look like errors, and I’ve just checked, I have the same, so it’s not the problem. Probably there’s something logged on the standard error wherea it’s not error, I’ll look for that.

Back the the firebug console, can you tell me what you see when you write on console “library.fullData” ? Nothing?

And, when you press F5, still on console, next to url ‘http://192.168.0.XXX/db/?cmd=loadlib’ , can you confirm you get “200 OK” ?
When you click on the link, there’s a “response” tab => it should contain json data of your songs, is it empty? If you find anything that looks like an error in those tabs, you can post-it here

If I enter “library.fullData” at the bottom I get “null”.

I do get 200 OK when refreshing but when clicking on the loadlib-link there is no repsonse tab. I only see Params, Headers, Post. HTML and Cookies.
If I open the Browse and click on the filepath-link I get a response tab with the appropriate directory listing.

I removed one of the mounts and then there is a response tab but with [ ] ( two hard brackets) in the response tab and no songs shown.
Note. I have always had problems when deleting a mount - it seems like I have to remove all of the mounts to get even Browse to work.Mpd - database issue??
I need to remove all mounts and then add them again to get a good response (note also the Brows tab showed no songs after removing a mount.

After I re-add one mount I get a good result in the Respond tab and songs are listed.
Adding second mount and everything seems to update good. library.fullData gives a list of Objects { Guitar= …}.

If I click on the loadlib link and then do an update (F5) I first see Request Headers and then a Response Headers and Response tab shows and songs are displayed.

Now adding the third mount, clicking on Library and then loadlib-link I get first Request Headers and after a while the Response Headers, but no response tab and no songs listed

ParamsHeadersPostHTMLKakor visa källkod Connection keep-alive Content-Type text/html Date Tue, 16 Sep 2014 19:40:52 GMT Server nginx/1.2.1 Transfer-Encoding chunked X-Powered-By PHP/5.4.4-14+deb7u7 visa källkod Accept application/json, text/javascript, */*; q=0.01 Accept-Encoding gzip, deflate Accept-Language sv-se,en-us;q=0.7,en;q=0.3 Cookie PHPSESSID=a7r7f0vk7pkeb67lqs5v8ao216 DNT 1 Host MyVolumioIPq Referer http://MyVolumioIP/index.php User-Agent Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0 X-Requested-With XMLHttpRequest

Params only has “cmd loadlib” in it and Post and HTML are empty.

I have also checked (under Console) Error, Warnings, Information, Debug information and they are empty.

On Volumio server I had a quick look around in the different logs under var/log (and var/log/nginx) and I could not see anything that looked different from before I added the last mount. (Yes, I have tried adding them in a different order - they all work separately).

So it seems all requests are good but the data is never sent (or received)? Is that a correct guess?

I tried the Net tab in Firebug and I see a “0 B” after the loadlib command in that table, filepath gives “167 B”.

I’ll post in the original Bug post and see if anyone tracking that has a better knowledge about how to debug this.

/Palle

Thanks for the information. Yes you’re right, the browser never receives data from the web server. I’ll check server configuration, if any too small max size is configured, and probably the solution will be to paginate requests / responses when loading the lib.

Some good news here. I’ve finished to code the library loading pagination, so I strongly hope that the “10K limit” will be definitely fixed. I still need to package everything in a nice way, because there’s some dependencies to add to volumio. Changes are:

  • During library loading, the server informs the client about the progression. You will see next to the loader some information about the quantity of loaded items. The idea is to give more feedback to the user, so he can see if something has frozen or if it’s going its way.

  • Once the songs are all loaded on the server side, they’re send by 1000-size batches to the client. That’s the 10K limit killer.

  • Songs are kept in memory on the server side. I’m not 100% convinced yet on this point, there’s pros and cons. Good point is that refreshing the browser, accessing volumio from another device or switching pages (for instance going to settings then back to library) [etc.] will be much faster because it won’t trigger a full new load. The bad points are 1st/ it takes memory, we’ll have to check that it’s not too much for small memory devices such as raspberry pi ; and 2nd/ it won’t refresh automatically if you add new songs, I’ll have to put a “force reload” button somewhere.

Still, I don’t know how very large libraries are supported. I’ve seen other issues about that on the forum (not related to the library panel, but more directly with MPD and the small memory offered by the raspberries). I don’t promise that everything will be fixed… At some point we may have to move the cursor between memory consumption and CPU/bandwidth loading.

Now, what’s next…
I don’t know what’s michelangelo’s plans for the next release, what we can include or not into, but if we want this improvements we’ll have to jump the nodejs step, because I’ve rewritten the library using nodejs (I’m really not a big fan of PHP). Actually it’s not just nodejs, but nodejs+typescript+Q ; with this cocktail we can produce very good code, far from XXth century’ PHP :stuck_out_tongue: ). Javascript only is mandatory to code with nodejs, if you don’t like typescript, you don’t have to bother with it (although it’s a very strong improvement on top of javascript).

Something else: I see two ways to shift to nodejs progressively, without having to refactor all PHP code in one go: either by doing cross-site scripting with JSONP, or by forwarding requests from a server to another. I choose the second one, quite arbitrarily. But in both cases we need to run 2 web servers. I’m doing it on my pi, without any known issue. Clearly, it’s not a long term solution and must be seen as a temporary measure for a stepped transition from PHP to nodejs.

Excellent explanation joel, I see the logic behind it. And yes, do agree that nodejs is the way to go. But we need time to do this transition, so probably we’ll delay the library inclusion. I’m still abroad, so I will check and give you some feedbacks in few days. In the meantime, keep up the good work!