Tuesday, August 30, 2011

Video - Playlist Editing (0.25 feature)

I'm wrapping up the next release so its time for me to start posting info on some of the features.  Here is a video of the new edit mode for the playlist.  When enabled you can drag tracks around by pressing on the double arrow icon.  If you drag the item all the way to the right it will remove it from the playlist when you release your finger.


Monday, August 15, 2011

Guide: The Basics

Edit: This guide is fairly outdated, but some things still apply.  Check the forums for more updated information.
 
Setup:
When first starting gmmp, you will want to scan in all your music.  Read the scanning guide here.  Also be sure to check out all the preferences available here.

Layout:

Title Bar: At the very top there is a title bar which is always visible.  It will say the current view that is selected.  On the right side of the title bar, there is an arrow icon which will toggle visibility of the Navigation Bar which is right below the title bar.

Navigation Bar:  The navigation bar lets you easily switch between the majority of views in GMMP.  The navigation bar is scrollable and it's location can be configured for both portrait and landscape mode in the preferences (Preferences -> UI).  Most of the views can be hidden via the preferences as well (Preferences -> Enabled Views).


Views:
Now Playing:

This is considered the main screen.  Hitting the back arrow from any other view will return to Now Playing first before going back to the desktop.  If you want to change this behavior to a more traditional back button style where back goes to the previous screen, you can (Preferences -> General -> Traditional Back Button)

Metadata Area:  Below the navigation bar in the picture above is the metadata area.  Information about the currently playing track will be displayed here.  By default the artist, album, trackname, and genre will show, more tags will be available in the future.  You can customize which tags will show (Preferences -> Now Playing -> Displayed Tags).  The font size of the tags can be changed as well (Preferences -> Now Playing -> Font Size).  Small icons will also show up if shuffle or repeat is enabled (a blue shuffle icon indicates shuffle collection, a white shuffle icon indicates shuffle playlist).

Album Art Area:  Under the metadata area, the album art is displayed.  There is a separate guide that goes into more detail about album art.

Gesture Area:  The metadata and album art area make up the gesture area.  Gestures can be enabled and customized under Preferences -> Now Playing -> Gesture

Music Controls:  At the bottom of Now Playing there are music controls.   A button to toggle the 3 shuffle modes (Off, Shuffle Playlist, Shuffle Collection) and a button to toggle repeat mode is located here a long with buttons to play/pause and change tracks.  The shuffle and repeat button can be replace with seek buttons in the preferences (Preferences -> Now Playing -> Show Seek Buttons)

Menu Options
Shuffle:  Change between the 3 shuffle modes

Repeat: This only will show up if "Show Seek Buttons" is turned on.  Toggles repeat mode on/off

Jump to Time:  Jump instantly to a specific time in the currently playing track

Volume:  Adjust the volume with a seek bar.

Sleep:  Turns on a sleep timer to pause playback after a set amount of time

Playlist:

This view shows you the active playlist.  The current playing track will be a lighter font color and in italics.  Press and hold the an entry in the playlist to bring up the context menu.  You can then choose to play that track or remove it from the playlist.  Long pressing the playlist button will bring up the 'Manage Playlists' view which is explained below.

Adding songs to the active playlist:
Adding to the playlist is simple.  From the artist, album, song, genre, or browser view simply long press a list entry to bring up the context menu.

You will have 3 play options:
Play: Erases the active playlist and will play your selection
Play Next: Adds your selection after the current playing track
Enqueue: Adds your selection to the end of the active playlist

Menu Options
Edit Mode:
Enabling edit mode will add arrows next to each song in the playlist.  Pressing the arrow will allow you to drag and drop a track to change the order.  You can also drag a song to the right and release to remove from the playlist.  The selected track will begin to fade out to indicate it will be deleted


Manage Playlists:

This view will show every single playlist file (m3u/wpl/pls) scanned into the database.  Long press a playlist to play, play next, enqueue, save to(saves the active playlist to the selected file), or delete.

Save:  Saves the active playlist

Clear:  Clears the active playlist

Randomize:  Will randomize the order of every song in the active playlist.


Artist:

