Difference between revisions of "MythMusic"

From MythTV Official Wiki
Jump to: navigation, search
m (Visualizations: Added a mention of how you configure the visualizations)
(187 intermediate revisions by 33 users not shown)
Line 1: Line 1:
MythMusic is a simple mythtv plugin that allows the system to play Audio files .i.e mp3, ogg, flac, wav etc using the mythtv GUI and remote.
+
MythMusic is a sophisticated MythTV plugin that allows you to play and manage music and audio files .i.e MP3, Ogg, FLAC, wav etc and play radio streams from the likes of Icecast, Sky FM, Digitally Imported and Radionomy.
 +
It is specifically designed to be operated by a normal remote control.
  
 +
This page describes the regular music files features of MythMusic. For the radio streaming part see [[MythMusic Radio Streaming]].
 +
 +
== Supported Formats and Containers ==
  
== MythMusic Install ==
+
=== Playback ===
 +
* Audio CDs
 +
* MP2
 +
* MP3
 +
* MP4
 +
* FLAC
 +
* Vorbis Audio (OGG + OGA)
 +
* AAC (iTunes)
 +
* AC3
 +
* Wav + WavPack (WV)
 +
* Windows Media Audio (WMA)
 +
* Sony OpenMG (OMA + OMG)
 +
* Sony ATRAC (ATP, AA3)
 +
* Real Audio (RA)
 +
* Matroska Audio
 +
* Audio Interchange Format (AIFF)
 +
* True Audio (TTA)
 +
* Shockwave Audio (SWA)
 +
* And more
 +
 
 +
===Encoding===
 +
* MP3
 +
* FLAC
 +
* OGG Vorbis Audio
 +
 
 +
== Installing MythMusic ==
 +
The best approach is to follow the installation guides for MythTV and MythMusic that have been developed for your [[Operating System]] and distribution.
 +
 
 +
==  Configuring MythMusic ==
 +
 
 +
For global MythMusic configuration. Go to the Utilities/Setup->Setup->Media Settings->Music Settings->General Settings. In particular you can set up which directory your music is stored in here.
 +
 
 +
There is also a set of music Tools at Utilties/Setup->Music Tools. Here you can rescan your music library, etc.
 +
 
 +
{{Note box|The location of menu items depends on the Menu Theme you have chosen. In the classic menu theme all the menu items are available in the Music menu. In the default menu theme the menu items are scattered thoughout the menus. The menu locations given on this page are for the default layout.}}
 +
 
 +
== Using MythMusic ==
 +
Because MythMusic has been designed to work with a remote control, people often struggle with it, especially when building and editing playlists. Once you become familiar with how it works, which does not take long, you will be amazed at how much more accessible and enjoyable it makes listening to your music collection.
 +
 
 +
===Building your music collection ===
 +
 
 +
There are three ways to add music to MythMusic. You can rip existing CD's, copy your tracks to the existing music directory and do a rescan or you can also import tracks from another location into your music directory. Each method will be explained below.
 +
 
 +
====Ripping CDs====
 +
Before you start to rip a CD into MythMusic there are a few things you should check.
 +
*Make sure your CD device is set correctly - Setup->Media Settings->Music Settings->General Settings. 
 +
*Make sure that your system is not set up to mount the CD and begin playing it automatically.
 +
**Gnome: System→Preferences → Removable Drives and Media Preferences.
 +
**KDE: There are two ways to do this (the first is easier):
 +
***Insert an audio CD, which will trigger a pop-up window.  Select "X Do Nothing", tick the "Always do this for this type of media" checkbox and press OK.
 +
*** Go to System Settings → Notifications → Storage Media Notifications → (Notifications tab) Medium types, select: Audio CD. "X Do Nothing" should have "(Auto Action) after it.  If not, press the "Toggle as Auto Action" button.
 +
*It helps to have your system connected to the Internet, so that MythMusic can locate the information about your CD
 +
 
 +
*Set up how you want your CDs to be ripped, including default quality settings. See the section on [[CD Ripper Settings]]
 +
 
 +
To import (rip) a CD, you need to select the "Import CD" menu item.  This can be found in two places
 +
*Optical Disks → Import CD
 +
*Utilities/Setup → Music Tools → Import CD
 +
 
 +
Insert the disk you want to rip, after a few seconds MythTV will query the Internet [[freedb]] database for your CD information and the Import CD screen will show, with the Artist, Album and tracks information.
 +
 
 +
[[Image:MythMusic1.png|450px]]
 +
 
 +
Check that the Quality setting is what you need. The options are :-
 +
 
 +
*Low    - Low bit rate, low quality, very small file sizes .ogg or .mp3
 +
 
 +
*Medium  - Medium bit rate, medium quality .ogg or .mp3
 +
 
 +
*High    - High bit rate, high quality  .ogg or .mp3
 +
 
 +
*Perfect - Rips to Lossless FLAC file format. This is CD quality but compressed by about 50%
 +
 
 +
