Saturday, April 28, 2018

3.0 WIP 20: Light theme, list paging and highlighting the current song in all views

Light Theme

I spent some time making sure the light themes worked correctly and there was surprisingly a lot of work needed to get them looking good.



By default, the theme library GMMP uses lets the text to all of the views that are not the toolbar to be black.  The toolbar is smart enough to check the background color and choose the appropriate text color to display on top of that.  Since a large amount of GMMPs UI uses the primary color as the background, I had to create a lot of custom views to do something similar to the toolbar.



A dark background will give you light text and light button colors and vice versa for a light background.  Note: I still need to work on the button colors behind album artist.  Light colors on top of art is obviously preferred


Paging

In my opinion one of GMMP's strongest points has always been the ability to handle very large library, so I started testing 3.0 with a large library.  I put a 200 gb sdcard filled with music into my Moto e4 and began testing.  I quickly found out that what I had written started to struggle when throwing 20,000 songs at it.  The lists rendered fine and you can navigate through your music at a speed you would expect.. however the memory usage seemed to be very high causing random pauses when selecting items.  Fortunately google has something exactly for this in their Paging Library to handle this.  What this does is load data around where your list is current positioned.   In the case of having a list with 20000 songs, at any given time only a few hundred will be loaded into memory to be displayed in the list.

I am still in the process of working out all the kinks with the paging library, but my initial implementation seems to work pretty well.  The lists will show up almost immediately (vs taking a few seconds to load) and I no longer experience the random pauses when making selections.  Now some things do not play too well with this library like the fast scrolling, but I will either get things working with the fast scrolll library, write my own implementation of fast scroll, or come up with an alternative to navigate large lists fast (perhaps something like android auto does with the letter selection).

Song Highlighting


One of the most frequently requested features I received was the ability to show the current playing track in all the list views instead of just now playing / folder view / queue view.  Every view that shows track lists besides the bookmark view should now highlight the playing song if its in the visible list.  The video below shows that in action.



I also made a few other additions like syncing with the android media library and loading the entire list into the queue when selecting a song (this now includes the full track list view as well)

I am still targeting a late May release for the first alpha.  The player is in pretty good shape now but has not yet gone through any sort of significant testing, so there is the potential for a delay if I run into some bad issues.

Saturday, April 14, 2018

2.2.7 Released

2.2.7 (04/09/2018):
-Fixed reading embedded album art in ogg containers
-Added error check to hopefully prevent the "Cleaning database" notification from being stuck
-Jumping to a letter in the album list in android auto should now correctly take you to the right spot in the list
-Clicking search button will no longer remove focus on the search text field
-Additional workarounds for invalid unlocker issue

2.2.6 (04/03/2018):
-Taglib update to 0.11.1
-Fixed handling of unicode TXXX album artist tags
-Added workaround for invalid unlocker error caused by updating some devices to oreo
-Fade out if the next audio source isnt prepared when crossfading

3.0 WIP 19: On Queue Completion, Android Auto, Improved Voice Commands and Auto Pause/Play

The last two weeks were mostly spent refactoring / rewriting the remaining Music Service code that i had previously disabled.  That includes the MediaSession, Android Auto Support, Audio Focus handler, On Queue Completion, Voice Commands, and Auto Pause/Play.  The only thing remaining I believe is the auto volume adjust and the ability to handle multiple remote control presses.  At this point it looks like a realistic release date of the first alpha should be in May.  I am probably a week out from starting internal testing, which basically means i start deploying the app to all my test devices and actually use it as my main driver on my phone.  Up until now i have still been using 2.2.x.  I am not expecting that many bugs, but what I am expecting is a lot of things i just forgot to implement that are crucial to making GMMP usable.

3.0 working in Android Auto

Audio Focus

The new audio focus handling is mostly the same as 2.x.  Google did add some new capabilities for oreo which I did add.  When GMMP requests audio focus, sometimes something else has to keep focus for a bit while longer.  In this case the request returns that the focus request was denied temporarily, but will let gmmp know when it can take focus.  When this happens gmmp will wait for the go ahead and then start playback after the OS says it can take focus.  I am not sure how useful this is, but I figured i'd mention it.

On Queue Completion

I made some minor changes when re-implementing this feature.  Play Random Track was replaced with a simple Shuffle.  It will load all your music into the queue and turn on shuffle.  Another nice improvement is the music selected by on queue completion will now be preloaded when you are playing the last track in the queue.  This will allow gapless and/or crossfade to work.

I had mentioned this in a previous post, but in 3.0 many of the options will be right in the UI instead of being hidden away in the general preferences.  This should make it much easier to change options quickly.  On most of the views, they will be in a "Customize" section of the 3 dot menu on the toolbar.



Before 3.0 is fully released I will most likely add a few more on queue completion options, but for now I think its good.

Improved Voice Commands

While testing voice searching in android auto, I had noticed it was sending unstructured voice command .  An unstructured voice command is basically a voice search that you do not know what it is looking for (ie an album search, track search, artist search, etc).  Now gmmp will run through a bunch of queries to try to find what the user is requesting to play.  Previously in this situation it will only search the track name.  

Auto Pause / Play

The auto pause / play functionality was simplified a bit.  Since GMMP was first written for android 1.6, it was previously looking for a huge list of different events to determine whether to pause or auto resume.  Now to keep it simple, GMMP basically just listens for a "NOISY" intent when playing over a wired connection, bluetooth, or speaker.  This intent is broadcast in many situations like when you unplug your headset or receive a phone call, so it basically has everything covered.  Another minor change is gmmp will only look for a2dp connections (this is what is used for playing music) instead of all BT connections in general.  

I also added some new pause / play triggers which include: 
  • HDMI plug/unplug
  • Phone Power plug/unplug
For each type of connection / audio routing there will be the option to do a smart play or an always play.  Smart auto play will basically only automatically resume playback when GMMP was auto paused.  This has always been my preferred behavior.  I've always found it super annoying when a music player that i was not using at all decides to automatically start playing just because i plugged in my headphones.