This will show a list of every artist scanned into the database.  Long press an artist to bring up a context menu to play, play next, enqueue, or open the tag editor for the artist.  Normal pressing an artist will bring up the list of albums specific to that artist.

Menu Options
Artists/AlbumArtists:  You can toggle between viewing all the artists and only the album artists through this option.

Sort: You can also sort the artists alphabetically A-Z or Z-A.

Refresh:  Requery the database to get the list of artists again.

Album:


This view is very similar to the artist view, but it will list every album independent of the artist.  Compilations will show up listed with an artist of "Various".  There are more sorting options for the album view.  You can sort by album name, artist name, and year.

Song:

Lists every single song independent of the album and artist.  If you have a large collection it is urged to not use this view since it can get quite slow.

Genre:

Starts off with a list of genres and lets you dig down to artists, then albums, and then finally songs.

Browser:


This view lets you view all the music you scanned in a folder structure.  It works like any typical file browser.  Folders are represented by a folder icon and playlists are represented by the playlist icon.  To move back to the parent folder you can either hit the back button or press the arrow at the top of the list.  Sorting options are: filename, size, filetype, date, track number, trackname, and artist name.  Long pressing a folder, playlist, or file will bring up a context menu with the option play, play next, enqueue, or delete.  Delete will permanently remove the file/folder from the device.  Folders will also have a 'Scan' option which will tell the scanner to scan that specific folder for new music.

Equalizer:


Here you can change the audio balance, preamp gain, and the gain of each band.  Full guide here
Note:  The equalizer must be enabled for anything to take effect.  Menu -> Toggle EQ to enable.

Search:

Finally we have the search view.  Pressing the physical search button on the device will jump straight to this view or there is a button on the navigation bar to access the search view.  Type the search into the edit box and press the magnifying glass button to do a full search.  Clicking the X icon will reset the search.  By default, quick search is enabled, which will begin to search as soon as text is typed into the edit box.  This can be disabled in the preferences (Preferences -> Search -> Instant Search).  Long pressing an artist, album, or song will bring up the standard context menu allowing you to play, play next, or enqueue the selection.  A normal press of an album or artist will jump straight to the artist or album view for the selection.

Menu Options
Categories:  Choose what to search in.  Options are: Artist, Album, Song, or All

Reset:  Resets the current search

Minor Patch - 0.24.1

Download here

0.24.1: (08/15/11)
-Plus/minus buttons on the eq will now keep incrementing if you hold it in

fixes:
-Corrected artist and album counts in db stats
-Fixed gradient on horizontal seek bar in EQ

Saturday, August 13, 2011

0.24 Released - Album Artist support, EQ and Browser improvement, and much much more

There are a lot of changes in this version.  I went into detail on a few of the changes in my last post.  I provided screenshots of some of the other changes at the end of this post.

Download 0.24.1 Alpha

Edit: One thing I forgot to mention was I did include 7 presets for the equalizer.   They were designed and optimized for 10 bands, but the values are interpolated for any band count lower than 10.

Edit 2: A rescan is needed in order for the Album Artist tag to be picked up


Changelog:
0.24: (08/12/11)
-Library: Album artist support (Menu -> Artists/Album Artists to toggle in artist view)
-Library: Added sorting options for the artist, album, genre, and song views
-Playlist: Added option to delete playlist
-Music Service: Playback position is now saved when exiting and restored when gmmp is opened again.
-Browser: Made visual improvements to the browser view
-Browser: Files in the browser will now have their tags scanned by default so "artist - trackname"
            is displayed instead of filename(with a preference to turn it off)
-EQ: Added plus and minus buttons to the EQ bands for more precise control
-EQ: Added left/right balance control to the equalizer view
-EQ: Added a landscape layout with vertical bars
-EQ: Added an extra column in the compatibility view for EQ
-EQ: Added built in presets: Rock, Dance, Pop, Live, High Boost, Mid Boost, and Bass Boost
-UI: UI preference section added
-UI: Enabled Views preference add to UI section allowing you to customize which
        views show up on the quicknavbar
-UI: QuickNavBar position preference moved to UI section
-UI: Added preference to set which tags show in now playing (artist/track/album/genre)
-UI: Moved scan and about options to preferences
-Scanner: Scanner options are now persisted and "format album/artist tags" is off by default
-Scanner: Added database statistics that show total songs/albums/artists etc.
            (Preferences->Scanner->Menu->DB Stats)

