Difference between revisions of "MPD Daemon"

From Fixme.ch
Jump to: navigation, search
 
(35 intermediate revisions by 3 users not shown)
Line 1: Line 1:
* Part of the [[Internal_Server]]
+
[[Category:Services]]
 +
== Information ==
 +
* Connection:
 +
** Server: mpd.fixme.ch
 +
** Port: 6600
 +
** No password
 +
** Only accessible within the hackerspace network
 +
* Stats: http://gna.org/projects/mpd-stats
 +
** Run from /etc/rc.local
 +
** Generate stats (for now in root's crontab)
 +
** Scripts: /home/rorist/{generate-mpd.sh,mpd-stats/*.pl}
 +
** Sqlite DB: /home/rorist/.mpd-stats/mpd-stats
 +
* There's a cron job for root to deactive Repeat mode every 15mn
 +
 
 +
== Music files ==
 +
* directory /media/disk1/music
 +
** Permissions: sysadmin:sysadmin, dirs=774, files=664
 +
 
 +
If you don't have access to the server, you must use the [[ftp]] in the password protected share under the music directory. You can then synchronize the database with a simple
 +
 
 +
    curl https://mpd.fixme.ch/api/update
 +
or
 +
 
 +
    firefox https://mpd.fixme.ch/api/update
 +
or whatever http client you use.
 +
Yep, that's all Folks!!!
 +
 
 +
== Clients ==
 +
=== Web ===
 +
* Some members did a custom mpd client: https://mpd.fixme.ch but it's now borken
 +
* Sources: https://github.com/fixme-lausanne/mpd-wsgi
 +
[[Image:mpd.png|200px]]
  
== Connect to MPD ==
 
 
=== Glurp ===
 
=== Glurp ===
 
* Very nice client
 
* Very nice client
* Click on PL to open tabs and go to config, just add foo.fixme.ch and there you go
+
* Click on PL to open tabs and go to config, just add mpd.fixme.ch and there you go
 
[[File:Glurp.png]]
 
[[File:Glurp.png]]
  
Line 15: Line 45:
 
num_profiles = 1
 
num_profiles = 1
 
names[0] = Foo
 
names[0] = Foo
hosts[0] = foo.fixme.ch
+
hosts[0] = mpd.fixme.ch
 
ports[0] = 6600
 
ports[0] = 6600
 
passwords[0] =  
 
passwords[0] =  
Line 21: Line 51:
 
</pre>
 
</pre>
  
== API ==
+
=== MPDDroid ===
There is a simple mpd api which will get bigger with the time. If you want to participate or add something, just send [[User:gcmalloc|gcmalloc]] a ping.
+
* A nice mpd client for android. A configuration panel will pop enter the same information as the other client, and voila.
for the time those are the avalable option :
+
  
* http://mpd.fixme.ch :information on the current track
+
=== NCMPCPP ===
* http://mpd.fixme.ch/file :download the current file
+
* Command line client
* http://mpd.fixme.ch/next :go to the next song in the playlist
+
* http://mpd.fixme.ch/previous :go to the previous song in the playlist
+
* http://mpd.fixme.ch/stats :return general stat on the mpd daemon
+
  
The return data is either a json or a "None" string if an issue occured on the server side. The file is a binary stream format.
+
=== GMPC ===
== Music files ==
+
* Nice GTK client
For now,
+
* http://gmpclient.org/
* directory /home/mpd
+
** subdirectory Music
+
** subdirectory Playlists
+
** Permissions: sysadmin:sysadmin, dirs=774, files=664
+
  
Input file should go into the ftp or using the nfs in /free_for_all/Music
+
== How to upload new music the easy way? ==
 +
* Copy the following code to a script file upload_foo.sh
 +
<pre>
 +
#!/bin/bash -e
 +
 
 +
lftp -e "mirror -L -R \"$1\" /incoming/music/; quit" fixme:fixme@ftp.fixme.ch
 +
 
 +
ssh -t -p 1337 foo.fixme.ch "sudo python /home/mpd-wsgi/app/update_music.py"
 +
ssh -t -p 1337 foo.fixme.ch "mpc update"
 +
</pre>
 +
* Usage:
 +
chmod +x upload_foo.sh
 +
./upload_foo.sh MyDir
  
 
== Participant ==
 
== Participant ==
Line 45: Line 79:
 
* [[User:Freestorm]]
 
* [[User:Freestorm]]
 
* [[User:Gcmalloc]]
 
* [[User:Gcmalloc]]
 +
* [[User:Francois]]
 +
 +
== Legacy ==
 +
 +
=== API ===
 +
<s>
 +
* There is a simple mpd api which will get bigger with the time.
 +
* It is used on https://mpd.fixme.ch
 +
*The api is documented on https://mpd.fixme.ch/api
 +
*If you want to participate or add something, just send [[User:gcmalloc|gcmalloc]] a ping.
 +
</s>

Latest revision as of 21:38, 9 August 2019

Information

  • Connection:
    • Server: mpd.fixme.ch
    • Port: 6600
    • No password
    • Only accessible within the hackerspace network
  • Stats: http://gna.org/projects/mpd-stats
    • Run from /etc/rc.local
    • Generate stats (for now in root's crontab)
    • Scripts: /home/rorist/{generate-mpd.sh,mpd-stats/*.pl}
    • Sqlite DB: /home/rorist/.mpd-stats/mpd-stats
  • There's a cron job for root to deactive Repeat mode every 15mn

Music files

  • directory /media/disk1/music
    • Permissions: sysadmin:sysadmin, dirs=774, files=664

If you don't have access to the server, you must use the ftp in the password protected share under the music directory. You can then synchronize the database with a simple

   curl https://mpd.fixme.ch/api/update

or

   firefox https://mpd.fixme.ch/api/update

or whatever http client you use. Yep, that's all Folks!!!

Clients

Web

Mpd.png

Glurp

  • Very nice client
  • Click on PL to open tabs and go to config, just add mpd.fixme.ch and there you go

Glurp.png

Sonata

  • Sonata crash when people make a full update of the library, apart from this the client is still usable.
  • Configuration for the Sonata client
  • .config/sonata/sonatarc
[profiles]
num_profiles = 1
names[0] = Foo
hosts[0] = mpd.fixme.ch
ports[0] = 6600
passwords[0] = 
musicdirs[0] = #should be changed to your $HOME

MPDDroid

  • A nice mpd client for android. A configuration panel will pop enter the same information as the other client, and voila.

NCMPCPP

  • Command line client

GMPC

How to upload new music the easy way?

  • Copy the following code to a script file upload_foo.sh
#!/bin/bash -e

lftp -e "mirror -L -R \"$1\" /incoming/music/; quit" fixme:fixme@ftp.fixme.ch

ssh -t -p 1337 foo.fixme.ch "sudo python /home/mpd-wsgi/app/update_music.py"
ssh -t -p 1337 foo.fixme.ch "mpc update"
  • Usage:
chmod +x upload_foo.sh
./upload_foo.sh MyDir

Participant

Legacy

API