* [GAM-35] implement DBus for SESSION or SYSTEM bus
[profile/ivi/audiomanager.git] / README
1 ***********************************************************************************************************
2 GENIVI AudioManager
3 ***********************************************************************************************************
4
5 Copyright (C) 2012, GENIVI Alliance, Inc.
6 Copyright (C) 2012, BMW AG
7
8 This file is part of GENIVI Project AudioManager.
9  
10 Contributions are licensed to the GENIVI Alliance under one or more
11 Contribution License Agreements.
12  
13 copyright
14 This Source Code Form is subject to the terms of the
15 Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with
16 this file, You can obtain one at http://mozilla.org/MPL/2.0/.
17  
18 author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
19
20 For further information see http://www.genivi.org/.
21
22 ***********************************************************************************************************
23 License
24 ***********************************************************************************************************
25 The licenses of this project are split into two parts:
26 1) the AudioManagerDaemon, licensed under MPL 2.0
27 2) all other parts that serve as example code that can be taken to build up an own project with it -
28     these parts are licensed with the MIT license
29     
30 Contribution is done under GENIVI CLA. 
31
32 ***********************************************************************************************************
33 Version
34 ***********************************************************************************************************
35 The current version can be taken out of the git. The version 1.0.0 is the first GENIVI compliant code, 
36 in the compliance statement of discovery (2.0)
37
38 ***********************************************************************************************************
39 COMPILE PROGRAMS
40 ***********************************************************************************************************
41 - compile options with default values:
42
43      CMAKE_BUILD_TYPE                                                                                                                                       
44      CMAKE_INSTALL_PREFIX             /usr/local                                                                                                            
45      GLIB_DBUS_TYPES_TOLERANT         ON                                                                                                                    
46      USE_BUILD_LIBS                   ON                                                                                                                    
47      WITH_DBUS_WRAPPER                ON                                                                                                                    
48      WITH_DLT                         ON                                                                                                                    
49      WITH_DOCUMENTATION               OFF                                                                                                                   
50      WITH_MAIN                        ON                                                                                                                    
51      WITH_PLUGIN_COMMAND              ON                                                                                                                    
52      WITH_PLUGIN_CONTROL              ON                                                                                                                    
53      WITH_PLUGIN_ROUTING              ON                                                                                                                    
54      WITH_PPOLL                       ON                                                                                                                    
55      WITH_TELNET                      ON                                                                                                                    
56      WITH_TESTS                       ON 
57  
58
59 In order to change these options, you can modify this values with ccmake, do the appropriate changes in 
60 CmakeList.txt or via the commandline for cmake or (when installed via ccmake)
61
62 You will need some packages in order to comile the GENIVI AudioManager Daemon, these are:
63         -dbus (only when DBUS_WRAPPER==ON) [tested on version 1.2.16]
64         -sqlite3 [tested on version 3.6.22]
65         -automotive-dlt [greater 2.5.0]                
66         -doxygen (only when WITH_DOCUMENTATION==ON) [tested on version 1.6.3]
67
68         to install them in a build environment like Ubuntu you can use:
69                 sudo apt-get install libdbus-1-dev libsqlite3-dev doxygen git cmake build-essential
70
71 For building the tests, you will need the following packages:
72         -google mock [tested on version 1.6.0-1] 
73         -google test [tested on version 1.6.0]
74         -python [tested on version 2.6]
75
76         to install them in a build environment like Ubuntu you can use:
77                 sudo apt-get install libgtest-dev google-mock python2.6-dev
78
79 More details in the CMake Files CmakeList.txt in the projects.
80
81 The build was tested on a freshly setup LinuxMint 12 (don't like Unity) with the following steps:
82         sudo apt-get update
83         sudo apt-get upgrade
84         sudo apt-get install libdbus-1-dev libsqlite3-dev doxygen libgtest-dev google-mock git cmake 
85              build-essential python2.6-dev
86
87         git clone https://<kavi-account>:<kavi-password>@git.genivi.org/srv/git/AudioManager
88
89 In order to build the project (out of source build), please follow these instructions on the commandline:
90
91         mkdir /build
92         cd build
93         cmake ..
94         make -j4
95
96 after the script finished, you should have:
97
98         a bin/ folder which contains all executables and the libraries: 
99         a build/ folder which has all build objects (erase that if you need a clean build)
100         a doc/ folder in case you turned the documentation on
101
102 in order to install the AudioManager, you can do
103
104         sudo make install
105
106 package generation is supported via CPack. To build packages, you have to 
107
108         make genivi_package
109
110 this will create one package if your CMake version is < 2.8.5 (all binaries stripped):
111         
112         AudioManager-<git verison>-Linux.deb 
113
114 if your version is above, you will get 4 packages (all binaries stripped) :
115         
116         AudioManager-<git verison>-Linux-bin.deb                [AudioManager binary]
117         AudioManager-<git verison>-Linux-dev.deb                [header files needed to compile plugins]
118         AudioManager-<git verison>-Linux-sampleplugins.deb      [sample plugins]
119         AudioManager-<git verison>-Linux-tests.deb              [tests including tests for sample plugins, 
120                installed in the ~/AudioMAnagerTests]
121
122 to create a tar.gz file of all sources (not including .git, build and bin folder,config files), you can do:
123
124         make package_source     
125
126 This will create the following package:
127
128         AudioManager-<git verison>-Source.tar.gz
129
130 All packages will be placed in a folder called packages
131
132 The commandline options of the AudioManager:
133
134         Usage:  AudioManagerDaemon [options]
135         options:        
136         
137     -h: print this message  
138     -i: info about current settings     
139     -v: print version   
140     -V: print DLT logs to stdout    
141     -d: daemonize AudioManager  
142     -T: DbusType to be used by CAmDbusWrapper (0=DBUS_SESSION[default], 1=DBUS_SYSTEM)  
143     -p<path> path for sqlite database (default is in memory)    
144     -t<port> port for telnetconnection  
145     -m<max> number of max telnetconnections 
146     -c<Name> use controllerPlugin <Name> (full path with .so ending)    
147     -l<Name> replace command plugin directory with <Name> (full path)   
148     -r<Name> replace routing plugin directory with <Name> (full path)   
149     -L<Name> add command plugin directory with <Name> (full path)   
150     -R<Name> add routing plugin directory with <Name> (full path)       
151
152
153 ***********************************************************************************************************
154 Telnet Server
155 ***********************************************************************************************************
156 The audiomanager has a build- in telnetserver that serves for debuggin purposes.
157 If you compile your AudioManager with TelnetServer support (cmake -DWITH_TELNET=ON), you will be able to 
158 set with commandline argument -t the port number and with -m the maximum supported connections. 
159 The default telnet port is 6060. 
160    
161    For example, launch a telnet session on port 6060:
162       telnet localhost 6060
163    
164       #>Welcome to GENIVI AudioManager ver-0.0.1-37-ga004215
165       #>
166    
167    press 'help' to get a list of all supported commands on this level:
168    
169       #>help
170       ####################################################
171       ####### The following commands are supported: ######
172       ####################################################
173       #
174       #exit  - quit telnet session
175       #get   - Go into 'get'-submenu
176       #help  - show all possible commands
177       #info  - Go into 'info'-submenu
178       #list  - Go into 'list'-submenu
179       #set   - Go into 'set'-submenu
180       #
181       #\>
182    
183    Now type one of these commands, for example 'get', followed with another 'help' to get a list of supported commands:
184    
185       #\>get
186       #
187       #\Get>help
188       ####################################################
189       ####### The following commands are supported: ######
190       ####################################################
191       # 
192       #.. - one step back in menu tree (back to root folder)
193       #exit  - close telnet session
194       #help  - show all possible commands
195       #recv  - show receiverversion 
196       #routing  - show current routing
197       #sendv - show senderversion
198       #
199       #\Get>
200    
201    You can also execute several commands in a line:
202    
203       #\Get>recv sendv .. help exit
204       #   Receiver versions:
205       #   Ctrl: 1 | Cmd: 1 | Routing: 1
206       #   Sender versions:
207       #   Ctrl: 1 | Cmd: 1 | Routing: 1
208       ####################################################
209       ######## The following commands are supported: ######
210       ####################################################
211       #
212       #exit  - quit telnet session
213       #get   - Go into 'get'-submenu
214       #help  - show all possible commands
215       #info  - Go into 'info'-submenu
216       #list  - Go into 'list'-submenu
217       #set   - Go into 'set'-submenu
218       #
219       #Your wish is my command ... bye!
220       #Connection closed by foreign host.
221
222
223 ***********************************************************************************************************
224 Code Formatting
225 ***********************************************************************************************************
226 The source code if formatted with eclipse, the style sheet used can be found in the cmake folder:
227 cmake/AudioManager_Codestyle.xml
228
229 ***********************************************************************************************************
230 Working on the code & contribution
231 ***********************************************************************************************************
232 First get the code from the git:
233         git clone https://<kavi-account>:<kavi-password>@git.genivi.org/srv/git/AudioManager
234
235 Get an overview of all branches:
236         git branch
237
238 Switch to the branch you want to work on (see versioning schmeme, the master is the feature branch) 
239 and verify that it has switched (* changed)
240         git checkout <your branch>
241         git branch
242
243 Best practice is to create a local branch based on the current branch:
244         git branch working_branch
245
246 Start working, best practice is to commit smaller, compilable peaced during the work that makes it easier to 
247 handle later on.
248
249 If you want to commit you changes, send them to the audiomanager-dev list, you can create a patch like this:
250         git format-patch working_branch <your branch>
251
252 This creates a set of patches that are published via the mailing list (this is already the submission under CLA). 
253 The patches will be discussed and then merged & uploaded on the git. For more information about git checkout the 
254 Genivi wiki and the stuff on the web.
255
256
257                                  _..-------++._
258                              _.-'/ |      _||  \"--._
259                        __.--'`._/_\j_____/_||___\    `----.
260                   _.--'_____    |          \     _____    /
261                 _j    /,---.\   |        =o |   /,---.\   |_
262                [__]==// .-. \\==`===========/==// .-. \\=[__]
263                  `-._|\ `-' /|___\_________/___|\ `-' /|_.'     
264                        `---'                     `---'