fixes:
-Fixed incorrect tracks found being reported after a scan
-Folders will be listed before files in the browser
-Fixed issue where playback could stop if you toggled eq on/off
-Fixed bug where album art wouldn't download if albumart directory didnt exist






Tuesday, August 9, 2011

Preview: 0.24


Here is a quick preview of some of the changes in 0.24.  Screenshots were taken on cyanogenmod 7 which is gingerbread.  I should be finished by the end of the week.

Album Artist Tag Support:
Audio tags not only can contain tags for the artist and the album, but also a tag for the "album artist".  The album artist tag is used in compilations or mixed albums from electronic artists.  The artist view in gmmp now lets you toggle between viewing only the artists or only the album artists.  This allows less clutter in the list (take a look at the black sun empire entries and you will see the difference)

File Browser Improvements:
A bunch of various visual improvements were made.  There is also an option for the browser to read in the tags and replace the filename with "Artist - Songname".


Sorting Options for Library Views:
Artist, album, genre, and song views now have sorting options
Sorted by Album Year

Sorted by Album Name
Customizable QuickNavBar:
You can now enable/disable all the views except now playing and the playlist.
Genre and Song Views are hidden.  Note: Scan and About menu options were moved to preferences to reduce clutter

Monday, August 1, 2011

Guide: Reducing audio skipping and stuttering

Many of the advanced features of gmmp can consume a good amount of cpu so this is a guide for getting playback as smooth as possible.

To start I would like to explain why these features can consume a lot of CPU time.  In order to provide some of the advanced features like gapless playback, equalization, and extra format (flac, wv, wma, ape) support I had to write my own code to read in the audio data, decode it, then send it to the audio device for output. I will refer to this as the "audioengine". Normally you can just use a built in java class (MediaPlayer)provided by google to play an audio track, but the features I mentioned are simply not possible to do with the MediaPlayer class.

As time goes on it seems google is adding more features that make it possible to do some of these things just by simply using the built in API.  Examples of this are equalizer support in 2.3+ and flac support in 3.1+.  GMMP is smart enough to use the built in features when possible, then fall back to the audioengine if needed.  The built in features typically will take advantage of any additional hardware (dsp chips) on the device to reduce the amount of CPU needed.  The audioengine runs purely in software.

The following are settings you can tweak to improve playback.

1)  If you do not care about gapless playback or an equalizer, disable them.  This will force the android MediaPlayer to be used over the AudioEngine for all the supported formats.
Preferences -> Audio -> Uncheck Gapless Playback
Equalizer View->Menu->Toggle EQ (hit until you see Status: Disabled)

2) Adjusting Priority:  There are 2 priority settings you can play around with: Playback Priority and Decoding Priority.  This will cause the playback and decoding to be giving higher cpu priority over other processing running on the device.  I've found some devices actually skip more if the highest priority is used.  Each device is different so you will need to play around with the priorities to find the sweet spot.  Adjusting decoding priority will have much more of an effect than the playback priority.
Preferences -> Audio -> Playback Priority and Decoding Priority

3) Buffer size:  You can adjust how much memory is allocated to buffer the audio data before playback.  If you tried 1 and 2 above and still get skipping, try increasing the buffer size.
Preferences -> Audio -> Playback Buffer Size

Optimizing your equalizer settings:
If you are using the equalizer and are still getting skipping after doing everything suggested above, try the following:

1) Decrease the EQ quality
Preferences -> Audio -> Equalizer -> Quality

2) Lower the amount of bands used
Preferences -> Audio -> Equalizer -> Number of Bands

3) Take advantage of the preamp setting.  The preamp uses next to no CPU time at all so use it.  A band that is set to 0 dB will be skipped during processing.   So set your bands so you have as many at zero as possible.  Instead of settings like this: preamp 0, b1 +3, b2 +2, b3 -1, b4 +2, b5 +2,  use this:  preamp -2, b1 +1, b2 0, b3 -3, b4 0, b5 0.   Only 2 bands need to be processed which saves CPU and the overall sound should be somewhat similar.

