Players/musicpd: Difference between revisions

From Snakeoil OS Reference
Jump to navigation Jump to search
(Added dual outputs)
No edit summary
 
(21 intermediate revisions by 2 users not shown)
Line 30: Line 30:
==Common MPD Configuration==
==Common MPD Configuration==
You can specify the following configuration options to tweak MPD. Separate each option with a ';' (semi-colon). Specific configuration options may exist for different versions of MPD, please refer to their pages for more information.
You can specify the following configuration options to tweak MPD. Separate each option with a ';' (semi-colon). Specific configuration options may exist for different versions of MPD, please refer to their pages for more information.
=== Disable Remote ===
You can disable myMPD from starting by entering the following in the options. Please type these as is (case sensitive!)<syntaxhighlight lang="abap">
remote=off
</syntaxhighlight>


===Volume Mixer===
===Volume Mixer===
Line 58: Line 63:
|mpd_oled
|mpd_oled
|[none]
|[none]
|Enable OLED OSD
|Enable OLED OSD<br />
|}
===Tidal===
MPD 0.21.8 on wards support [https://www.musicpd.org/doc/html/plugins.html#tidal Tidal] via a plugin. Configuration is only available in activated editions for now. Avaiable since Blind Testing U5.
{| class="wikitable"
!MPD Option
!Settings
!Comments
|-
|tidal_token
|[string]
|The Tidal application token. Since Tidal is unwilling to assign a token to MPD, this needs to be reverse-engineered from another (approved) Tidal client.
|-
|tidal_username
|[string]
|Your Tidal user name
|-
|tidal_passwd
|[string]
|Your Tidal password
|-
| rowspan="4" |tidal_quality
|HI_RES
|Highest resolution. MQA?
|-
|LOSSLESS
|Bit perfect?
|-
|HIGH
|High quality lossy?
|-
|LOW
|Low quality lossy?
|}
|}


