* made sure that CommonAPI stuff compiles with release 2.1
[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  COMMON_API_DBUS_LIBRARY          /usr/local/lib/libCommonAPI-DBus.so                                                                                                                                             
64  COMMON_API_LIBRARY               /usr/local/lib/libCommonAPI.so                                                                                                                                                  
65  GLIB_DBUS_TYPES_TOLERANT         ON                                                                                                                                                                              
66  USE_BUILD_LIBS                   ON                                                                                                                                                                              
67  WITH_COMMAND_INTERFACE_COMMON_   ON                                                                                                                                                                              
68  WITH_DATABASE_STORAGE            OFF                                                                                                                                                                             
69  WITH_DLT                         ON                                                                                                                                                                              
70  WITH_DOCUMENTATION               ON                                                                                                                                                                              
71  WITH_ENABLED_IPC                 CAPI                                                                                                                                                                            
72  WITH_LOGSTATE                    ON                                                                                                                                                                              
73  WITH_NSM                         ON                                                                                                                                                                              
74  WITH_OXF_ANIMATION               OFF                                                                                                                                                                             
75  WITH_OXF_TRACE                   OFF                                                                                                                                                                             
76  WITH_PLUGIN_COMMAND              ON                                                                                                                                                                              
77  WITH_PLUGIN_CONTROL              ON                                                                                                                                                                              
78  WITH_PLUGIN_ROUTING              ON                                                                                                                                                                              
79  WITH_ROUTING_INTERFACE_ASYNC     OFF                                                                                                                                                                             
80  WITH_ROUTING_INTERFACE_CAPI      ON                                                                                                                                                                              
81  WITH_SYSTEMD_WATCHDOG            OFF                                                                                                                                                                             
82  WITH_TELNET                      ON                                                                                                                                                                              
83  WITH_TESTS                       ON                                                                                                                                                                              
84  WITH_TEST_CONTROLLER             OFF                                                                                                                                                                             
85  gmock_build_tests                OFF                                                                                                                                                                             
86  gtest_build_samples              OFF                                                                                                                                                                             
87  gtest_build_tests                OFF                                                                                                                                                                             
88  gtest_disable_pthreads           OFF                                                                                                                                                                             
89  gtest_force_shared_crt           OFF 
90     
91 === Passing options to cmake:
92
93 .-DVERSION="XXX"
94 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.
95
96 .-DDBUS_SERVICE_PREFIX="XXX"
97 sets the service prefix for Dbus, default "org.genivi.audiomanager\0"
98
99 .-DDBUS_SERVICE_OBJECT_PATH="XXX"
100 sets the object path for Dbus, default "/org/genivi/audiomanager\0"
101
102 .-DDEFAULT_TELNETPORT="XXX"
103 sets the default telnetport, default 6060. Can be overwriten by command line parameter
104
105 .-DMAX_TELNETCONNECTIONS="XXX"
106 sets the default maximum number of telnetconnections, default is 3
107
108 .-DNSM_PATH="XXX"
109 sets the path of the NSM DBUS interface
110
111 .-DNSM_INTERFACE="XXX"
112 sets the interface to the NSM DBUS interface
113
114 In order to change these options, you can modify this values with ccmake, do the appropriate changes in 
115 CmakeList.txt or via the commandline for cmake or (when installed via ccmake)
116
117 === Build dependencies
118 Basically, all build dependencies are optional- but you might need to use some if you want to have support for Dbus,
119 for example...
120
121 You will need optionally fullfill some dependencies in order to comile the GENIVI AudioManager Daemon, these are:
122
123 * dbus (only when DBUS_WRAPPER==ON) [tested on version 1.2.16]
124 * sqlite3 [tested on version 3.6.22] (only when WITH_DATABASE_STORAGE==ON)
125 * automotive-dlt [greater 2.5.0] (only when WITH_DLT==ON)        
126 * doxygen [tested on version 1.6.3] (only when WITH_DOCUMENTATION==ON) 
127 * commonAPI [version > 2.1] (only with WITH_ENABLED_IPC CAPI), more information here http://projects.genivi.org/commonapi/
128
129 To install them in a build environment like Ubuntu you can use:
130 ----
131 sudo apt-get install libdbus-1-dev libsqlite3-dev doxygen git cmake build-essential
132 ----
133
134 === The NodeStateManager
135
136 The nodestatemanager headers are needed to compile the audiomanager. If the nodestatemanagerincludes are not found, 
137 the headers shipped with the audiomanager are used.
138 The nodestatemanager can be retrieved from projects.genivi.org . You can install the headers on you system by
139
140 ----
141 sudo make install-includeHEADERS
142 ----
143
144 For building the tests, you will need the following packages:
145
146 * python [tested on version 2.6, should work on higher versions as well]
147
148 GoogleMock and GoogleTest are as source code integrated in the sourcetree
149 To install them in a build environment like Ubuntu you can use:
150 ----
151 sudo apt-get install python2.6-dev
152 ----
153
154 For compiling, you will need a compiler, linker etc. On most linux systems you will get this via
155 ----
156 sudo apt-get install build-essential
157 ----
158
159 More details in the CMake Files CmakeList.txt in the projects.
160
161 === Compiling
162 To compile open a shell, browse to the AudioManager folder and 
163 ----
164 mkdir /build
165 cd build
166 cmake ..
167 make
168 ----
169
170 After the script finished, you should have:
171
172 * a bin/ folder which contains all executables and the libraries: 
173 * a build/ folder which has all build objects (erase that if you need a clean build)
174 * a doc/ folder in case you turned the documentation on
175
176 In order to install the AudioManager, you can do
177 ----
178 sudo make install
179 ----
180
181 Package generation is supported via CPack. To build packages, you have to 
182 ----
183 make genivi_package
184 ----
185
186 This will create one package if your CMake version is < 2.8.5 (all binaries stripped):
187 ----
188 AudioManager-<git verison>-Linux.deb 
189 ----
190
191 If your version is above 2.8.5, you will get 4 packages (all binaries stripped) :
192         
193 * AudioManager-<git verison>-Linux-bin.deb              [AudioManager binary]
194 * AudioManager-<git verison>-Linux-dev.deb              [header files needed to compile plugins]
195 * AudioManager-<git verison>-Linux-sampleplugins.deb    [sample plugins]
196 * AudioManager-<git verison>-Linux-tests.deb            [tests including tests for sample plugins, installed in the ~/AudioMAnagerTests]
197
198 In order to create a tar.gz file of all sources (not including .git, build and bin folder,config files), you can do:
199 ----
200 make package_source                     
201 ----
202
203 This will create the following package:
204 'AudioManager-<git verison>-Source.tar.gz'
205
206 All packages will be placed in a folder called packages
207
208 === Adding own plugins
209 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.
210
211 TIP: Using this feature is simple: +
212 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.
213
214 .Here is a sample CMakeLists.txt that can be placed in ProjectSpecific folder:
215 ----
216 cmake_minimum_required(VERSION 2.6)
217
218 ### set your own buildflags:
219 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=c++98 -D_GNU_SOURCE -pedantic -Wno-variadic-macros")
220
221 ##overwrite priojecttypes.h:
222 CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/ProjectSpecific/overwrite/projecttypes.h ${CMAKE_SOURCE_DIR}/include/projecttypes.h COPYONLY)
223
224 if(WITH_PLUGIN_ROUTING)
225         add_subdirectory (../PluginRoutingInterfaceMyRoutingPlugin ${CMAKE_CURRENT_BINARY_DIR}/PluginRoutingInterfaceMyRoutingPlugin )
226 endif(WITH_PLUGIN_ROUTING)
227
228 if(WITH_PLUGIN_CONTROL)
229         add_subdirectory ( ../PluginControlInterfaceMyControlPlugin ${CMAKE_CURRENT_BINARY_DIR}/PluginControlInterfaceMyControlPlugin)
230 endif(WITH_PLUGIN_CONTROL)
231
232 ----
233
234 === CommandLine options
235 The commandline options of the AudioManager:
236
237 ----
238 AudioManagerDaemon Version: 3.0.11
239 Usage:  AudioManagerDaemon [options]
240 options:        
241         -h: print this message  
242         -i: info about current settings         
243         -v: print version       
244         -d: daemonize AudioManager      
245         -T: DbusType to be used by CAmDbusWrapper (0=DBUS_SESSION[default], 1=DBUS_SYSTEM)      
246         -p<path> path for sqlite database (default is in memory)        
247         -t<port> port for telnetconnection      
248         -m<max> number of max telnetconnections 
249         -c<Name> use controllerPlugin <Name> (full path with .so ending)        
250         -l<Name> replace command plugin directory with <Name> (full path)       
251         -r<Name> replace routing plugin directory with <Name> (full path)       
252         -L<Name> add command plugin directory with <Name> (full path)   
253         -R<Name> add routing plugin directory with <Name> (full path)   
254 ----    
255
256
257 == Telnet Server
258 The audiomanager has a build- in telnetserver that serves for debuggin purposes.
259 If you compile your AudioManager with TelnetServer support (cmake -DWITH_TELNET=ON), you will be able to 
260 set with commandline argument -t the port number and with -m the maximum supported connections. 
261 The default telnet port is 6060. 
262    
263 .For example, launch a telnet session on port 6060:
264       telnet localhost 6060
265    
266       #>Welcome to GENIVI AudioManager ver-0.0.1-37-ga004215
267       #>
268    
269 .press 'help' to get a list of all supported commands on this level:
270    
271       #>help
272       ####################################################
273       ####### The following commands are supported: ######
274       ####################################################
275       #
276       #exit  - quit telnet session
277       #get   - Go into 'get'-submenu
278       #help  - show all possible commands
279       #info  - Go into 'info'-submenu
280       #list  - Go into 'list'-submenu
281       #set   - Go into 'set'-submenu
282       #
283       #\>
284    
285 .Now type one of these commands, for example 'get', followed with another 'help' to get a list of supported commands:
286    
287       #\>get
288       #
289       #\Get>help
290       ####################################################
291       ####### The following commands are supported: ######
292       ####################################################
293       # 
294       #.. - one step back in menu tree (back to root folder)
295       #exit  - close telnet session
296       #help  - show all possible commands
297       #recv  - show receiverversion 
298       #routing  - show current routing
299       #sendv - show senderversion
300       #
301       #\Get>
302    
303 .You can also execute several commands in a line:
304    
305       #\Get>recv sendv .. help exit
306       #   Receiver versions:
307       #   Ctrl: 1 | Cmd: 1 | Routing: 1
308       #   Sender versions:
309       #   Ctrl: 1 | Cmd: 1 | Routing: 1
310       ####################################################
311       ######## The following commands are supported: ######
312       ####################################################
313       #
314       #exit  - quit telnet session
315       #get   - Go into 'get'-submenu
316       #help  - show all possible commands
317       #info  - Go into 'info'-submenu
318       #list  - Go into 'list'-submenu
319       #set   - Go into 'set'-submenu
320       #
321       #Your wish is my command ... bye!
322       #Connection closed by foreign host.
323
324
325
326 == Code Formatting
327 The source code if formatted with eclipse, the style sheet used can be found in the cmake folder:
328 ----
329 cmake/AudioManager_Codestyle.xml
330 ----
331
332 == Working on the code & contribution
333
334 .First get the code from the git:
335         git clone 
336
337 .Get an overview of all branches:
338         git branch
339
340 .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)
341         git checkout <your branch>
342         git branch
343
344 .Best practice is to create a local branch based on the current branch:
345         git branch working_branch
346
347 Start working, best practice is to commit smaller, compilable peaced during the work that makes it easier to 
348 handle later on.
349
350 .If you want to commit you changes, send them to the audiomanager-dev list, you can create a patch like this:
351         git format-patch working_branch <your branch>
352
353 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.
354
355 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
356
357
358
359 ----
360                                             _             _ _       __  __                                   
361                                            / \  _   _  __| (_) ___ |  \/  | __ _ _ __   __ _  __ _  ___ _ __ 
362                                           / _ \| | | |/ _` | |/ _ \| |\/| |/ _` | '_ \ / _` |/ _` |/ _ \ '__|
363                                          / ___ \ |_| | (_| | | (_) | |  | | (_| | | | | (_| | (_| |  __/ |   
364                                         /_/   \_\__,_|\__,_|_|\___/|_|  |_|\__,_|_| |_|\__,_|\__, |\___|_|   
365                                                                                              |___/    
366
367
368
369
370                                                                         QQ
371                                                                         QQ[
372                                                                   qaap
373                                                                   )4W? ayQap
374                                                                        4QQQ[
375                                                               .awQap   ==
376                                                                $WWQF   aaaa,
377                                                                  `    QWQWQQ
378                                                             _aaap=    J?QQP'|
379                                                            qQQWQQ6    -      qyQQQgp
380                                                            )4QQQQ^ .yQQQQ,   QQQQQQQ
381                                                          aa         4QQQW'   )?QQQP'  gmQQma
382                                                        ]QQQQp         .               WQQQQW
383                                                         ????    aQQQ6p    _aQQQQa      "??"+
384                                                        qaaa,   ]QQQQQQ    jQQQQQQf   -aaaap
385                                                       jQQWWQ    )????'    )4QQQQP'   mQWQWQf
386                                                       ]WQQQQ    jaaa                 QQQQQQf
387                                                       )WQQQQ   yQQWWQp    ayQQQap    QQQQQQf
388                                                       )QQQQQ   QQQQQQf   ]QQQQQQQ,   QQQQQQf
389                                                       ]QQQQD   QQQQQQf   ]QQQQQQQ[   QQQQQQf
390                                                         ??':   QQQQQQf   ]QQQQQQQ[   4QQQQQf
391                                                                QQQQQQf   ]QQQQQQQ[   =????'I
392                                                                QQQQQQf   ]QQQQQQQ[
393                                                               .4QQQQQ'   ]QQQQQQQ[
394                                                                 ]??"-    ]QQQQQQQ(
395                                                                          ]4QQQQQ?
396                                                                            :
397
398                             qaayQQQQQQQQQwaa   ]mmmmmmmmmmmmmm  ]mmmmmmg,     ]mmm[  ]mmmm  4mmmg         ymmm' ]mmmm pwLq
399                            jQQQQD???????QWWQf  ]QQQP??????????  ]QQQWQQQQp    ]QQQf  ]QQQQ   4QQQ6.     _yQQQ'  ]QQQQ \!'a'
400                            ]QQQf        )???'  ]QQQ6aaaaaaaaap  ]QQQf)4QQQ6,  ]QQQf  ]QQQQ   |4QQQ6    jmQQQ'v  ]QQQQ
401                            ]QQQ[   ]QQQQWWQQf  ]QQQQQQQWQWQWQf  ]QQQf  ?QQQQa ]QQQf  ]QQQQ    i4QQQ6  qQQQQ'    ]QQQQ
402                            ]QQQ6,   .   qQQQf  ]QQQf            ]QQQf   ]4QQQ6jQQQf  ]QQQQ      4QQQ6gQWQQ'     ]QQQQ
403                             4QQQQQQQQQQQQQQW'  ]QQQQQQWQWQWQWQ  ]QQQf    i?QQQQQQQf  ]QQQQ       ]QQQQQQQ'      ]QQQQ
404                             ++"??????????`     ]""!"""""""""""S ]""!'      ]"""!""'  -""!"        """!""'       ]""!"
405
406
407 ----