Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
carlou33 committed Sep 12, 2016
1 parent fe265c9 commit 36e956e
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 53 deletions.
42 changes: 4 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,6 @@
UdooPlayer
==========
Boîtes Électriques - Server (be-server)
=======================================

A loop player for the UDOO, based on libaudiotool
A loop player for the Raspberry Pi, forked from UDOO Player and based on libaudiotool.

Installation on a new UDOO image (Ubuntu 12.04)

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install git g++-4.8 ubuntu-sdk libportaudiocpp0 libportaudio-dev libavfilter-dev libavformat-dev libavcodec-dev cmake


Build latest CMake and KDE Frameworks 5 Archive :

* CMake
```
mkdir ~/kf5
cd ~/kf5
wget http://www.cmake.org/files/v3.0/cmake-3.0.0.tar.gz
tar -zxf cmake-3.0.0.tar.gz
cd cmake-3.0.0
(mkdir build; cd build; cmake ..; make; make install)
```
* Extra CMake modules
```
git clone git://anongit.kde.org/extra-cmake-modules
cd extra-cmake-modules
(mkdir build; cd build; cmake ..; make; make install)
```
* KArchive
```
wget http://download.kde.org/stable/frameworks/5.0.0/karchive-5.0.0.tar.xz
tar -xf karchive-5.0.0.tar.xz
cd karchive-5.0.0.tar.xz
(mkdir build; cd build; cmake ..; make; make install)
```

And build.
Installation and configuration instruction can be found in the doc/ directory.
55 changes: 55 additions & 0 deletions doc/COMPILING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Compiling the project
=====================

Dependencies
------------

Installation on a new Raspberry Pi image (Raspbian Jessie)

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install git g++-4.8 ubuntu-sdk libportaudiocpp0 libportaudio-dev libavfilter-dev libavformat-dev libavcodec-dev cmake


Build latest CMake and KDE Frameworks 5 Archive :

* CMake
```
mkdir ~/kf5
cd ~/kf5
wget http://www.cmake.org/files/v3.0/cmake-3.0.0.tar.gz
tar -zxf cmake-3.0.0.tar.gz
cd cmake-3.0.0
(mkdir build; cd build; cmake ..; make; make install)
```
* Extra CMake modules
```
git clone git://anongit.kde.org/extra-cmake-modules
cd extra-cmake-modules
(mkdir build; cd build; cmake ..; make; make install)
```
* KArchive
```
wget http://download.kde.org/stable/frameworks/5.0.0/karchive-5.0.0.tar.xz
tar -xf karchive-5.0.0.tar.xz
cd karchive-5.0.0.tar.xz
(mkdir build; cd build; cmake ..; make; make install)
```

And build.

Building the program
--------------------

First, clone the repository on the Raspberry Pi, either directly from Github or using the Git CLI::
$ git clone https://github.com/hixe33/boiteselec-server
Then, we need to generate the Makefile before finally compiling the sources::

$ mkdir boiteselec-server/build
$ qmake -config release -o ../build/Makefile boiteselec-server/src/be-server.pro;
$ cd boiteselec-server/build
$ make
7 changes: 5 additions & 2 deletions doc/HOME.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ Table of content
================

*HOME*
Presentation of the application
Presentation of the application.

*COMPILING*
How to build the program from the source.

*SETUP*
How to install and setup the server
How to install and setup the server.

*INTERACTION*
How client and server interact with each other.
Expand Down
3 changes: 2 additions & 1 deletion doc/INTERACTION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ General informations
To communicate, client and server use the OSC protocol.

By default, the server uses the IP address ``192.170.0.1``, with the port ``9988`` to send messages and ``9989`` to receive them.
These values can be changed in the configuration file.

Protocol
--------
Expand Down Expand Up @@ -97,4 +98,4 @@ The client can receive the following messages from the server to access its info

``/box/tracks_list <str>``
Send the informations of the selected song's tracks, as ``<str>``.
``<str>` is the concatenation of the songs' tracks' names, separated by the character ``|``.
``<str>`` is the concatenation of the songs' tracks' names, separated by the character ``|``.
35 changes: 23 additions & 12 deletions doc/SETUP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Installation
Basic Installation
~~~~~~~~~~~~~~~~~~

Just clone the repository on the Raspberry Pi and follow the instructions of the ``COMPILING.rst`` page.

.. _daemonized:

Daemonizing
Expand All @@ -16,9 +18,9 @@ To make the server running in the background automatically on the RasPi startup,

First, copy the ``be-server`` executable file to ``/opt/boites-electriques/``, and the ``be-server.sh`` script (located in the repo's ``share/`` directory) to ``/etc/init.d/be-server``::

sudo mkdir /opt/boites-electriques
sudo cp build/be-server /opt/boites-electriques/be-server
sudo cp share/be-server.sh /etc/init.d/be-server
$ sudo mkdir /opt/boites-electriques
$ sudo cp build/be-server /opt/boites-electriques/be-server
$ sudo cp share/be-server.sh /etc/init.d/be-server

You can then edit the ``/etc/init.d/be-server`` to change the following values:

Expand All @@ -38,26 +40,26 @@ You can then edit the ``/etc/init.d/be-server`` to change the following values:
Name of the program.
Default : ``"be-server"``

Then, we give the right permissions to the daemonizing script and reload the system's daemons::
Then, we give the right permissions to the daemonizing script and reload the system's daemons (as root or with ``sudo``)::

sudo chmod 0755 /etc/init.d/be-server
sudo systemctl daemon-reload
# chmod 0755 /etc/init.d/be-server
# systemctl daemon-reload

We can then test the script::

sudo /etc/init.d/be-server start
# /etc/init.d/be-server start
[ ok ] Starting be-server (via systemctl): be-server.service
sudo /etc/init.d/be-server stop
# /etc/init.d/be-server stop
[....] Stopping be-server (via systemctl): be-server.service

And add it to the startup scripts::
sudo update-rc.d be-server defaults
# update-rc.d be-server defaults

To remove it::

sudo update-rc.d -f be-server remove
# update-rc.d -f be-server remove

Configuration
-------------
Expand All @@ -68,17 +70,21 @@ General informations
The server's configuration is saved in the ``config.txt`` file in the same folder as the executable.
This file is formatted with the (almost) standard `INI file format <https://en.wikipedia.org/wiki/INI_file>`_.

By default (if the server is ran without the ``--config`` option), the configuration file is ``~/.config/Rock & Chanson/Boites Electriques.ini``.

The missing fields in the file will automatically be filled at the execution.

The following options are available :

``[default]`` section
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``threshold``
Default threshold's value (integer).
Default threshold value (integer).
Default : ``200``

``master``
Default master volume's value (integer).
Default master volume (integer).
Default : ``50``

``volume``
Expand Down Expand Up @@ -130,3 +136,8 @@ Run
---

To start the server, just run ``./be-server``, or ``sudo /etc/init.d/be-server start`` if the server has been daemonized_.

The following options are available :

``-c``, ``--config <filepath>``
Define the ``<filepath>`` file as the configuration file.

0 comments on commit 36e956e

Please sign in to comment.