===Qobuz===
===Streaming Services===
MPD 0.21.8 onwards support [https://www.musicpd.org/doc/html/plugins.html#qobuz Qobuz] via a plugin. This option is only usable in activated editions for now. Avaiable since Blind Testing U5.
MPD no longer support streaming services. Please use [[Players/LMS-Squeezelite#Music streaming services|Logitech Media Server]] and its streaming service plugins.
{| class="wikitable"
 
!MPD Option
==Custom Audio Output==
!Settings
Content coming soon.
!Comments
|-
|qobuz_id
|[string]
|The Qobuz application id. (See [https://github.com/Qobuz/api-documentation#application-auth Application authentication])
|-
|qobuz_secret
|[string]
|The Qobuz application secret. (See [https://github.com/Qobuz/api-documentation#user-auth User authentication])
|-
|qobuz_username
|[string]
|The Qobuz user name.
|-
|qobuz_passwd
|[string]
|The Qobuz password.
|-
| rowspan="4" |qobuz_quality
|5
|For MP3 320. (See [https://github.com/Qobuz/api-documentation/blob/master/endpoints/track/getFileUrl.md#parameters Qobuz format identifier])
|-
|6
|For FLAC Lossless
|-
|7
|For FLAC Hi-Res 24 bit =< 96kHz
|-
|27
|for FLAC Hi-Res 24 bit >96 kHz & =< 192 kHz
|}


==MPD Versions Available in Snakeoil==
==MPD Versions Available in Snakeoil==
{{subpages|Players/musicpd}}
Since 1.2.6, SnakeOil has MPD 0.21, 0.22 and 0.23.


==MPD Client - myMPD==
==MPD Client - myMPD==
Line 139: Line 81:


Snakeoil OS firmware 1.0.9 onwards comes bundled with a web client call ympd. To launch ympd, go to the 'Music Players', and click the label myMPD in Audio State, highlighted here:
Snakeoil OS firmware 1.0.9 onwards comes bundled with a web client call ympd. To launch ympd, go to the 'Music Players', and click the label myMPD in Audio State, highlighted here:
[[File:Musicplayers - remote client mpd.png|thumb|1345x1345px|Musicplayers - remote client mpd|alt=|center]]
[[File:Mpd remote.jpg|alt=|center|thumb|500x500px|Musicplayers - remote client mpd]]
This will launch yMPD in a new browser tab, like so:
This will launch yMPD in a new browser tab, like so:
[[File:Web client.png|center|thumb|1241x1241px|yMPD - Web client]]
[[File:Web client.png|center|thumb|1241x1241px|yMPD - Web client]]
Line 184: Line 126:
You can use this same idea to configure other MPD clients to use the local cover art. There are more advanced MPD clients with the ability to query the Internet to download the cover art. Unfortunately querying the Internet can be hit and miss (false results). Were possible use a local cover art where possible.
You can use this same idea to configure other MPD clients to use the local cover art. There are more advanced MPD clients with the ability to query the Internet to download the cover art. Unfortunately querying the Internet can be hit and miss (false results). Were possible use a local cover art where possible.


==MPD Tweaks==
===MAFA embedded album art===
 
[https://mafa.indi.software/ MAFA] is a paid Android application which is rich in features and user friendly. As well as supporting album art in folders (as above), MAFA can also read embedded album art. MAFA first tries to get cover art file from the directory of the first album track. If that file was not found it will try to get embedded image from the first album trackMAFA is ideal for people who are migrating to MPD and have yet to set up their folder art.
===Dual outputs===
MPD can be configured to output to 2 simultaneous devices. For example, using an external USB card with dual outputs to 2 DACs, one for the main speakers and the other for subs. Note that using standard USB ports on a computer for dual outputs may result in the signals drifting apart; ideally use USB ports driven by one master clock on an external USB card.
 
 
The process is simple to implement and can be used for both PCM and DSD output. The alternative of creating a new Alsa TwoCardsAsOne device will only allow PCM (and maybe DoP?). Conceptually, the process involves:
[[File:Dual outputs process.jpg|left|frameless|753x753px]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<br />
 
# SSH into the SnakeOil instance and navigate to /var/www/players  cd /var/www/players
# Change the folder read,write privileges, then change file read, write privileges  sudo chmod +rw mpd-v22  cd mpd-v22  sudo chmod +rw mpd.conf.template
# Edit mpd.conf.template nano mpd.conf.template  (or use WinSCP’s editor)  <br />Scroll down to section with comments on “ALSA output”. Add the following:  audio_output {  type                    "alsa"  name                    "DAC1"  device                  "hw:0,0"  }  audio_output {  type                    "alsa"  name                    "DAC2"  device                  "hw:1,0"  } <br />
# Restart MPD


<br />
<br />
[[File:Dual outputs Players.jpg|left|frameless|858x858px]]
<br />
You should see that there are now 2 outputs. While the status says one in use, both outputs will work simultaneously. Note that in my setup, I need to ensure that the volume on both outputs are in synch.
Note that the same method can be used to provide dual outputs for upmpdcli. Navigate to the upmpdcli folder and modify the mpd.conf.template file. By enabling the DLNA/UPnP Bridge and using upmpdcli as the client, it is possible to also do dual outputs in LMS (Logitech Media Server).
<br />{{ManualNavigation|[[Players|Music Players]]
|
|[[Players/LMS-Squeezelite|Logitech Media Server & Squeezelite]]
}}
[[Category:Music Players]]
[[Category:Music Players]]

Latest revision as of 11:14, 26 December 2022

Music Player - mpd

Short for Music Player Daemon, MPD is a very lightweight player that can run on the slowest computer you have kept unused in the shed/storeroom.

MPD handles both music management and playback and does not require a secondary client to work. MPD is designed to run from a headless computer. In other words, you are running MPD off a computer that is not connected to a keyboard or a mouse.

You control MPD using secondary devices like your mobile phone, a tablet or another computer. This secondary device is a like your TV remote control, only better. More on this at the end of this article.

Different versions of MPD may impart a different sonic signature, so pick the version that sounds best to you.

There was a time when v17 and v19 used to sound very different, but I think the gap has closed since. v17 is included for historical reference (as a comparison). Always use the latest version avilable if you can.

Do not be deceived by the simplicity of MPD. This is an ultra high quality, no-frills player. It is THE player adopted by many high end commercial products, including Bryston, SoTM and Chord.

If you are looking for simplicity and exceptional sound quality, go with MPD. Sonic signature that can be associated with MPD includes:

  • pin-point accuracy
  • very detailed
  • very transparent
  • heart pounding attack
  • exceptional attack speed

To put in another way - MPD delivers absolute precision when playing back. MPD will tell you a lot about the recording itself. If your audio system is up to it, MPD will turn you into a super bat! You'd pick up the tiniest noise in the recording, details you have never heard before, minute details you may never realise it's there until now.

DSD Playback

MPD supports DoP or native DSD when playing back DSD material. Modern versions of MPD (0.20+) will auto-detect DSD compatibility if you have a native DSD DAC, try setting the hardware to "Native (PCM/DSD)" and let MPD handle the DSD detection - this will do native DSD streaming.

MPD-dsd-rt supports native DSD, refer to the player's page on how to set this up.

Common MPD Configuration

You can specify the following configuration options to tweak MPD. Separate each option with a ';' (semi-colon). Specific configuration options may exist for different versions of MPD, please refer to their pages for more information.

Disable Remote

You can disable myMPD from starting by entering the following in the options. Please type these as is (case sensitive!)

remote=off

Volume Mixer

Use this if you want to enable MPD's built in software volume control (SVC). in MPD. Snakeoil disables SVC by default. The assumption is you are running your Snakeoil PC through an high quality pre-amplifier. Add the following option to enable MPD's SVC if you want to connect your PC straight to your speaker system.

MPD Option Settings Comments
mixer_type hardware Use the hahrdware audio volume control (if available)
software Use ALSA to adjust volume control
none Disable MPD volume control. (Default)

On Screen Display (OSD)

Applies to Raspberry Pi only. This will enable the OLED on screen display. Refer to this forum thread for more information.

MPD Option Settings Comments
mpd_oled [none] Enable OLED OSD

Streaming Services

MPD no longer support streaming services. Please use Logitech Media Server and its streaming service plugins.

Custom Audio Output

Content coming soon.

MPD Versions Available in Snakeoil

Since 1.2.6, SnakeOil has MPD 0.21, 0.22 and 0.23.

MPD Client - myMPD

There is a a long list of MPD clients you can use to queue music for MPD, see this site for a full list.

For Android devices my favourite is MPDroid; Peep in the Apple world can try out MPad. Using a mobile device is the ideal method for remote control as it allows you to browse the albums and artists while sitting comfortably. Finding a remote app that works best for you is really all about personal choices, so take your time to find the one that suits your workflow best.

Snakeoil OS firmware 1.0.9 onwards comes bundled with a web client call ympd. To launch ympd, go to the 'Music Players', and click the label myMPD in Audio State, highlighted here:

Musicplayers - remote client mpd

This will launch yMPD in a new browser tab, like so:

yMPD - Web client

Database Scan

If you are running MPD for the very first time, you need to run a music. This step will add all your music in your music library to the MPD database.

To start scanning, this click the "Settings" menu item at the top to get into the settings page, followed by the "Update DB" button (arrow).

Ympd - settings

Be patient, the first scan may take a long time (It takes around 20 minutes to parse 45,000 music files). If you quit MPD while the database is scanning you may be required to re-do the scan on restart. Note that each version of MPD has it's own database. So you will need to run a scan for every version you want to run.

Browse Music

Click on "Browse Database" at the top navigation bar to get to this view:

Ympd - browser

Your playlists and music library are displayed in this single view. Your music files are organised as what is called the 'folder view'. i.e. how your music file is stored in your file system will be displayed as such in this view.

Click the '+' button associated with a folder to add a folder to the queue. Click on the playlist to add its contents to the queue. Here's an example of using the browser and dive deep into one of the folders. You can navigate around your folder structure quickly by clicking one of the links as marked.

Ympd - browser inside a folder

Queue

Click on the "Queue" button in the navigation menu to see this view. This is more commonly known as the playlist, and here is the list of music that the MPD has played, is playing, or about to play. Unlike other MPD clients, the order of the playlist can't be changed.

Ympd - queue

Dirble

Dirble is created to make internet radio modern again and is focusing on giving that good experience of finding your new favourite radio station. It is a directory listing radio stations found on the Internet.

Ympd - drible

Unfortunately because of the design of the API, you'd need to install a browser extension to disable CORS. Disabling CORS is not ideal as it allows hackers to compromise your computer using a technique called 'cross site scripting'. Eventually Dirble will provide the right headers to make this work. Until then advanced users can install a browser extension to disable CORS if they like. Note that you are doing this at your own risk.

Folder Art Configuration For Your MPD Client

MPD has a very low footprint, this minimal overhead means things like album cover art is not supported. To work around this limitation - cover art is supported via the Snakeoil OS Web server instead. To get this to work you need to create JPG file for each folder. Unfortunately this means your albums have to be organised in folder logic (i.e. songs from the same album has to be organised in one folder, and in this folder a JPG covert art).

The covert art file is commonly named folder.jpg (and is case sensitive). This is an example of MPDroid displaying the cover art using this method:

Mpdroid showing coverart

MPDroid Example

To set this up in MPDroid, go to Settings → Cover art settings. Tick the option 'Download local cover art' to enable two options, 'Path to music' and 'Covert filename'.

Mpdroid cover art settings

Once the checkbox is set, tap 'Path to music' and set it like so, replace [ip_address] with the the IP address of your Snakeoil machine:

Mpdroid path to music

And in covert 'Cover filename', set it to 'folder.jpg'. Note this name is case sensitive. Also you are free to use another name if you prefer.

Mpdroid cover filename

Once you have make this settings, exit the settings and go back to MPDroid playback. Your cover art should start to appear.

You can use this same idea to configure other MPD clients to use the local cover art. There are more advanced MPD clients with the ability to query the Internet to download the cover art. Unfortunately querying the Internet can be hit and miss (false results). Were possible use a local cover art where possible.

MAFA embedded album art

MAFA is a paid Android application which is rich in features and user friendly. As well as supporting album art in folders (as above), MAFA can also read embedded album art. MAFA first tries to get cover art file from the directory of the first album track. If that file was not found it will try to get embedded image from the first album track. MAFA is ideal for people who are migrating to MPD and have yet to set up their folder art.