D-Bus method hanlers should reply back, even if the return type is void else timeout...
[profile/ivi/genivi/genivi-audio-manager.git] / README
1 GENIVI_AudioManager
2 ===================
3 :Author: Christian Linke <christian.linke@bmw.de>
4 :doctitle: GENIVI_AudioManager
5
6 Copyright
7 ---------
8 Copyright (C) 2012, GENIVI Alliance, Inc.
9 Copyright (C) 2012, BMW AG
10
11 This file is part of GENIVI Project AudioManager.
12  
13 Contributions are licensed to the GENIVI Alliance under one or more
14 Contribution License Agreements or MPL 2.0 .
15  
16 (C) Copyright
17 This Source Code Form is subject to the terms of the
18 Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with
19 this file, You can obtain one at http://mozilla.org/MPL/2.0/.
20  
21 author Christian Mueller, christian.linke@bmw.de BMW 2011,2012
22
23 For further information see http://projects.genivi.org/audio-manager/.
24
25 == License
26 The licenses of this project are split into two parts:
27 1) the AudioManagerDaemon, licensed under MPL 2.0
28 2) all other parts that serve as example code that can be taken to build up an own project with it -
29     these parts are licensed with the MIT license
30     
31 Contribution is done under GENIVI CLA or MPL2.0. 
32
33 == Version
34 The current version can be taken out of the git. The version 1.0.0 is the first GENIVI compliant code,in the compliance statement of discovery (2.0). 
35 For every GENIVI release, there is a release of the AudioManager, each of the releases have an own bugfix branch that will get the most important fixes.
36 Development is done on the master branch.
37
38 === Versioning Scheme
39 The versioning scheme was decided in the February face2face 2012.
40 The firs number describes the release branch. This is 1 for discovery, 2 for excalibur and 3 for photon. For major features or release, the second number will be increased.
41 Each new GENIVI version (releases are every half year, around april and october) will get the current HEAD (for example 2.0.34 for excalibur) and release with the increase of the second number (2.1).
42 The next commit on the master branch gets then the new first numner (3) and starts from zero.
43
44 For the daemon the third number (for example 1.0.X) describes the patch version. The versions are automatically created by git during the build process.
45 The versioning scheme is used for the AudioManager daemon itself and for each of it's interfaces. The versioning of the Interfaces in EA is defined via the tag "version" and the name of the interfaceversion versionName, for example "CommandReceiveVersion". This information is generated into the interface header files and is used then by cmake to set the interface versions.
46 Whenever changes are done, the minor version of the interface needs to be incremented.
47
48 == Documentation
49 A very detailed documentation is provided by doxygen. In order to use this, please compile the AudioManager with
50 ----
51 cmake -DWITH_DOCUMENTATION=ON
52 make
53 ----
54
55 == COMPILE PROGRAMS
56
57 === Compile Options
58 These are the compile options with default values:
59
60  BUILD_SHARED_LIBS                OFF                                                                                                            
61  CMAKE_BUILD_TYPE                                                                                                                                
62  CMAKE_INSTALL_PREFIX             /usr/local                                                                                                     
63  GLIB_DBUS_TYPES_TOLERANT         ON                                                                                                             
64  USE_BUILD_LIBS                   ON                                                                                                             
65  WITH_DBUS_WRAPPER                ON                                                                                                             
66  WITH_DLT                         ON                                                                                                             
67  WITH_DOCUMENTATION               OFF                                                                                                                                                                                                                      
68  WITH_PLUGIN_COMMAND              ON                                                                                                             
69  WITH_PLUGIN_CONTROL              ON                                                                                                             
70  WITH_PLUGIN_ROUTING              ON                                                                                                             
71  WITH_SYSTEMD_WATCHDOG            OFF                                                                                                            
72  WITH_TELNET                      ON                                                                                                             
73  WITH_TESTS                       ON 
74  WITH_NSM                                                 ON                                                                                                            
75  gmock_build_tests                OFF                                                                                                            
76  gtest_build_samples              OFF                                                                                                            
77  gtest_build_tests                OFF                                                                                                            
78  gtest_disable_pthreads           OFF                                                                                                            
79  gtest_force_shared_crt           OFF     
80
81 === Passing options to cmake:
82
83 .-DVERSION="XXX"
84 When building the AudioManager without taking it from the git (and thus having a .git folder), you can set the version via passing _-DVERSION="XXX"_ to cmake.
85
86 .-DDBUS_SERVICE_PREFIX="XXX"
87 sets the service prefix for Dbus, default "org.genivi.audiomanager\0"
88
89 .-DDBUS_SERVICE_OBJECT_PATH="XXX"
90 sets the object path for Dbus, default "/org/genivi/audiomanager\0"
91
92 .-DDEFAULT_TELNETPORT="XXX"
93 sets the default telnetport, default 6060. Can be overwriten by command line parameter
94
95 .-DMAX_TELNETCONNECTIONS="XXX"
96 sets the default maximum number of telnetconnections, default is 3
97
98 .-DNSM_PATH="XXX"
99 sets the path of the NSM DBUS interface
100
101 .-DNSM_INTERFACE="XXX"
102 sets the interface to the NSM DBUS interface
103
104 In order to change these options, you can modify this values with ccmake, do the appropriate changes in 
105 CmakeList.txt or via the commandline for cmake or (when installed via ccmake)
106
107 === Build dependencies
108 You will need to fullfill some dependencies in order to comile the GENIVI AudioManager Daemon, these are:
109
110 * dbus (only when DBUS_WRAPPER==ON) [tested on version 1.2.16]
111 * sqlite3 [tested on version 3.6.22]
112 * automotive-dlt [greater 2.5.0]                
113 * doxygen (only when WITH_DOCUMENTATION==ON) [tested on version 1.6.3]
114
115 To install them in a build environment like Ubuntu you can use:
116 ----
117 sudo apt-get install libdbus-1-dev libsqlite3-dev doxygen git cmake build-essential
118 ----
119
120 === The NodeStateManager
121
122 The nodestatemanager headers are needed to compile the audiomanager. If the nodestatemanagerincludes are not found, 
123 the headers shipped with the audiomanager are used.
124 The nodestatemanager can be retrieved from projects.genivi.org . You can install the headers on you system by
125
126 ----
127 sudo make install-includeHEADERS
128 ----
129
130 For building the tests, you will need the following packages:
131
132 * python [tested on version 2.6, should work on higher versions as well]
133
134 GoogleMock and GoogleTest are as source code integrated in the sourcetree
135 To install them in a build environment like Ubuntu you can use:
136 ----
137 sudo apt-get install python2.6-dev
138 ----
139
140 For compiling, you will need a compiler, linker etc. On most linux systems you will get this via
141 ----
142 sudo apt-get install build-essential
143 ----
144
145 More details in the CMake Files CmakeList.txt in the projects.
146
147 === Compiling
148 To compile open a shell, browse to the AudioManager folder and 
149 ----
150 mkdir /build
151 cd build
152 cmake ..
153 make
154 ----
155
156 After the script finished, you should have:
157
158 * a bin/ folder which contains all executables and the libraries: 
159 * a build/ folder which has all build objects (erase that if you need a clean build)
160 * a doc/ folder in case you turned the documentation on
161
162 In order to install the AudioManager, you can do
163 ----
164 sudo make install
165 ----
166
167 Package generation is supported via CPack. To build packages, you have to 
168 ----
169 make genivi_package
170 ----
171
172 This will create one package if your CMake version is < 2.8.5 (all binaries stripped):
173 ----
174 AudioManager-<git verison>-Linux.deb 
175 ----
176
177 If your version is above 2.8.5, you will get 4 packages (all binaries stripped) :
178         
179 * AudioManager-<git verison>-Linux-bin.deb              [AudioManager binary]
180 * AudioManager-<git verison>-Linux-dev.deb              [header files needed to compile plugins]
181 * AudioManager-<git verison>-Linux-sampleplugins.deb    [sample plugins]
182 * AudioManager-<git verison>-Linux-tests.deb            [tests including tests for sample plugins, installed in the ~/AudioMAnagerTests]
183
184 In order to create a tar.gz file of all sources (not including .git, build and bin folder,config files), you can do:
185 ----
186 make package_source                     
187 ----
188
189 This will create the following package:
190 'AudioManager-<git verison>-Source.tar.gz'
191
192 All packages will be placed in a folder called packages
193
194 === Adding own plugins
195 Since the AudioManager needs to be completed with on plugins before it can be used, it provides a mechanism to keep the own sources away from the GENIVI code but compile them together.
196
197 TIP: Using this feature is simple: +
198 Just add a folder with the name _ProjectSpecific_ (be sure to name it excactly like this!) on the main level of the AudioManager folder. CMake will look for CMakeLists.txt in this folder and add all files that it finds in /include to the include path. You can use this to add subfolders with your own plugins and includes, and overwrite productspecific.h for example.
199
200 .Here is a sample CMakeLists.txt that can be placed in ProjectSpecific folder:
201 ----
202 cmake_minimum_required(VERSION 2.6)
203
204 ### set your own buildflags:
205 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=c++98 -D_GNU_SOURCE -pedantic -Wno-variadic-macros")
206
207 ##overwrite priojecttypes.h:
208 CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/ProjectSpecific/overwrite/projecttypes.h ${CMAKE_SOURCE_DIR}/include/projecttypes.h COPYONLY)
209
210 if(WITH_PLUGIN_ROUTING)
211         add_subdirectory (../PluginRoutingInterfaceMyRoutingPlugin ${CMAKE_CURRENT_BINARY_DIR}/PluginRoutingInterfaceMyRoutingPlugin )
212 endif(WITH_PLUGIN_ROUTING)
213
214 if(WITH_PLUGIN_CONTROL)
215         add_subdirectory ( ../PluginControlInterfaceMyControlPlugin ${CMAKE_CURRENT_BINARY_DIR}/PluginControlInterfaceMyControlPlugin)
216 endif(WITH_PLUGIN_CONTROL)
217
218 ----
219
220 === CommandLine options
221 The commandline options of the AudioManager:
222
223 ----
224 AudioManagerDaemon Version: 3.0.11
225 Usage:  AudioManagerDaemon [options]
226 options:        
227         -h: print this message  
228         -i: info about current settings         
229         -v: print version       
230         -d: daemonize AudioManager      
231         -T: DbusType to be used by CAmDbusWrapper (0=DBUS_SESSION[default], 1=DBUS_SYSTEM)      
232         -p<path> path for sqlite database (default is in memory)        
233         -t<port> port for telnetconnection      
234         -m<max> number of max telnetconnections 
235         -c<Name> use controllerPlugin <Name> (full path with .so ending)        
236         -l<Name> replace command plugin directory with <Name> (full path)       
237         -r<Name> replace routing plugin directory with <Name> (full path)       
238         -L<Name> add command plugin directory with <Name> (full path)   
239         -R<Name> add routing plugin directory with <Name> (full path)   
240 ----    
241
242
243 == Telnet Server
244 The audiomanager has a build- in telnetserver that serves for debuggin purposes.
245 If you compile your AudioManager with TelnetServer support (cmake -DWITH_TELNET=ON), you will be able to 
246 set with commandline argument -t the port number and with -m the maximum supported connections. 
247 The default telnet port is 6060. 
248    
249 .For example, launch a telnet session on port 6060:
250       telnet localhost 6060
251    
252       #>Welcome to GENIVI AudioManager ver-0.0.1-37-ga004215
253       #>
254    
255 .press 'help' to get a list of all supported commands on this level:
256    
257       #>help
258       ####################################################
259       ####### The following commands are supported: ######
260       ####################################################
261       #
262       #exit  - quit telnet session
263       #get   - Go into 'get'-submenu
264       #help  - show all possible commands
265       #info  - Go into 'info'-submenu
266       #list  - Go into 'list'-submenu
267       #set   - Go into 'set'-submenu
268       #
269       #\>
270    
271 .Now type one of these commands, for example 'get', followed with another 'help' to get a list of supported commands:
272    
273       #\>get
274       #
275       #\Get>help
276       ####################################################
277       ####### The following commands are supported: ######
278       ####################################################
279       # 
280       #.. - one step back in menu tree (back to root folder)
281       #exit  - close telnet session
282       #help  - show all possible commands
283       #recv  - show receiverversion 
284       #routing  - show current routing
285       #sendv - show senderversion
286       #
287       #\Get>
288    
289 .You can also execute several commands in a line:
290    
291       #\Get>recv sendv .. help exit
292       #   Receiver versions:
293       #   Ctrl: 1 | Cmd: 1 | Routing: 1
294       #   Sender versions:
295       #   Ctrl: 1 | Cmd: 1 | Routing: 1
296       ####################################################
297       ######## The following commands are supported: ######
298       ####################################################
299       #
300       #exit  - quit telnet session
301       #get   - Go into 'get'-submenu
302       #help  - show all possible commands
303       #info  - Go into 'info'-submenu
304       #list  - Go into 'list'-submenu
305       #set   - Go into 'set'-submenu
306       #
307       #Your wish is my command ... bye!
308       #Connection closed by foreign host.
309
310
311
312 == Code Formatting
313 The source code if formatted with eclipse, the style sheet used can be found in the cmake folder:
314 ----
315 cmake/AudioManager_Codestyle.xml
316 ----
317
318 == Working on the code & contribution
319
320 .First get the code from the git:
321         git clone 
322
323 .Get an overview of all branches:
324         git branch
325
326 .Switch to the branch you want to work on (see versioning schmeme, the master is the feature branch) and verify that it has switched (* changed)
327         git checkout <your branch>
328         git branch
329
330 .Best practice is to create a local branch based on the current branch:
331         git branch working_branch
332
333 Start working, best practice is to commit smaller, compilable peaced during the work that makes it easier to 
334 handle later on.
335
336 .If you want to commit you changes, send them to the audiomanager-dev list, you can create a patch like this:
337         git format-patch working_branch <your branch>
338
339 This creates a set of patches that are published via the mailing list.The patches will be discussed and then merged & uploaded on the git by the maintainer.
340
341 Patches can be accepted either under GENIVI Cla or MPL 2.0 (see section License). Please be sure that the signed-off-by is set correctly. For more, check out http://gerrit.googlecode.com/svn/documentation/2.0/user-signedoffby.html
342
343
344
345 ----
346                                             _             _ _       __  __                                   
347                                            / \  _   _  __| (_) ___ |  \/  | __ _ _ __   __ _  __ _  ___ _ __ 
348                                           / _ \| | | |/ _` | |/ _ \| |\/| |/ _` | '_ \ / _` |/ _` |/ _ \ '__|
349                                          / ___ \ |_| | (_| | | (_) | |  | | (_| | | | | (_| | (_| |  __/ |   
350                                         /_/   \_\__,_|\__,_|_|\___/|_|  |_|\__,_|_| |_|\__,_|\__, |\___|_|   
351                                                                                              |___/    
352
353
354
355
356                                                                         QQ
357                                                                         QQ[
358                                                                   qaap
359                                                                   )4W? ayQap
360                                                                        4QQQ[
361                                                               .awQap   ==
362                                                                $WWQF   aaaa,
363                                                                  `    QWQWQQ
364                                                             _aaap=    J?QQP'|
365                                                            qQQWQQ6    -      qyQQQgp
366                                                            )4QQQQ^ .yQQQQ,   QQQQQQQ
367                                                          aa         4QQQW'   )?QQQP'  gmQQma
368                                                        ]QQQQp         .               WQQQQW
369                                                         ????    aQQQ6p    _aQQQQa      "??"+
370                                                        qaaa,   ]QQQQQQ    jQQQQQQf   -aaaap
371                                                       jQQWWQ    )????'    )4QQQQP'   mQWQWQf
372                                                       ]WQQQQ    jaaa                 QQQQQQf
373                                                       )WQQQQ   yQQWWQp    ayQQQap    QQQQQQf
374                                                       )QQQQQ   QQQQQQf   ]QQQQQQQ,   QQQQQQf
375                                                       ]QQQQD   QQQQQQf   ]QQQQQQQ[   QQQQQQf
376                                                         ??':   QQQQQQf   ]QQQQQQQ[   4QQQQQf
377                                                                QQQQQQf   ]QQQQQQQ[   =????'I
378                                                                QQQQQQf   ]QQQQQQQ[
379                                                               .4QQQQQ'   ]QQQQQQQ[
380                                                                 ]??"-    ]QQQQQQQ(
381                                                                          ]4QQQQQ?
382                                                                            :
383
384                             qaayQQQQQQQQQwaa   ]mmmmmmmmmmmmmm  ]mmmmmmg,     ]mmm[  ]mmmm  4mmmg         ymmm' ]mmmm pwLq
385                            jQQQQD???????QWWQf  ]QQQP??????????  ]QQQWQQQQp    ]QQQf  ]QQQQ   4QQQ6.     _yQQQ'  ]QQQQ \!'a'
386                            ]QQQf        )???'  ]QQQ6aaaaaaaaap  ]QQQf)4QQQ6,  ]QQQf  ]QQQQ   |4QQQ6    jmQQQ'v  ]QQQQ
387                            ]QQQ[   ]QQQQWWQQf  ]QQQQQQQWQWQWQf  ]QQQf  ?QQQQa ]QQQf  ]QQQQ    i4QQQ6  qQQQQ'    ]QQQQ
388                            ]QQQ6,   .   qQQQf  ]QQQf            ]QQQf   ]4QQQ6jQQQf  ]QQQQ      4QQQ6gQWQQ'     ]QQQQ
389                             4QQQQQQQQQQQQQQW'  ]QQQQQQWQWQWQWQ  ]QQQf    i?QQQQQQQf  ]QQQQ       ]QQQQQQQ'      ]QQQQ
390                             ++"??????????`     ]""!"""""""""""S ]""!'      ]"""!""'  -""!"        """!""'       ]""!"
391
392
393 ----