You can make changes to any of the items on the screen at this point before you finally select the "Rip CD" button. To edit an individual track, use the 'edit' key ([[#Useful keys to know|see below]]).
 +
 
 +
You now see the progress screen showing each track as it is ripped and encoded, as well as the overall progress on the whole album. Once import has finished you can configure your CD to be ejected.
 +
 
 +
[[Image:MythMusic2.png|450px]]
  
Here we will go through the install proccess for myth music
+
MythTV stores your ripped music on your hard drive in a structured manner. See the page on [[MythMusic File Organization]]. All your music files will also be tagged using the [[ID3]] standard
  
=== Prerequisites ===
+
====Scanning the music directory====
  
The prerequisites for MythMusic are:
+
If you have copied some new music to your music directory or if you want to scan an existing music collection then you can have MythMusic scan for this. Point MythMusic at the directory in which your music collection is, by changing the location of your music library:
* MAD
+
* Utilities/Setup → Setup →Media Settings-> Music Settings → General settings.
* id3tag
+
Then:
* libvorbis-devel
+
* Utilities/Setup → Music tools → Scan for New Music.
* FLAC
+
 
* libcdaudio
+
MythTV will then scan for music and add the information into the MythTV database.
* CDParanoia
+
 
 +
You should also do a rescan if you changed the tag information using a tool outside of MythMusic so it will pick up any changes. Note: for MythMusic to notice the changes the modification time of the files needs to have changed.
 +
 
 +
Alternatively of course, you can copy your existing collection across to the folder that MythMusic has already begun building your collection to.
 +
 
 +
If you have files that have been ripped to Apple's AAC format this should be no problem. Either copy these files into the MythMusic directory and then scan for new music, or mount your collection onto the systems file system and point your MythMusic directory to it as above.
 +
 
 +
====Importing music to the music directory====
 +
 
 +
If you have some tracks you want to add to your music directory then one easy way to do it is to import the tracks using MythMusic. It will copy the tracks to your music directory for you creating the necessary directory structure and renaming the files based on the preferences you have told MythMusic to use.
 +
 
 +
[[Image:MythMusic_Import.png|450px]]
 +
 
 +
====Removing music from the music directory====
 +
 
 +
If you wish to remove some music from MythMusic, remove the files on disk and [[#Scanning the music directory|re-scan]].
 +
 
 +
====Using Album Art====
 +
 
 +
MythMusic supports the display of album art with the name 'cover.jpg' found in the same directory as a music file or embedded in MP3 files with ID3V2.3 or ID3V2.4 tags.
 +
 
 +
The metadata editor also allows you to search Google images for any suitable cover art, artist and genre images. It's up to the user to determine if they are allowed to use any of the images they find.
 +
 +
{{Note box|If you add album art onto an existing collection using software such as "EasyTag" which preserves file modification time by default, you will need to make sure the timestamp of the files is updated (use 'touch') so that Mythmusic rescans the files properly. Otherwise the album art won't appear.}}
 +
 
 +
===MythMusic's Views===
 +
There are several views in MythMusic :- Current Playlist, Playlist Editor - Tree, Playlist Editor - Gallery, Search and Full Screen Visualiser that can have overlapping features depending on what the themer wants to show. Most widgets are optional so it is up to the themer what you get on any view. The following images and descriptions apply to the default and MythCenter themes.
 +
 
 +
From the main menu you can show the Current Playlist view by choosing Media Library->Listen To Music. To show the Playlist Editor views go to Setup->Media Settings->Music Tools->Select Music. You can also switch to any view while on any of MythMusic's views by pressing MENU then select Switch View and choose a view to switch to.
 +
 
 +
*The Current Playlist View
 +
[[Image:MythMusic3.png|450px]]
 +
 
 +
This view is the main playback screen and shows the current (working) playlist at the top and the current tracks metadata below. It also shows some playback controls and the active visualiser along with the current volume status.
 +
 
 +
 
 +
*The Playlist Editor - Tree View
 +
[[Image:MythMusic4.png|450px]]
 +
 
 +
*The Playlist Editor - Gallery View
 +
[[Image:MythMusic5.png|450px]]
 +
 +
The Playlist Editor views show the browse-able metadata tree at the top, the current playlist in the middle and the currently playing track below.
 +
 
 +
*The Search View
 +
[[Image:MythMusic_Search.png|450px]]
 +
 +
The Search view shows a list of fields to search, the search text, the number of matches and a list of matching tracks at the top, the current playlist in the middle, and the currently playing track below.
 +
 
 +
*Lyrics View
 +
{{VersionNote|0.28|Lyrics support was added in 0.28}}
 +
[[Image:MythMusic_Lyrics.png|450px]]
 +
 +
The Lyrics view shows the lyrics for the currently playing track. See [[MythMusic Lyrics]]
 +
 
 +
===Playing Music===
 +
MythMusic works on the principle that any tracks you wish to play must first be added to a current (working) playlist. There are many ways to add tracks to this playlist like browsing for them in the playlist editor views, searching for individual tracks on the search view or using the quick playlists on the popup menu.
 +
 
 +
===Quick Playlists===
  
=== Manual Install of Prerequisites ===
+
MythMusic's Quick Playlists allow you to create playlists automatically. From any view showing the current playlist press the Menu/m button and select 'Quick Playlists'. A pop up menu will show the following options
These instructions are for distributions which don't have pre-compiled versions of the software necessary to run MythTV.
 
  
Download MAD and libid3tag from http://www.underbit.com/products/mad/ Follow the link to download via FTP and save the files to a directory you can find later.
+
[[Image:MythMusic_Menu1.png|450px]]
  
    $ tar -xzf mad-0.15.1b.tar.gz
+
*All Tracks
    $ cd mad-0.15.1b
+
*Tracks by current Artist
    $ ./configure
+
*Tracks from current Album
    $ make
+
*Tracks from current Genre
    $ su
+
*Tracks from current Year
    # make install
+
*Tracks with Same Title
    # exit
 
    $ cd ..
 
    $ tar -xzf libid3tag-0.15.1b.tar.gz
 
    $ cd libid3tag-0.15.1b
 
    $ ./configure
 
    $ make
 
    $ su
 
    # make install
 
    # exit
 
    $ cd ..
 
  
Download FLAC from http://flac.sourceforge.net and install:
+
Selecting one of the options will allow you to either replace or append any matching tracks to the working playlist based on the currently playing track. So for example if a track is playing that you would like to hear the rest of the album you would choose 'Tracks from current Album' which would either replace or append all matching tracks to the working playlist.
  
    $ tar -xzf flac-1.1.2.tar.gz
+
===Using the Playlist Editors to browse for music===
    $ cd flac-1.1.2
 
    $ ./configure
 
    $ make
 
    $ su
 
    # make install
 
    # exit
 
    $
 
  
Download libcdaudio from http://libcdaudio.sourceforge.net and install:
+
The Playlist Editor views allow you to browse your music collection looking for tracks you would like to play. Pressing SELECT (MARK in the gallery view) on any node in the tree will allow you to add or replace any tracks below the current node to the working playlist. A couple of examples will hopefully make things a little clearer (both the tree and gallery views work in the same way though it's easier to see what is happening in the tree view until you get used to it). Lets say you want to play all your Christmas tracks, in the tree on the far left move to 'Genres' then move right to the list of genres, find 'Christmas' in the list then press SELECT/MARK. You will be given the choice to replace or add the tracks on the working playlist.
  
     $ tar -xzf libcdaudio-0.99.12p2.tar.gz
+
Lets try a more complex example, say you want to play all you favourite tracks from Dire Straits, in the far left of the tree select Artist and move right, find Dire Straits in the artist list and move right, select 'Ratings' and move right, in the list of ratings press SELECT/MARK on the highest rating to add/replace the tracks on the working playlist.      
    $ cd libcdaudio-0.99.12p2
+
{{Note box|Some lists can be quite long like the Artist list a quick way to find what you are looking for is to use the button list search feature available in MythTV. You access it by pressing CTR-S or MENU then 'Search List...'. Entering text in the search box will scroll the list to the first item that matches the search text, you can also find the next/previous matches using the buttons in the search popup dialog.}}
    $ ./configure
 
    $ make
 
    $ su
 
    # make install
 
    # exit
 
    $
 
  
Download cdparanoia from http://www.xiph.org/paranoia/down.html.
+
{{Note box|The popup menu that is shown when you press MENU is context sensitive so the options shown will depend on what widget has the focus and even what node in the tree has the focus. For example if the tree has the focus and a playlist node is selected you will see options to add and replace the tracks in the playlist to the working playlist as well as an option to remove the playlist. The 'More Options' menu item will always open the standard menu with the usual menu options.}}
  
    $ tar -xzf cdparanoia-III-alpha9.8.src.tgz
+
===Using the Search view to find tracks to play===
    $ cd cdparanoia-III-alpha9.8
+
The search view allows you to do a quick search for a track you want to add to the working playlist. You can search the Artist, Album, Title, Genre or all of them for some text you enter. For example say you are looking for a track that you know has 'cars' in the title but can't remember who it is by or what album it is on you would select 'Title' in the fields to search and enter 'cars' in the search text which would give you a list of matching tracks you can then individually add to the working playlist.
    $ ./configure
 
    $ make
 
    $ su
 
    # make install
 
    # cd /usr/lib
 
    # ln -sf libcdda_interface.so.0.9.8 libcdda_interface.so
 
    # ln -sf libcdda_paranoia.so.0.9.8 libcdda_paranoia.so
 
    # exit
 
    $
 
  
=== Distro Specific  ===
+
===Saving a playlist===  
 +
Lets say you have added many tracks to the working playlist and you would like to save it so you can add the same tracks again in the future. On any view that shows the current playlist press MENU then 'Playlist Options' then 'Save to New playlist' and when prompted enter a name for the playlist. Alternatively you can choose 'Save to Existing Playlist' which will prompt you to choose from a list of existing playlists to save to.
  
==== Debian (or derivative) ====
+
When you later want to add the tracks to the working playlist on any of the Playlist Editor views choose 'Playlists' in the tree then move right to choose one of the saved playlists you can then add/replace the tracks as usual.
  
As root run:
+
===Smart Playlists===
  
    # apt-get update
+
Smart Playlists are dynamic playlists that are only created when they are used so they will include any new tracks added to your music collection since the last time the playlist was used. The playlists are created by querying the database with the criteria you have entered and optionally the sort order you have choosen to find any matching tracks. There are a few example smart playlists created for you when you first install MythMusic 
    # apt-get install libmad0 libmad0-devel libflac4 libflac4-devel libcdaudio1 cdparanoia
 
    # apt-get install libcdda0 libcdda0-devel libvorbis0 libvorbis0-devel libcdaudio1-devel libid3tag0 libid3tag0-devel
 
  
==== Gentoo ====
+
*Decades - 1960's, 1970's, 1980's, 1990's, 2000's - these create playlists based on the year of release of the tracks
 +
*Favorite Tracks - selects tracks with a rating  greater than 7
 +
*100 Most Played Tracks - selects the 100 tracks with the highest playcount
 +
*Never Played Tracks - selects tracks with a playcount of 0
  
As root:
+
[[Image:MythMusic8.png|450px]]
  
  # emerge sync
+
You can add/edit Smart Playlists on both of the Playlist Editor views by selecting the 'Smart Playlist' node in the tree and then depending on what node is selected you can add/edit/delete a smart playlist by pressing EDIT/DELETE or choose an option from the popup menu.
  # emerge libmad0 libmad0 libflac4 libflac4-devel libcdaudio1 cdparanoia  libcdda0 libcdda0 libvorbis0 libvorbis0 
+
 
  # libcdaudio1 libid3tag0 libid3tag0
+
Once you have created your Smart Playlists you can use them by going to the Playlist Edit view and in the tree select 'Smart Playlists' then move right and choose the category, then move right and chose the name of the smart playlist you want to use. Select it and you will be able to add/replace the tracks to the working playlist as normal.
  
 +
=== Visualizations ===
 +
Nothing beats listening to your music collection and having an accompanying visualization on your large flat panel TV.
  
==== Mandriva ====
+
There are currently a number of visualizations for MythMusic that will be displayed in a small window on some views (only the Current Playlist view in the default theme but it depends on the theme), but will be displayed full-screen when you change to the full screen visualization view.
Mandriva has a number of the prerequisites available on the installation CD. Some of the software you're going to need will have to be obtained from the "contrib" or "cooker" development repositories. Applications downloaded from "cooker" come from the development branch, so there may be issues with some software. It isn't recommended that you mix cooker and release-level software.
 
  
urpmi is the simplest tool for installation of packages from the command line. The difficult part is the configuration, but this has been made easier at the following website: http://addmedia.linuxfornewbies.org/ The website will allow you to choose a mirror site and then present the command-line configuration text for that mirror. You will most likely need to add a "Contrib" mirror to your setup. Once you have done that, you can proceed. If urpmi prompts you about other modules that need to be installed to satisfy dependencies, say "Yes".
+
{| border="1" cellspacing="0" cellpadding="5" align="center" style="border-collapse:collapse; border-color:silver; background:whitesmoke"
 +
|- style="background: gainsboro"
 +
!| Visualization
 +
!| Name
 +
!| Comment
 +
|-
 +
|
 +
|align="center"|  Random
 +
|Switches to a different visualization for each song.
 +
|-
 +
|align="center"| [[Image:Viz2.png|thumb|center|50px]]
 +
|align="center"| MonoScope
 +
|Standard spectrum analyzer, as found on many MP3 players such as XMMS and WinAmp.
 +
|-
 +
|align="center"| [[Image:Viz3.png|thumb|center|50px]]
 +
|align="center"| StereoScope
 +
|Another spectrum analyzer.  Left and right channels are drawn separately.
 +
|-
 +
|align="center"| [[Image:Viz4.png|thumb|center|50px]]
 +
|align="center"| BumpScope
 +
|Similar to Monoscope above, but drawn as a "raised relief" on a flat surface (3D visualization)
 +
|-
 +
|align="center"| [[Image:Viz5.png|thumb|center|50px]]
 +
|align="center"| Goom
 +
|The classic visualization of crazy lines and patterns.
 +
|-
 +
|align="center"| [[Image:Viz6.png|thumb|center|50px]]
 +
|align="center"| Synaesthesia
 +
|A more amorphous visualization similar to plasma clouds displays
 +
|-
 +
|align="center"| [[Image:Viz7.png|thumb|center|50px]]
 +
|align="center"| Spectrum
 +
|A classic sprectrum analyser
 +
|-
 +
|align="center"| [[Image:Viz8.png|thumb|center|50px]]
 +
|align="center"| Squares
 +
|
 +
|-
 +
|align="center"| [[Image:Viz9.png|thumb|center|50px]]
 +
|align="center"| AlbumArt
 +
|This displays the album art for the currently playing music. Basically, any image found for the music file currently playing is treated as if it might be album art including any Artist image if available, and each found image will be displayed in sequence.
 +
|-
 +
|align="center"| [[Image:Viz10.png|thumb|center|50px]]
 +
|align="center"| Piano
 +
|This one tries to highlight the correct keys on a piano keyboard
 +
|-
 +
|align="center"| [[Image:Viz11.png|thumb|center|50px]]
 +
|align="center"| Blank
 +
|Useful if all you want to do is listen to music, saves potential screen burn, as well as putting less stress on your CPU (shown with the track info popup visible, the screen is normally all black)
 +
|}
  
    # urpmi libmad0 libmad0-devel libflac4 libflac4-devel libcdaudio1 cdparanoia
+
=== Shuffle Modes ===
    # urpmi libcdda0 libcdda0-devel libvorbis0 libvorbis0-devel
+
* None - plays songs in sequential order
    # urpmi libcdaudio1-devel libid3tag0 libid3tag0-devel
+
* Rand - plays songs in random order
 +
* Smart - plays songs in smart order. Smart order is calculated using following components, each component weight can be configured in MythMusic Player settings:
 +
** Rating - songs with ''greater rating'' are played more
 +
** Play Count - songs with ''smaller'' play count are player more
 +
** Last Play - songs ''not heard recently'' are played more
 +
** Random - random component
 +
* Album - plays songs from the current album in random order
 +
* Artist - plays songs from the current artist in random order
  
Additional options with MythMusic
+
=== Useful keys to know ===
  
Additional visualizations have been added to MythMusic. If you wish to use these, there are some prerequisites you must install prior to compiling.
+
(note these are based on the default key mappings, you can re-assign these in MythTV's Edit Keys setup screen).
  
* fftw
+
{| border="1" cellspacing="0" cellpadding="5" align="center" style="border-collapse:collapse; border-color:silver; background:whitesmoke"
* OpenGL
+
|- style="background: gainsboro"
* SDL
+
!| Keybinding
 +
!| Default Keyboard Key
 +
!| Function
 +
|-
 +
|align="center" |PLAY
 +
|align="center" | No Default
 +
|Start playback
 +
|-
 +
|align="center" |PAUSE
 +
|align="center" |P
 +
|Toggle Play/Pause
 +
|-
 +
|align="center" |STOP
 +
|align="center" |O
 +
|Stop Playback
 +
|-
 +
|align="center" |NEXTTRACK
 +
|align="center" |>,.,Z,End
 +
|Move to the next track
 +
|-
 +
|align="center" |PREVTRACK
 +
|align="center" |,,<,Q,Home
 +
|Move to the previous track
 +
|-
 +
|align="center" |FFWD
 +
|align="center" |PgDown
 +
|Fast Forward
 +
|-
 +
|align="center" |RWND
 +
|align="center" |PgUp
 +
|Rewind
 +
|-
 +
|align="center" |VOLUMEDOWN
 +
|align="center" |[,{,F10,Volume Down
 +
|Volume Down
 +
|-
 +
|align="center" |VOLUMEUP
 +
|align="center" |],},F11,Volume Up
 +
|Volume Up
 +
|-
 +
|align="center" |MUTE
 +
|align="center" |\,F9,Volume Mute
 +
|Mute
 +
|-
 +
|align="center" |TOGGLEUPMIX
 +
|align="center" |CTRL+U
 +
|Toggle audio upmixer
 +
|-
 +
|align="center" |THMBUP
 +
|align="center" | 9
 +
|Increase rating of the currently playing track
 +
|-
 +
|align="center" |THMBDOWN
 +
|align="center" |7
 +
|Decrease rating of the currently playing track
 +
|-
 +
|align="center" |CYCLEVIS
 +
|align="center" |6
 +
|Cycle visualizer mode
 +
|-
 +
|align="center" |TOGGLESHUFFLE
 +
|align="center" |No default
 +
|Toggle shuffle mode
 +
|-
 +
|align="center" |TOGGLEREPEAT
 +
|align="center" |No default
 +
|Toggle repeat mode
 +
|-
 +
|align="center" |SPEEDUP
 +
|align="center" |W
 +
|Increase playback speed
 +
|-
 +
|align="center" |SPEEDDOWN
 +
|align="center" |X
 +
|Decrease playback speed
 +
|-
 +
|align="center" |SEARCH
 +
|align="center" | CTRL+S
 +
|Show button list search dialog (Global context). This will only work when a button list has the focus.
 +
|-
 +
|align="center" |EDIT
 +
|align="center" |E
 +
|Edit a track's metadata (Global context). This is context sensitive so the metadata shown will depend on where the focus is.
 +
|-
 +
|align="center" |INFO
 +
|align="center" |I
 +
|Show a tracks metadata (Global context). This is context sensitive so the metadata shown will depend on where the focus is.
 +
|-
 +
|align="center" |DELETE
 +
|align="center" |D
 +
|Delete (Global context). This is context sensitive. In the current playlist it will remove the selected track, on the edit playlist tree it will delete a playlist/smart playlist etc.
 +
|-
 +
|align="center" |MARK
 +
|align="center" |T
 +
|Toggle track selection. This has the same effect as pressing SELECT on a node on the playlist editor tree (mostly useful on the gallery view where SELECT has another function).
 +
|-
 +
|align="center" |SWITCHTOPLAYLIST
 +
|align="center" |No default
 +
|Switch to the current playlist view
 +
|-
 +
|align="center" |SWITCHTOPLAYLISTEDITORTREE
 +
|align="center" |No default
 +
|Switch to the playlist editor tree view
 +
|-
 +
|align="center" |SWITCHTOPLAYLISTEDITORGALLERY
 +
|align="center" |No default
 +
|Switch to the playlist editor gallery view
 +
|-
 +
|align="center" |SWITCHTOSEARCH
 +
|align="center" |No default
 +
|Switch to the search view
 +
|-
 +
|align="center" |SWITCHTOVISUALISER
 +
|align="center" |No default
 +
|Switch to the fullscreen visualiser view
 +
|-
 +
|align="center" |SWITCHTORADIO
 +
|align="center" |No default
 +
|Switch to the radio stream view
 +
|}
  
fftw may be obtained from http://www.fftw.org/. In Mandriva it may be installed by typing:
+
==MythMusic Development==
 +
As with all MythTV development work, modifications are worked on as "tickets" on the [http://svn.mythtv.org/trac/ MythTV Trac Server].  To have a look at the latest developments on the active tickets for the MythMusic module, scroll down to the Plugin - MythMusic section of the [http://svn.mythtv.org/trac/report/11 Active Tickets by Component] page.
 +
===Wishlist===
 +
The wishlist for MythMusic development ideas is part of the [[Feature Wishlist (Plugin Addons)]] page of this wiki.  Before editing this page however, please read the guidelines on the [[Feature Wishlist]] page.
 +
[[Category:Plugins]]
 +
===MySQL Database Tables===
 +
MythTV's information, including MythMusic, is organised using MySQL [[database]] tables.  These tables are not accessed directly by the user, but it can be useful to know where the information is stored when administering a MythMusic setup.  See [[Database Schema]] for more information.
  
    # urpmi libfftw2 libfftw2-devel
+
The following tables are used exclusively by MythMusic:
  
OpenGL should be installed on practically all distributions. However, you will need the devel module. In Mandriva it may be installed by typing:
+
*Playlist tables
 +
**[[Musicplaylist table|musicplaylist table]]
 +
**[[Music playlists table|music_playlists table]]
 +
**[[Music smartplaylists table|music_smartplaylists table]]
 +
**[[Music smartplaylist categories table|music_smartplaylist_categories table]]
 +
**[[Music smartplaylist items table|music_smartplaylist_items table]]
 +
*[[Music artists table|music_artists table]]
 +
*[[Music albums table|music_albums table]]
 +
*[[Music genres table|music_genres table]]
 +
*[[Music stats table|music_stats table]]
 +
*[[Music songs table|music_songs table]], which replaces [[Musicmetadata table|musicmetadata table]] as of 0.20
  
    # urpmi libMesaGLU1-devel
+
The following tables are used by MythMusic, alongside other parts of MythTV:
  
SDL may be obtained from http://www.libsdl.org. In Mandriva it may be installed by typing:
+
*[[Keybindings table|keybindings table]]
 +
*[[Settings table|settings table]]
  
    # urpmi libSDL1.2 libSDL1.2-devel
+
== Media Shares ==
 +
[[Mediashares]] gives a simple walk through of how to export your media directory so its accessible from your other remote Mythtv systems.
  
==== Redhat 9 ====
+
{{Note box|The information that follows below may be outdated and no longer work or may not be relevant to the current version of MythMusic.}}
  
Red Hat provides packages for several of the prerequisites, making installation very simple. Of the prerequisites, Red Hat provides packages for Vorbis, cdparanoia, SDL, and OpenGL (which you probably already have installed). To install these all at once, simply type (all on the same line):
+
== Linking Pre-Existing Audio Archive with MythMusic ==
  
    $ up2date --solvedeps libvorbis libvorbis-devel vorbis-tools cdparanoia-devel cdparanoia-libs cdparanoia SDL-devel SDL
+
=== iTunes ===
  
If you get the following message: "None of the packages you requested were found, or they are already updated" it probably means you already have all of those packages installed.
+
Here is how I sync'd MythMusic with an already established iTunes setup. All of our music is stored on a laptop (my wife is a DJ so it must be portable) that runs Windows XP. I wanted to back the music up to our myth box, and also make the songs and the playlists that were already created in iTunes, available via MythMusic. First, I decrypted any purchased iTunes music using [http://www.hymn-project.org/download.php QTFairUse]. The decryption was only necessary to allow MythMusic to play music purchased from the iTunes Music Store (Please don't steal music!).
  
You must install the remaining packages, (MAD, FLAC, libcdaudio and optionally fftw) manually following the installation directions above. When installing fftw do not use the rpm package offered on the website because it will cause an error, so use the source package instead.
+
Then I configured the Windows XP laptop to share the iTunes folder (stored in My Documents\My Music by default) on the network:
  
=== Compiling MythMusic ===
+
    1. Right-click on the iTunes folder
 +
    2. Click Properties
 +
    3. Click the "Sharing" tab
 +
    4. Select "Share this folder"
 +
    5. Note the share name, e.g. "iTunes"
 +
    6. Click Ok
  
Once all the prerequisites have been installed, you can proceed with compiling MythMusic.
+
On the myth box, I used Samba to mount the laptop's shared iTunes folder, and rsync to copy all files from the laptop to the mythbox:
  
    $ cd ~/mythplugins-0.19
 
    $ ./configure --disable-all --enable-mythmusic --enable-fftw --enable-sdl --enable-aac
 
    $ qmake mythplugins.pro
 
    $ make
 
 
     $ su
 
     $ su
     # make install
+
     # mkdir /mnt/iTunes
 +
    # mount -t smbfs -o username=<user> //<laptop IP address>/iTunes /mnt/iTunes
 +
    Password:
 +
    # mkdir -p /storage/music/iTunes    # this is where I keep my music, change as necessary
 +
    # chown -R mythtv:users /storage/music
 +
    # su - mythtv
 +
    $ rsync -q --recursive --perms --times --timeout=600 --delete /mnt/iTunes/ /storage/music/iTunes
 +
      ***This can take a while***
 +
    $ exit
 +
    # umount /mnt/iTunes
 
     # exit
 
     # exit
 +
    $
 +
 +
In mythfrontend, I setup MythMusic to look for music in /storage/music and performed a scan for new music. It found all of the music and populated the database (Note: you must have AAC support enabled for MythMusic to find AAC files).
 +
 +
Next, I wanted all of my iTunes playlists to appear in MythMusic. I found [http://simonster.com/mt/archives/000038.html this page] that provides a utility script that creates MythMusic playlists from an iTunes library xml file. Since I'm using myth 0.20, I downloaded [http://www.mickelson.org/files/scripts/mythtv-itunes.pl this] version of the script. Versions before 0.20 should download [http://simonster.com/software/mythtv-itunes.pl this] version. There's a small bug in the 0.20 script as is, so I had to open the script in an editor, search for "playlistid" and replace it with "playlist_id" (Note the underscore). I also had to change the values of the variables at the top of the script to suit my system. Then I ran the script and my playlists were imported into MythMusic.
 +
 +
I finally setup [[cron]] scripts to periodically attempt to sync with the laptop (using the same rsync command as above), and rerun the mythtv-itunes.pl script to keep the playlists up to date.
 +
 +
====Filename Matcher Script====
 +
 +
I wasn't happy with a couple of things that the previous scripts did, and so I started changing them here and there, and eventually most of the thing was gutted.  So here's my version of the above scripts, tested and found working on Myth 0.21.
 +
 +
Previous scripts have been more general in that they searched the MythMusic database for similar Artists and Song Name and Album and then they called that a match.  I didn't like this behavior for a couple reasons.  I could never get non-ascii characters in the ID3 tag to map properly.  The script would just give up on those songs.  Similarly, I have a few songs where the Album field is blank, but the Song Name and Artist are the same (different recordings, live shows, etc) and the previous scripts would simply match all these to the first finding of the song in the database.
  
 +
By matching on filename, we actually get the correct matches and the matching is much faster.  Instead of accessing the database once for each song in your iTunes library, it accesses the database once for the entire library.  Tests thus far have shown a speedup of 400% over previous scripts!  We also don’t have to worry about the ID3 tag containing "non-standard" characters, the songs will still map.  So you can keep your Latin and German music with it's non-standard characters and still have matches.
  
*taken from mythtv.org documentation.
+
A couple of gotchas though.  I'm no character encoding genius, in fact I'm probably a character encoding idiot, but from my little research for this project I noticed iTunes will store non-ASCII characters just fine as escaped hex values in the iTunes library XML file.  MythMusic, on the other hand, doesn't seem to store that information, being a Latin1 database.  I'm also a Perl idiot, so I never figured out how to change the data correctly.  Basically, if you have non-standard characters in the actual filename (not the ID3 tag), these songs will probably not map.  Sorry, but if someone knows how to do the proper conversions in Perl to make iTunes and MythMusic play nice, that would be a nice feature to add to the script. Also, if you find my explanations to be bogus, just remember I might not know what I'm talking about.
  
== Configuring MythMusic ==
+
Also, while I really don't believe this will ever be a problem, I might as well disclaim it. I've tested this script on my library (~1700 songs) and it works great.  However, because this loads some of the music_songs database into a Perl variable before it starts matching, the memory footprint of this script could be larger than the previous Perl scripts.  I'm interested in how even the largest of music libraries perform with this script.
Configuration of MythMusic occurs in two places. The main mythfrontend Setup is for global MythMusic configuration. Go to the Setup/MythMusic/General Setup screen and adjust it for your particular configuration.
 
  
The second configuration screen is within the MythMusic program and will allow you rescan your music library, etc.
+
[http://www.et.byu.edu/~bphilli7/mythtv-itunes-filename-match.pl mythtv-itunes-filename-match.pl] - [[User:Brian.phillips|Brian.phillips]] 04:52, 11 January 2009 (UTC)
  
Here's some explanation about the Ignore_ID3 and The NonID3FileNameFormat:
+
====PHP Script====
  
If Ignore_ID3 is set to TRUE, MythMusic will try to determine the Genre, Artist, Album, Track Number, and Title from the filename of the mp3 file. The NonID3FileNameFormat variable should be set to the directory/file format where the mp3 files are stored. For instance, I store mine in the above shown Genre/Artist/Album/Track format. MythMusic will then use this information to fill in the proper fields when it populates the musicmetadata table rather than searching for an ID3 tag in the mp3 file.
+
I started development of an iTunes to MythMusic conversion script using the same XML file when the first two results didn't work out for me.  I posted it up at [http://www.weezey.com/2008/05/itunes-playlists-in-mythtv.html this site] and then last fall someone else took a stab at the source and sped the whole thing up. Basically all you have to do is rsync your music to your system and then scan for new music in MythMusic setup.  Run the script and it will map each of the files to their ID numbers in the myth database and then create all of your playlists so that they'll be available on any of your mythboxen. The source is made available through subversion so please feel free to develop speed improvements or solutions to the overall puzzle and send me patches but as it stands a 11000 song library takes less than a minute to map and it's only missing the special chars [[User:Brian.phillips|Brian.phillips]] mentions above and the m4v files that MythMusic doesn't store in it's database.
  
The files can be laid out in any format, such as:
+
[http://www.weezey.com/2008/05/itunes-playlists-in-mythtv.html iTunes Playlists in MythTV] - [[User:Weezey|Weezey]] 11:55, 22 April 2009 (UTC)
  
Genre/Artist/Album/Title Artist/Genre/Album/Title Artist/Album/Title (with Genre left as Unknown)
+
----
  
The track number is optional but can be specified with the title by using the TRACK_TITLE keyword instead of TITLE. If TRACK_TITLE is used, then the filename can have a space, hyphen, or underscore separating the track number from the track title. Keywords are case insensitive, so if you specify GENRE it's the same as Genre in the format field.
+
=== RubyRipper ===
  
The Ignore_ID3 option does not disable the code that determines the track length, just the portion that tries to read ID3 info.
+
I use RubyRipper to rip my CD Music library. I also prefer a much different directory and file layout then MythMusic  uses. The RubyRipped files are my 'master'. MythMusic 'Scan for new music' will '''NOT''' successfully identify music files that are themselves ''symbolic links''. Scanned files, for now, must be hard links. As space is a consideration though, I don't want to manage two sets of directories with duplicate copies of the same data. So, the solution is to do a HARD LINK from the master audio archive directory to the target mythtv/music directory.
 +
{{Note box | Hard links '''must''' exist on the same file system. So, this only works if your audio library directory and mythtv director are on the same volume/partition.}}
 +
This little perl script when run will find the all files under audioarchive/vorbis. It then splits the path. This script array elements 4,6,7 of that path align with '''genre/artist/album'''. Directories are created under /mythtv/music and a second  HARD LINK is created to the master audio file. You'll need to adjust the array element numbering to match your archive path structure and also adjust the order for your MythMusic path.  
  
== Using MythMusic ==
+
I also modify the permissions of the '/mythtv/music' directory and files to be 'read-only' because I don't rip from MythMusic setup. While the built in ripper is very flexible and includes all the elements for creating a complex and unique hiearchy -- it doesn't support ripping ''multiple formats at once'' like RubyRipper, or swapping out the default ripper with a command reference to a ripper of choice.  
MythMusic is fairly simple to use. It is recommended that you insert the CD before selecting "Import CD". You should also ensure that your system doesn't try to automount the CD and begin playing it automatically.
+
 
 +
So, note that if you use the permission settings in the perl script, all attempts to rip from the MythMusic interface should/will fail since the mythtv user has no write permissions under /mythtv/music.
 +
{{Perl| script |
 +
<pre>
 +
#!/usr/bin/perl
 +
 
 +
$audioArchive = '/audioarchive/vorbis';
 +
$mythMusic = '/mythtv/music';
 +
 
 +
@fileList = `find $audioArchive -type f -print`;
 +
 
 +
foreach $file (@fileList) {
  
=== Playlist Management ===
+
        chomp($file);
 +
        # The RubyRip setup is format/genre/year/artist/album/title
 +
        # Constructing for MythMusic in genre/artist/album/title
 +
        @rubyRip = split('/', $file);
 +
        $mythMusicPath = join('/', ($mythMusic, $rubyRip[4], $rubyRip[6], $rubyRip[7]));
  
* '''Create a playlist.''' Using the MythMusic "Select Music" menu option, setup the playlist as you normally would by adding songs or other playlists as needed. When you are ready to save the new playlist, highlight "Active Play Queue" at the bottom of the selection tree and hit the "i" key. This will pop up a menu allowing you to name and save the new playlist. You can also hit Enter to bring up the popup on the Active Play Queue. This does not work on the playlists above, as Enter is obviously bound to checking/unchecking the boxes. Any number (i.e. keypad on remote) will also bring up the menu in both cases.
+
        next if ($rubyRip[8] == 'ripping.log');
* '''Edit a playlist.''' Highlight the playlist in the selection tree and hit the "i" key then select "Move to Active Play Queue" in the popup. You can now modify the "Active Play Queue" like normal, adding songs and playlists by selecting them from the song tree. When you are done, highlight the "Active Play Queue" in the selection tree and hit the "i" key then select "Save Back to Playlist Tree". And whatever you were editing as your Active Queue before you moved an existing playlist "on top" of Active reappears. Think of Active has having a push on, pop off capability, but with a depth of only 1.
 
** '''Rearrange the songs in a playlist.''' Highlight a song and hit the "space" bar, the song will now have pair of red arrows in front of it. Use the up and down arrow keys to move it around in the playlist. When you have it where you want it, hit the "space" bar again.
 
** '''Delete an item from a playlist.''' Highlight the item in the selection tree and hit the "d" key.
 
** '''Edit a text field without a keyboard.''' (This applies to all of MythTV's UI and is not specific to MythMusic.)
 
*** Use the keypad number keys (bound to your remote) to select letters quasi-cell phone style. Keys 2-9 work pretty much like any cell phone text entry. 1 cycles through a few special characters, delete, and space. 0 is like a CAPS LOCK. Hard to describe, fairly easy to use. You will soon be able to specify the cycle timing in a Setup screen. You can type fairly quickly through a combination of jumping around the number keys AND hitting a non-number key (right arrow is particularly good for this) to force the current character.
 
*** Press ENTER in the empty line edit control. A keyboard will pop up; you can use this keyboard to enter characters.
 
* '''Delete a playlist.''' Highlight the playlist in the selection tree and hit the "i" key then select "Delete this Playlist" from the popup.
 
  
=== Visualizations ===
+
        # Make first the directory structure genre/artist/album under mythMusic
There are currently a number of visualizations for MythMusic that will be displayed in a small window when while the playlist is visible, but will be displayed full-screen when you change the visualization mode with by pressing '6'.  Which of these visualizations are to be used can be specified as a space-separated list in the Setup menu for MythMusic.
+
        # and the symbolic link to the song titles.
* Random - Switches to a different visualization for each song.
+
        `mkdir -p "$mythMusicPath"`;    # -p no error on existing. Save Cyles with first -x check?
* Monoscope - ''(needs description)''
+
        if ($@) { print "ERROR Making Directory: $@\n"; exit (1); }
* Stereoscope - ''(needs description)''
 
* BumpScope - ''(needs description)''
 
* Goom - The classic visualization of crazy lines and patterns.
 
* Synaesthesia - A more amorphous visualization similar to plasma clouds displays
 
* AlbumArt - This displays the album art for the currently playing music.  Basically, any image in the same directory as the music file currently playing is treated as if it might be album art, and one is selected randomly for display.
 
* Gears - It's the GLXgears demo.
 
* Blank - Just a blank screen (not very exciting, but very CPU-efficient).
 
  
=== Useful keys to know ===
+
        # Now link the file.. [HARD LINKS]
* some keyboard commands that might come in handy..
+
        `ln "$file" "$mythMusicPath/$rubyRip[8]"`;
** Change visualisation mode - 6
+
        if ($@) { print "ERROR Linking: $@\n"; exit (1); }
** Blank Screen - 5
 
**Increase track rating - 9
 
** Decrease track rating - 7
 
** Refresh music tree - 8  
 
** Filter all my music - F
 
**Show incremental search dialog - CTRL + S
 
**Incremental search find next match - CTRL + N
 
**(note these are based on the default key mappings)
 
  
== TroubleShooting ==
+
}
  
You may run into errors when running MythMusic.
+
# Update perms
When I run MythMusic and try and look up a CD, I get an error message
+
`chown -R mythtv.mythtv "$mythMusic"`;
 +
`find "$mythMusic" -type d -exec chmod 555 {} \\;`;
 +
`find "$mythMusic" -type f -exec chmod 444 {} \\;`;
 +
</pre>
 +
}}
  
 +
== Troubleshooting ==
 +
=== Error Message Looking up CD on cddb===
 
The full text of the message will say:
 
The full text of the message will say:
  
databasebox.o: Couldn't find your CD. It may not be in the freedb database. More likely, however, is that you need to delete  /.cddb and  /.cdserverrc and restart mythmusic. Have a nice day.
+
databasebox.o: Couldn't find your CD. It may not be in the freedb database.
  
If you get this message, you should go to the home directory of whatever user MythMusic is running as and type:
+
More likely, however, is that you need to delete  /.cddb and  /.cdserverrc and restart MythMusic. To do this, go to the home directory of whatever user MythMusic is running as and type:
  
 
     rm .cdserverrc
 
     rm .cdserverrc
Line 238: Line 564:
 
  SERVER=http://us.freedb.org:80/~cddb/cddb.cgi CDDB
 
  SERVER=http://us.freedb.org:80/~cddb/cddb.cgi CDDB
 
  </nowiki>
 
  </nowiki>
 +
=== No Sound From Digital Output ===
 +
If you have working sound via a digital output from video recordings, but nothing from MythMusic, make sure the correct audio device is configured for MythMusic.  In particular, check for the following error in /var/log/mythtv/mythfrontend.log
  
 +
AudioOutput Error: Rate doesn't match (requested 44100Hz, got 48000Hz)
  
[[Category:Plugins]]
+
If this error is present, you may need to edit the audio device.  Go to Utilities/Setup -> Setup -> Media Settings -> Music Settings -> General Settings and edit the "Audio device" field.  Enter the value, "ALSA:plug:iec958".

Revision as of 14:12, 24 December 2015

MythMusic is a sophisticated MythTV plugin that allows you to play and manage music and audio files .i.e MP3, Ogg, FLAC, wav etc and play radio streams from the likes of Icecast, Sky FM, Digitally Imported and Radionomy. It is specifically designed to be operated by a normal remote control.

This page describes the regular music files features of MythMusic. For the radio streaming part see MythMusic Radio Streaming.

Supported Formats and Containers

Playback

  • Audio CDs
  • MP2
  • MP3
  • MP4
  • FLAC
  • Vorbis Audio (OGG + OGA)
  • AAC (iTunes)
  • AC3
  • Wav + WavPack (WV)
  • Windows Media Audio (WMA)
  • Sony OpenMG (OMA + OMG)
  • Sony ATRAC (ATP, AA3)
  • Real Audio (RA)
  • Matroska Audio
  • Audio Interchange Format (AIFF)
  • True Audio (TTA)
  • Shockwave Audio (SWA)
  • And more

Encoding

  • MP3
  • FLAC
  • OGG Vorbis Audio

Installing MythMusic

The best approach is to follow the installation guides for MythTV and MythMusic that have been developed for your Operating System and distribution.

Configuring MythMusic

For global MythMusic configuration. Go to the Utilities/Setup->Setup->Media Settings->Music Settings->General Settings. In particular you can set up which directory your music is stored in here.

There is also a set of music Tools at Utilties/Setup->Music Tools. Here you can rescan your music library, etc.


Important.png Note: The location of menu items depends on the Menu Theme you have chosen. In the classic menu theme all the menu items are available in the Music menu. In the default menu theme the menu items are scattered thoughout the menus. The menu locations given on this page are for the default layout.

Using MythMusic

Because MythMusic has been designed to work with a remote control, people often struggle with it, especially when building and editing playlists. Once you become familiar with how it works, which does not take long, you will be amazed at how much more accessible and enjoyable it makes listening to your music collection.

Building your music collection

There are three ways to add music to MythMusic. You can rip existing CD's, copy your tracks to the existing music directory and do a rescan or you can also import tracks from another location into your music directory. Each method will be explained below.

Ripping CDs

Before you start to rip a CD into MythMusic there are a few things you should check.

  • Make sure your CD device is set correctly - Setup->Media Settings->Music Settings->General Settings.
  • Make sure that your system is not set up to mount the CD and begin playing it automatically.
    • Gnome: System→Preferences → Removable Drives and Media Preferences.
    • KDE: There are two ways to do this (the first is easier):
      • Insert an audio CD, which will trigger a pop-up window. Select "X Do Nothing", tick the "Always do this for this type of media" checkbox and press OK.
      • Go to System Settings → Notifications → Storage Media Notifications → (Notifications tab) Medium types, select: Audio CD. "X Do Nothing" should have "(Auto Action) after it. If not, press the "Toggle as Auto Action" button.
  • It helps to have your system connected to the Internet, so that MythMusic can locate the information about your CD
  • Set up how you want your CDs to be ripped, including default quality settings. See the section on CD Ripper Settings

To import (rip) a CD, you need to select the "Import CD" menu item. This can be found in two places

  • Optical Disks → Import CD
  • Utilities/Setup → Music Tools → Import CD

Insert the disk you want to rip, after a few seconds MythTV will query the Internet freedb database for your CD information and the Import CD screen will show, with the Artist, Album and tracks information.

MythMusic1.png

Check that the Quality setting is what you need. The options are :-

  • Low - Low bit rate, low quality, very small file sizes .ogg or .mp3
  • Medium - Medium bit rate, medium quality .ogg or .mp3
  • High - High bit rate, high quality .ogg or .mp3
  • Perfect - Rips to Lossless FLAC file format. This is CD quality but compressed by about 50%

You can make changes to any of the items on the screen at this point before you finally select the "Rip CD" button. To edit an individual track, use the 'edit' key (see below).

You now see the progress screen showing each track as it is ripped and encoded, as well as the overall progress on the whole album. Once import has finished you can configure your CD to be ejected.

MythMusic2.png

MythTV stores your ripped music on your hard drive in a structured manner. See the page on MythMusic File Organization. All your music files will also be tagged using the ID3 standard

Scanning the music directory

If you have copied some new music to your music directory or if you want to scan an existing music collection then you can have MythMusic scan for this. Point MythMusic at the directory in which your music collection is, by changing the location of your music library:

  • Utilities/Setup → Setup →Media Settings-> Music Settings → General settings.

Then:

  • Utilities/Setup → Music tools → Scan for New Music.

MythTV will then scan for music and add the information into the MythTV database.

You should also do a rescan if you changed the tag information using a tool outside of MythMusic so it will pick up any changes. Note: for MythMusic to notice the changes the modification time of the files needs to have changed.

Alternatively of course, you can copy your existing collection across to the folder that MythMusic has already begun building your collection to.

If you have files that have been ripped to Apple's AAC format this should be no problem. Either copy these files into the MythMusic directory and then scan for new music, or mount your collection onto the systems file system and point your MythMusic directory to it as above.

Importing music to the music directory

If you have some tracks you want to add to your music directory then one easy way to do it is to import the tracks using MythMusic. It will copy the tracks to your music directory for you creating the necessary directory structure and renaming the files based on the preferences you have told MythMusic to use.

MythMusic Import.png

Removing music from the music directory

If you wish to remove some music from MythMusic, remove the files on disk and re-scan.

Using Album Art

MythMusic supports the display of album art with the name 'cover.jpg' found in the same directory as a music file or embedded in MP3 files with ID3V2.3 or ID3V2.4 tags.

The metadata editor also allows you to search Google images for any suitable cover art, artist and genre images. It's up to the user to determine if they are allowed to use any of the images they find.


Important.png Note: If you add album art onto an existing collection using software such as "EasyTag" which preserves file modification time by default, you will need to make sure the timestamp of the files is updated (use 'touch') so that Mythmusic rescans the files properly. Otherwise the album art won't appear.

MythMusic's Views

There are several views in MythMusic :- Current Playlist, Playlist Editor - Tree, Playlist Editor - Gallery, Search and Full Screen Visualiser that can have overlapping features depending on what the themer wants to show. Most widgets are optional so it is up to the themer what you get on any view. The following images and descriptions apply to the default and MythCenter themes.

From the main menu you can show the Current Playlist view by choosing Media Library->Listen To Music. To show the Playlist Editor views go to Setup->Media Settings->Music Tools->Select Music. You can also switch to any view while on any of MythMusic's views by pressing MENU then select Switch View and choose a view to switch to.

  • The Current Playlist View

MythMusic3.png

This view is the main playback screen and shows the current (working) playlist at the top and the current tracks metadata below. It also shows some playback controls and the active visualiser along with the current volume status.


  • The Playlist Editor - Tree View

MythMusic4.png

  • The Playlist Editor - Gallery View

MythMusic5.png

The Playlist Editor views show the browse-able metadata tree at the top, the current playlist in the middle and the currently playing track below.

  • The Search View

MythMusic Search.png

The Search view shows a list of fields to search, the search text, the number of matches and a list of matching tracks at the top, the current playlist in the middle, and the currently playing track below.

  • Lyrics View
Version:
0.28
Lyrics support was added in 0.28

MythMusic Lyrics.png

The Lyrics view shows the lyrics for the currently playing track. See MythMusic Lyrics

Playing Music

MythMusic works on the principle that any tracks you wish to play must first be added to a current (working) playlist. There are many ways to add tracks to this playlist like browsing for them in the playlist editor views, searching for individual tracks on the search view or using the quick playlists on the popup menu.

Quick Playlists

MythMusic's Quick Playlists allow you to create playlists automatically. From any view showing the current playlist press the Menu/m button and select 'Quick Playlists'. A pop up menu will show the following options

MythMusic Menu1.png

  • All Tracks
  • Tracks by current Artist
  • Tracks from current Album
  • Tracks from current Genre
  • Tracks from current Year
  • Tracks with Same Title

Selecting one of the options will allow you to either replace or append any matching tracks to the working playlist based on the currently playing track. So for example if a track is playing that you would like to hear the rest of the album you would choose 'Tracks from current Album' which would either replace or append all matching tracks to the working playlist.

Using the Playlist Editors to browse for music

The Playlist Editor views allow you to browse your music collection looking for tracks you would like to play. Pressing SELECT (MARK in the gallery view) on any node in the tree will allow you to add or replace any tracks below the current node to the working playlist. A couple of examples will hopefully make things a little clearer (both the tree and gallery views work in the same way though it's easier to see what is happening in the tree view until you get used to it). Lets say you want to play all your Christmas tracks, in the tree on the far left move to 'Genres' then move right to the list of genres, find 'Christmas' in the list then press SELECT/MARK. You will be given the choice to replace or add the tracks on the working playlist.

Lets try a more complex example, say you want to play all you favourite tracks from Dire Straits, in the far left of the tree select Artist and move right, find Dire Straits in the artist list and move right, select 'Ratings' and move right, in the list of ratings press SELECT/MARK on the highest rating to add/replace the tracks on the working playlist.

Important.png Note: Some lists can be quite long like the Artist list a quick way to find what you are looking for is to use the button list search feature available in MythTV. You access it by pressing CTR-S or MENU then 'Search List...'. Entering text in the search box will scroll the list to the first item that matches the search text, you can also find the next/previous matches using the buttons in the search popup dialog.


Important.png Note: The popup menu that is shown when you press MENU is context sensitive so the options shown will depend on what widget has the focus and even what node in the tree has the focus. For example if the tree has the focus and a playlist node is selected you will see options to add and replace the tracks in the playlist to the working playlist as well as an option to remove the playlist. The 'More Options' menu item will always open the standard menu with the usual menu options.

Using the Search view to find tracks to play

The search view allows you to do a quick search for a track you want to add to the working playlist. You can search the Artist, Album, Title, Genre or all of them for some text you enter. For example say you are looking for a track that you know has 'cars' in the title but can't remember who it is by or what album it is on you would select 'Title' in the fields to search and enter 'cars' in the search text which would give you a list of matching tracks you can then individually add to the working playlist.

Saving a playlist

Lets say you have added many tracks to the working playlist and you would like to save it so you can add the same tracks again in the future. On any view that shows the current playlist press MENU then 'Playlist Options' then 'Save to New playlist' and when prompted enter a name for the playlist. Alternatively you can choose 'Save to Existing Playlist' which will prompt you to choose from a list of existing playlists to save to.

When you later want to add the tracks to the working playlist on any of the Playlist Editor views choose 'Playlists' in the tree then move right to choose one of the saved playlists you can then add/replace the tracks as usual.

Smart Playlists

Smart Playlists are dynamic playlists that are only created when they are used so they will include any new tracks added to your music collection since the last time the playlist was used. The playlists are created by querying the database with the criteria you have entered and optionally the sort order you have choosen to find any matching tracks. There are a few example smart playlists created for you when you first install MythMusic

  • Decades - 1960's, 1970's, 1980's, 1990's, 2000's - these create playlists based on the year of release of the tracks
  • Favorite Tracks - selects tracks with a rating greater than 7
  • 100 Most Played Tracks - selects the 100 tracks with the highest playcount
  • Never Played Tracks - selects tracks with a playcount of 0

MythMusic8.png

You can add/edit Smart Playlists on both of the Playlist Editor views by selecting the 'Smart Playlist' node in the tree and then depending on what node is selected you can add/edit/delete a smart playlist by pressing EDIT/DELETE or choose an option from the popup menu.

Once you have created your Smart Playlists you can use them by going to the Playlist Edit view and in the tree select 'Smart Playlists' then move right and choose the category, then move right and chose the name of the smart playlist you want to use. Select it and you will be able to add/replace the tracks to the working playlist as normal.

Visualizations

Nothing beats listening to your music collection and having an accompanying visualization on your large flat panel TV.

There are currently a number of visualizations for MythMusic that will be displayed in a small window on some views (only the Current Playlist view in the default theme but it depends on the theme), but will be displayed full-screen when you change to the full screen visualization view.

Visualization Name Comment
Random Switches to a different visualization for each song.
Viz2.png
MonoScope Standard spectrum analyzer, as found on many MP3 players such as XMMS and WinAmp.
Viz3.png
StereoScope Another spectrum analyzer. Left and right channels are drawn separately.
Viz4.png
BumpScope Similar to Monoscope above, but drawn as a "raised relief" on a flat surface (3D visualization)
Viz5.png
Goom The classic visualization of crazy lines and patterns.
Viz6.png
Synaesthesia A more amorphous visualization similar to plasma clouds displays
Viz7.png
Spectrum A classic sprectrum analyser
Viz8.png
Squares
Viz9.png
AlbumArt This displays the album art for the currently playing music. Basically, any image found for the music file currently playing is treated as if it might be album art including any Artist image if available, and each found image will be displayed in sequence.
Viz10.png
Piano This one tries to highlight the correct keys on a piano keyboard
Viz11.png
Blank Useful if all you want to do is listen to music, saves potential screen burn, as well as putting less stress on your CPU (shown with the track info popup visible, the screen is normally all black)

Shuffle Modes

  • None - plays songs in sequential order
  • Rand - plays songs in random order
  • Smart - plays songs in smart order. Smart order is calculated using following components, each component weight can be configured in MythMusic Player settings:
    • Rating - songs with greater rating are played more
    • Play Count - songs with smaller play count are player more
    • Last Play - songs not heard recently are played more
    • Random - random component
  • Album - plays songs from the current album in random order
  • Artist - plays songs from the current artist in random order

Useful keys to know

(note these are based on the default key mappings, you can re-assign these in MythTV's Edit Keys setup screen).

Keybinding Default Keyboard Key Function
PLAY No Default Start playback
PAUSE P Toggle Play/Pause
STOP O Stop Playback
NEXTTRACK >,.,Z,End Move to the next track
PREVTRACK ,,<,Q,Home Move to the previous track
FFWD PgDown Fast Forward
RWND PgUp Rewind
VOLUMEDOWN [,{,F10,Volume Down Volume Down
VOLUMEUP ],},F11,Volume Up Volume Up
MUTE \,F9,Volume Mute Mute
TOGGLEUPMIX CTRL+U Toggle audio upmixer
THMBUP 9 Increase rating of the currently playing track
THMBDOWN 7 Decrease rating of the currently playing track
CYCLEVIS 6 Cycle visualizer mode
TOGGLESHUFFLE No default Toggle shuffle mode
TOGGLEREPEAT No default Toggle repeat mode
SPEEDUP W Increase playback speed
SPEEDDOWN X Decrease playback speed
SEARCH CTRL+S Show button list search dialog (Global context). This will only work when a button list has the focus.
EDIT E Edit a track's metadata (Global context). This is context sensitive so the metadata shown will depend on where the focus is.
INFO I Show a tracks metadata (Global context). This is context sensitive so the metadata shown will depend on where the focus is.
DELETE D Delete (Global context). This is context sensitive. In the current playlist it will remove the selected track, on the edit playlist tree it will delete a playlist/smart playlist etc.
MARK T Toggle track selection. This has the same effect as pressing SELECT on a node on the playlist editor tree (mostly useful on the gallery view where SELECT has another function).
SWITCHTOPLAYLIST No default Switch to the current playlist view
SWITCHTOPLAYLISTEDITORTREE No default Switch to the playlist editor tree view
SWITCHTOPLAYLISTEDITORGALLERY No default Switch to the playlist editor gallery view
SWITCHTOSEARCH No default Switch to the search view
SWITCHTOVISUALISER No default Switch to the fullscreen visualiser view
SWITCHTORADIO No default Switch to the radio stream view

MythMusic Development

As with all MythTV development work, modifications are worked on as "tickets" on the MythTV Trac Server. To have a look at the latest developments on the active tickets for the MythMusic module, scroll down to the Plugin - MythMusic section of the Active Tickets by Component page.

Wishlist

The wishlist for MythMusic development ideas is part of the Feature Wishlist (Plugin Addons) page of this wiki. Before editing this page however, please read the guidelines on the Feature Wishlist page.

MySQL Database Tables

MythTV's information, including MythMusic, is organised using MySQL database tables. These tables are not accessed directly by the user, but it can be useful to know where the information is stored when administering a MythMusic setup. See Database Schema for more information.

The following tables are used exclusively by MythMusic:

The following tables are used by MythMusic, alongside other parts of MythTV:

Media Shares

Mediashares gives a simple walk through of how to export your media directory so its accessible from your other remote Mythtv systems.


Important.png Note: The information that follows below may be outdated and no longer work or may not be relevant to the current version of MythMusic.

Linking Pre-Existing Audio Archive with MythMusic

iTunes

Here is how I sync'd MythMusic with an already established iTunes setup. All of our music is stored on a laptop (my wife is a DJ so it must be portable) that runs Windows XP. I wanted to back the music up to our myth box, and also make the songs and the playlists that were already created in iTunes, available via MythMusic. First, I decrypted any purchased iTunes music using QTFairUse. The decryption was only necessary to allow MythMusic to play music purchased from the iTunes Music Store (Please don't steal music!).

Then I configured the Windows XP laptop to share the iTunes folder (stored in My Documents\My Music by default) on the network:

   1. Right-click on the iTunes folder
   2. Click Properties
   3. Click the "Sharing" tab
   4. Select "Share this folder"
   5. Note the share name, e.g. "iTunes"
   6. Click Ok

On the myth box, I used Samba to mount the laptop's shared iTunes folder, and rsync to copy all files from the laptop to the mythbox:

   $ su
   # mkdir /mnt/iTunes
   # mount -t smbfs -o username=<user> //<laptop IP address>/iTunes /mnt/iTunes
   Password:
   # mkdir -p /storage/music/iTunes    # this is where I keep my music, change as necessary
   # chown -R mythtv:users /storage/music
   # su - mythtv
   $ rsync -q --recursive --perms --times --timeout=600 --delete /mnt/iTunes/ /storage/music/iTunes
     ***This can take a while***
   $ exit
   # umount /mnt/iTunes
   # exit
   $

In mythfrontend, I setup MythMusic to look for music in /storage/music and performed a scan for new music. It found all of the music and populated the database (Note: you must have AAC support enabled for MythMusic to find AAC files).

Next, I wanted all of my iTunes playlists to appear in MythMusic. I found this page that provides a utility script that creates MythMusic playlists from an iTunes library xml file. Since I'm using myth 0.20, I downloaded this version of the script. Versions before 0.20 should download this version. There's a small bug in the 0.20 script as is, so I had to open the script in an editor, search for "playlistid" and replace it with "playlist_id" (Note the underscore). I also had to change the values of the variables at the top of the script to suit my system. Then I ran the script and my playlists were imported into MythMusic.

I finally setup cron scripts to periodically attempt to sync with the laptop (using the same rsync command as above), and rerun the mythtv-itunes.pl script to keep the playlists up to date.

Filename Matcher Script

I wasn't happy with a couple of things that the previous scripts did, and so I started changing them here and there, and eventually most of the thing was gutted. So here's my version of the above scripts, tested and found working on Myth 0.21.

Previous scripts have been more general in that they searched the MythMusic database for similar Artists and Song Name and Album and then they called that a match. I didn't like this behavior for a couple reasons. I could never get non-ascii characters in the ID3 tag to map properly. The script would just give up on those songs. Similarly, I have a few songs where the Album field is blank, but the Song Name and Artist are the same (different recordings, live shows, etc) and the previous scripts would simply match all these to the first finding of the song in the database.

By matching on filename, we actually get the correct matches and the matching is much faster. Instead of accessing the database once for each song in your iTunes library, it accesses the database once for the entire library. Tests thus far have shown a speedup of 400% over previous scripts! We also don’t have to worry about the ID3 tag containing "non-standard" characters, the songs will still map. So you can keep your Latin and German music with it's non-standard characters and still have matches.

A couple of gotchas though. I'm no character encoding genius, in fact I'm probably a character encoding idiot, but from my little research for this project I noticed iTunes will store non-ASCII characters just fine as escaped hex values in the iTunes library XML file. MythMusic, on the other hand, doesn't seem to store that information, being a Latin1 database. I'm also a Perl idiot, so I never figured out how to change the data correctly. Basically, if you have non-standard characters in the actual filename (not the ID3 tag), these songs will probably not map. Sorry, but if someone knows how to do the proper conversions in Perl to make iTunes and MythMusic play nice, that would be a nice feature to add to the script. Also, if you find my explanations to be bogus, just remember I might not know what I'm talking about.

Also, while I really don't believe this will ever be a problem, I might as well disclaim it. I've tested this script on my library (~1700 songs) and it works great. However, because this loads some of the music_songs database into a Perl variable before it starts matching, the memory footprint of this script could be larger than the previous Perl scripts. I'm interested in how even the largest of music libraries perform with this script.

mythtv-itunes-filename-match.pl - Brian.phillips 04:52, 11 January 2009 (UTC)

PHP Script

I started development of an iTunes to MythMusic conversion script using the same XML file when the first two results didn't work out for me. I posted it up at this site and then last fall someone else took a stab at the source and sped the whole thing up. Basically all you have to do is rsync your music to your system and then scan for new music in MythMusic setup. Run the script and it will map each of the files to their ID numbers in the myth database and then create all of your playlists so that they'll be available on any of your mythboxen. The source is made available through subversion so please feel free to develop speed improvements or solutions to the overall puzzle and send me patches but as it stands a 11000 song library takes less than a minute to map and it's only missing the special chars Brian.phillips mentions above and the m4v files that MythMusic doesn't store in it's database.

iTunes Playlists in MythTV - Weezey 11:55, 22 April 2009 (UTC)


RubyRipper

I use RubyRipper to rip my CD Music library. I also prefer a much different directory and file layout then MythMusic uses. The RubyRipped files are my 'master'. MythMusic 'Scan for new music' will NOT successfully identify music files that are themselves symbolic links. Scanned files, for now, must be hard links. As space is a consideration though, I don't want to manage two sets of directories with duplicate copies of the same data. So, the solution is to do a HARD LINK from the master audio archive directory to the target mythtv/music directory.

Important.png Note: Hard links must exist on the same file system. So, this only works if your audio library directory and mythtv director are on the same volume/partition.

This little perl script when run will find the all files under audioarchive/vorbis. It then splits the path. This script array elements 4,6,7 of that path align with genre/artist/album. Directories are created under /mythtv/music and a second HARD LINK is created to the master audio file. You'll need to adjust the array element numbering to match your archive path structure and also adjust the order for your MythMusic path.

I also modify the permissions of the '/mythtv/music' directory and files to be 'read-only' because I don't rip from MythMusic setup. While the built in ripper is very flexible and includes all the elements for creating a complex and unique hiearchy -- it doesn't support ripping multiple formats at once like RubyRipper, or swapping out the default ripper with a command reference to a ripper of choice.

So, note that if you use the permission settings in the perl script, all attempts to rip from the MythMusic interface should/will fail since the mythtv user has no write permissions under /mythtv/music.

Application-x-perl.png script

#!/usr/bin/perl

$audioArchive = '/audioarchive/vorbis';
$mythMusic = '/mythtv/music';

@fileList = `find $audioArchive -type f -print`;

foreach $file (@fileList) {

        chomp($file);
        # The RubyRip setup is format/genre/year/artist/album/title
        # Constructing for MythMusic in genre/artist/album/title
        @rubyRip = split('/', $file);
        $mythMusicPath = join('/', ($mythMusic, $rubyRip[4], $rubyRip[6], $rubyRip[7]));

        next if ($rubyRip[8] == 'ripping.log');

        # Make first the directory structure genre/artist/album under mythMusic
        # and the symbolic link to the song titles.
        `mkdir -p "$mythMusicPath"`;    # -p no error on existing. Save Cyles with first -x check?
        if ($@) { print "ERROR Making Directory: $@\n"; exit (1); }

        # Now link the file.. [HARD LINKS]
        `ln "$file" "$mythMusicPath/$rubyRip[8]"`;
        if ($@) { print "ERROR Linking: $@\n"; exit (1); }

}

# Update perms
`chown -R mythtv.mythtv "$mythMusic"`;
`find "$mythMusic" -type d -exec chmod 555 {} \\;`;
`find "$mythMusic" -type f -exec chmod 444 {} \\;`;

Troubleshooting

Error Message Looking up CD on cddb

The full text of the message will say:

databasebox.o: Couldn't find your CD. It may not be in the freedb database.

More likely, however, is that you need to delete /.cddb and /.cdserverrc and restart MythMusic. To do this, go to the home directory of whatever user MythMusic is running as and type:

   rm .cdserverrc
   rm -rf .cddb/

These files aren't automatically deleted because of a conscious design decision by the author that programs that automatically delete things are bad.

The files are used to locally cache CD lookups. If you are re-inserting CDs, your machine will not actually have to go out to the Internet to determine what is on them. However, the URL used to access the freedb database has recently changed, so the stale information in the files from previous runs of MythMusic would cause the error above. Once the files have been deleted the stale information will be gone and your local database will be rebuilt as you use CDs.

The default cddb server in .cdserverrc doesn't seem to be working very well all the time, here's a list of servers you can add:

 SERVER=cddbp://freedb.freedb.org:8880/ CDDB
 SERVER=http://freedb.freedb.org:80/~cddb/cddb.cgi CDDB
 SERVER=cddbp://at.freedb.org:8880/ CDDB
 SERVER=http://at.freedb.org:80/~cddb/cddb.cgi CDDB
 SERVER=cddbp://ca.freedb.org:8880/ CDDB
 SERVER=http://ca.freedb.org:80/~cddb/cddb.cgi CDDB
 SERVER=cddbp://cz.freedb.org:8880/ CDDB
 SERVER=http://cz.freedb.org:80/~cddb/cddb.cgi CDDB
 SERVER=cddbp://no.freedb.org:8880/ CDDB
 SERVER=http://no.freedb.org:80/~cddb/cddb.cgi CDDB
 SERVER=cddbp://uk.freedb.org:8880/ CDDB
 SERVER=http://uk.freedb.org:80/~cddb/cddb.cgi CDDB
 SERVER=cddbp://us.freedb.org:8880/ CDDB
 SERVER=http://us.freedb.org:80/~cddb/cddb.cgi CDDB
 

No Sound From Digital Output

If you have working sound via a digital output from video recordings, but nothing from MythMusic, make sure the correct audio device is configured for MythMusic. In particular, check for the following error in /var/log/mythtv/mythfrontend.log

AudioOutput Error: Rate doesn't match (requested 44100Hz, got 48000Hz)

If this error is present, you may need to edit the audio device. Go to Utilities/Setup -> Setup -> Media Settings -> Music Settings -> General Settings and edit the "Audio device" field. Enter the value, "ALSA:plug:iec958".