Edit:  If you want to use an equalizer but nothing above works and you have 2.3 or higher, you can try using the android EQ instead (Preferences - > Audio  -> Equalizer -> uncheck Use GMMP EQ)  The quality is not nearly as good but the playback should be smoother

Guide: How to setup and use the equalizer

Setting up the equalizer
To setup what type of equalizer you want, go to the equalizer preferences (Preferences -> Audio -> Equalizer)

Number of bands: Choose anywhere from 2-10 bands.  A band represents a range of frequencies that you can adjust the gain for.  Each band will add more cpu processing, so only choose the amount you need.  5 is a good number to start with. 

Quality:  GMMP includes 3 different DSP filters that can be used by the equalizer.  To simplify things, each filter is associated with a different quality setting.
-Default (Recommended):  This is a RBJ Bi-quad filter.  The quality is good, but it has the worst freqency response out of the 3.
-High:  This is a 1st-Order Butterworth filter.  This has a much better frequency response, so gain adjustments to one band will have less effect on adjacent bands.
-Highest: This is a 2nd-Order Butterworth filter which has a very good frequency response.  This is very CPU intensive (around 6+ bands on an HTC thunderbolt results in the audio skipping)

The Equalizer View:

The quick nav bar should now contain and equalizer button.  Click on that to get to the equalizer view pictured below.
At the top you will see the preset spinner.  This will show the current preset (or flat if none is selected).  Under that is a status indicator showing whether or not the EQ is enabled.  Under that is the preamp bar.  Which will adjust the overall gain of the audio.  Finally under the preamp is each equalizer band bar.  This area is scrollable if all the bands cannot be displayed at once.  Above each band the center frequency and gain is displayed.  Each band can be adjusted from -12 decibels to +12 decibels.  Changes to each bar will not take effect until you release the bar with your finger.

Menu Options:
Pressing the menu button will bring up a bunch of equalizer specific options.

Toggle EQ:  Toggles the equalizer on and off

Save Preset:  This will save the values of pregain and each band to a preset.  Simply provide it a name and it will show up in the preset spinner.  Note: A preset is specific to the number of bands, so you cannot use a 10 band preset on a 5 band EQ.

Delete Preset: Will bring up a list of all the presets.  Chose whichever you would like to delete


This post will be updated as more equalizer features are added.

0.23 Released - Equalizer, preamp, shuffle modes, and launcher icon added

 I decided to split the equalizer/dsp task over 2 releases.  This one contains most of the good stuff, but there are a few immediate tasks involving the EQ that I will address in 0.24.  I wanted to get this out the door so people can start testing.  I will be doing 2 more posts, one being full instructions for the equalizer and the second are tips/settings to tweak to assure you get smooth playback.

The equalizer can be configured to have anywhere from 2 to 10 bands.  The center frequencies for the 5 band and 10 band are fairly standard, but I made up an equation to generate the frequencies for all the others.  That equation may need to be tweaked a bit so if any of the bands sound off please let me know.  Also note I did not include any presets for the EQ.  That is planned in 0.24

Known "Issues":
If you have gapless playback off.. and enable/disable the EQ it will stop the currently playing track.  If you plan on toggling the EQ on and off frequently, turn on gapless playback as well and you will be fine.  Besides this, there should not be any major issues, but I would not be surprised if some minor bugs popped up here or there.

Download 0.23 alpha here.

Changelog:
0.23: (08/01/11)
-Added customizable 2-10 band equalizer with a preamp and 3 dsp filters to choose from
    for the EQ.
-Equalizer preferences added (Preferences -> Audio -> Equalizer)
    -Number of Bands: Choose from 2-10 eq bands
    -Quality:  Default = RBJ Biquad Filter, High = 1st-Order Butterworth Filter,
        Very High = 2nd-Order Butterworth Filter
-Added the ability to save, load, and delete custom EQ presets
-Added new launcher and status icon (reinstall/reboot might be needed to see new launcher icon)
-Shuffle mode option added to Now Playing view (Shuffle Off, Shuffle Playlist, Shuffle Collection)
-Optimized a lot of the audio processing code
-Changed Above Normal priority from -2 to -3 in order to be higher than the UI thread
-Increased default decoding priority to Above Normal

Screenshots: