update & cleanup
[profile/ivi/audiomanager.git] / README
1 GENIVI AUDIOMANAGER
2
3 Copyright (C) 2011, BMW AG
4
5 Datum  20.05.2011
6 author Christian Müller (christian.ei.mueller@bmw.de)
7
8 ***********************************************************************************************************
9 LICENSE
10 ***********************************************************************************************************
11
12 GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
13 Copyright (C) 2011, BMW AG – Christian Müller  Christian.ei.mueller@bmw.de
14
15 This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
16 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
17 You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
18 Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
19 Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
20 As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
21 Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
22
23 Version 0.2
24
25 ***********************************************************************************************************
26 COMPILE PROGRAMS
27 *********************************************************************************************************
28
29 You will need some packages in order to comile the GENIVI AudioManager Proof of Concept, these are:
30 -QT4
31 -automotive-dlt
32 -jack
33 -jackeq
34 -jack control
35 -dbus
36 -sqlite
37 -glib >=2.0
38 -gstreamer-base-0.10
39 -gstreamer-plugins-base-0.10
40 -gstreamer-plugins
41 -gstreamer0.10-pulseaudio
42 -gstreamer0.10-plugins-good
43 -phonon
44 -phonon-backend-gstreamer
45 -doxygen
46
47 More details in the CMake Files CmakeList.txt in the projects
48
49 on the top level of the folder you just received, there is a shall script "cmaker.sh" which can be invoked with a lot of different parameters. Invoking it with:
50
51 sh cmaker.sh all all
52
53 will create all neccessary folders and compile all plugins and applications except the PulseAudio Plugin.
54
55 after the script finished, you should have:
56
57 a /bin folder which contains: 
58         AudioGui  
59         AudioManager  
60         Bild1.png  
61         PlayerGui
62
63 a /build folder which has all build objects (erase that if you need a clean build)
64
65 a /doc folder which contains subfolders with the doxygen documentation:
66         AudioGui  
67         AudioManager  
68         DBusPlugin  
69         JackPlugin  
70         PlayerGUI  
71         PluginTest
72
73 ***********************************************************************************************************
74 COMPILE PULSEAUDIO
75 ***********************************************************************************************************
76
77 For the pulseaudio plugin, you will need to do the following steps:
78
79 - if you have pulseaudio installed (e.g. you have vanilla ubuntu), remove it with the package manager 
80
81         apt-get purge pulseaudio
82
83 - remove all packages of modules as well (there can be only one server of course)
84 - download the source code from pulseaudio
85
86         wget http://freedesktop.org/software/pulseaudio/releases/pulseaudio-0.9.22.tar.gz
87
88 - patch was developed and tested with verisopn 0.9.22 but newer versions could do as well and unpack it
89
90         tar xvf pulseaudio-0.9.22.tar.gz
91
92 - cd into the unpacked pulseaudio directory:
93
94         cd pulseaudio-0.9.22
95
96 - copy the patchfile into the pulseaudio directory
97
98         cp ../genivipulseaudio.patch .
99
100 -apply the patchfile genivipulseaudio.patch with 
101
102         patch -p1 -i genivipulseaudio.patch 
103
104 - what follows is the normal compiling process of pulseaudio, first bootstrap:
105
106         ./bootstrap.sh
107
108 - then configure
109         
110         ./configure.sh
111
112 - check the output, the summary file should look similar to this:
113
114     Have X11:                      no
115     Enable OSS Output:             yes
116     Enable OSS Wrapper:            yes
117     Enable Alsa:                   yes
118     Enable Solaris:                no
119     Enable GLib 2.0:               yes
120     Enable Gtk+ 2.0:               yes
121     Enable GConf:                  no
122     Enable Avahi:                  yes
123     Enable Jack:                   yes
124     Enable Async DNS:              no
125     Enable LIRC:                   no
126     Enable HAL:                    no
127     Enable udev:                   yes
128     Enable HAL->udev compat:       yes
129     Enable BlueZ:                  no
130     Enable TCP Wrappers:           no
131     Enable libsamplerate:          yes
132     Enable IPv6:                   yes
133     Enable OpenSSL (for Airtunes): no
134     Enable tdb:                    no
135     Enable gdbm:                   no
136     Enable simple database:        yes
137     Enable Genivi support          yes
138     System User:                   pulse
139     System Group:                  pulse
140     Access Group:                  pulse-access
141     Enable per-user EsounD socket: yes
142     Force preopen:                 no
143     Preopened modules:             all
144
145     at least we should have alsa, Jack, udev, libsamplerate, Genivi, Glib 2.0 .... if not install missing packages and start again
146
147 - ok, lets go with
148
149         make -j4 all
150
151 To adjust to your system, you can modify the file "Genivi.conf" witch can be found in pulseaudio-0.9.22/src. Here you can define the sources and sinks
152 that are presented to the audiomanager by the routingadaptor in the pulseaudio genivi module.
153
154
155 ***********************************************************************************************************
156 START 
157 ***********************************************************************************************************
158
159 First we need to start Jack. This can be done via very easy via 
160
161         qjackctl
162
163 if you cannot install it via packagemanager, you can dowload it here: http://qjackctl.sourceforge.net/
164
165 Since we deinstalled pulse, jack will grab the hardwarecontrols if it is started, that is contra productive, so we make sure that the server runs virtual. Within
166 qjackctl, you can select the settings tab and take as driver "dummy", or you start jackd with the following command:
167
168         /usr/bin/jackd -T -P62 -t1000 -m -ddummy -r44100 -p256
169
170 or write this command in your home into the .jackdrc file
171
172 If you want to have the same as the demo in Dublin, start now the jack equalizer (if you don't have: http://jackeq.sourceforge.net/ or packagemanager)
173
174         /usr/bin/jackeq
175
176 Now it's time to start pulseaudio, since we need to start it with a special configuration, get into the pulseaudio directory and run
177
178         src/pulseaudio -n -F src/default.pa -p $(pwd)/src/.libs/ -vvvv
179
180 The next step is to start the DLT server
181
182         dlt-daemon
183
184 And a dlt client if you want to see something.
185 Then get into the /bin directory of the workspace where the binaries where created and run in the following order:
186
187         ./AudioManager
188
189 This starts the audiomanager, you should already get some output on the DLT
190
191         ./AudioGui
192
193 starts the Test GUI, you can now connect and disconnect already, changing volumes works via double click on the sinks
194
195         ./PLayerGui player youraudiofile.mp3 
196
197 starts the player application, please choose cool music.
198 To test Traffic announcements, you need to create a folder on the workspace, same level as bin, called "music" and put an mp3 in there. please rename it to "ta.mp3", this file
199 is taken to play the traffic announcement.
200
201         ./PlayerGui ta
202
203 Same for navigation, the file needs to have the name "music/navi.mp3"
204
205         ./PLayerGui navigation 
206
207
208 ***********************************************************************************************************
209 Tips 
210 ***********************************************************************************************************
211 If you want to use the codebase with eclipse, define the main level of the git as workspace and import the projects as c++ makefile projects.
212 Git is setup in a way that the settings are ignored when committing.
213 To use make out of eclipse them, replace the default make command "make" with something like
214 "make -j4 -C ../build/AudioManagerDeamon VERBOSE=1" (exchaning the name of the Project in respect to the plugin whatever. 
215
216 ***********************************************************************************************************     
217
218                                  _..-------++._
219                              _.-'/ |      _||  \"--._
220                        __.--'`._/_\j_____/_||___\    `----.
221                   _.--'_____    |          \     _____    /
222                 _j    /,---.\   |        =o |   /,---.\   |_
223                [__]==// .-. \\==`===========/==// .-. \\=[__]
224                  `-._|\ `-' /|___\_________/___|\ `-' /|_.'     
225                        `---'                     `---'
226
227
228