3 :Author: Christian Linke <christian.linke@bmw.de>
4 :doctitle: GENIVI_AudioManager
8 Copyright (C) 2012, GENIVI Alliance, Inc.
9 Copyright (C) 2012, BMW AG
11 This file is part of GENIVI Project AudioManager.
13 Contributions are licensed to the GENIVI Alliance under one or more
14 Contribution License Agreements or MPL 2.0 .
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/.
21 author Christian Mueller, christian.linke@bmw.de BMW 2011,2012
23 For further information see http://projects.genivi.org/audio-manager/.
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
31 Contribution is done under GENIVI CLA or MPL2.0.
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.
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.
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.
49 A very detailed documentation is provided by doxygen. In order to use this, please compile the AudioManager with
51 cmake -DWITH_DOCUMENTATION=ON
58 These are the compile options with default values:
62 CMAKE_INSTALL_PREFIX /usr/local
63 GLIB_DBUS_TYPES_TOLERANT ON
65 WITH_COMMAND_INTERFACE_DBUS ON
66 WITH_DATABASE_STORAGE ON
71 WITH_PLUGIN_COMMAND ON
72 WITH_PLUGIN_CONTROL ON
73 WITH_PLUGIN_ROUTING ON
74 WITH_ROUTING_INTERFACE_ASYNC OFF
75 WITH_ROUTING_INTERFACE_DBUS ON
76 WITH_SYSTEMD_WATCHDOG OFF
79 WITH_TEST_CONTROLLER OFF
81 gtest_build_samples OFF
83 gtest_disable_pthreads OFF
84 gtest_force_shared_crt OFF
86 === Passing options to cmake:
89 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.
91 .-DDBUS_SERVICE_PREFIX="XXX"
92 sets the service prefix for Dbus, default "org.genivi.audiomanager\0"
94 .-DDBUS_SERVICE_OBJECT_PATH="XXX"
95 sets the object path for Dbus, default "/org/genivi/audiomanager\0"
97 .-DDEFAULT_TELNETPORT="XXX"
98 sets the default telnetport, default 6060. Can be overwriten by command line parameter
100 .-DMAX_TELNETCONNECTIONS="XXX"
101 sets the default maximum number of telnetconnections, default is 3
104 sets the path of the NSM DBUS interface
106 .-DNSM_INTERFACE="XXX"
107 sets the interface to the NSM DBUS interface
109 In order to change these options, you can modify this values with ccmake, do the appropriate changes in
110 CmakeList.txt or via the commandline for cmake or (when installed via ccmake)
112 === Build dependencies
113 Basically, all build dependencies are optional- but you might need to use some if you want to have support for Dbus,
116 You will need optionally fullfill some dependencies in order to comile the GENIVI AudioManager Daemon, these are:
118 * dbus (only when DBUS_WRAPPER==ON) [tested on version 1.2.16]
119 * sqlite3 [tested on version 3.6.22] (only when WITH_DATABASE_STORAGE==ON)
120 * automotive-dlt [greater 2.5.0] (only when WITH_DLT==ON)
121 * doxygen (only when WITH_DOCUMENTATION==ON) [tested on version 1.6.3]
123 To install them in a build environment like Ubuntu you can use:
125 sudo apt-get install libdbus-1-dev libsqlite3-dev doxygen git cmake build-essential
128 === The NodeStateManager
130 The nodestatemanager headers are needed to compile the audiomanager. If the nodestatemanagerincludes are not found,
131 the headers shipped with the audiomanager are used.
132 The nodestatemanager can be retrieved from projects.genivi.org . You can install the headers on you system by
135 sudo make install-includeHEADERS
138 For building the tests, you will need the following packages:
140 * python [tested on version 2.6, should work on higher versions as well]
142 GoogleMock and GoogleTest are as source code integrated in the sourcetree
143 To install them in a build environment like Ubuntu you can use:
145 sudo apt-get install python2.6-dev
148 For compiling, you will need a compiler, linker etc. On most linux systems you will get this via
150 sudo apt-get install build-essential
153 More details in the CMake Files CmakeList.txt in the projects.
156 To compile open a shell, browse to the AudioManager folder and
164 After the script finished, you should have:
166 * a bin/ folder which contains all executables and the libraries:
167 * a build/ folder which has all build objects (erase that if you need a clean build)
168 * a doc/ folder in case you turned the documentation on
170 In order to install the AudioManager, you can do
175 Package generation is supported via CPack. To build packages, you have to
180 This will create one package if your CMake version is < 2.8.5 (all binaries stripped):
182 AudioManager-<git verison>-Linux.deb
185 If your version is above 2.8.5, you will get 4 packages (all binaries stripped) :
187 * AudioManager-<git verison>-Linux-bin.deb [AudioManager binary]
188 * AudioManager-<git verison>-Linux-dev.deb [header files needed to compile plugins]
189 * AudioManager-<git verison>-Linux-sampleplugins.deb [sample plugins]
190 * AudioManager-<git verison>-Linux-tests.deb [tests including tests for sample plugins, installed in the ~/AudioMAnagerTests]
192 In order to create a tar.gz file of all sources (not including .git, build and bin folder,config files), you can do:
197 This will create the following package:
198 'AudioManager-<git verison>-Source.tar.gz'
200 All packages will be placed in a folder called packages
202 === Adding own plugins
203 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.
205 TIP: Using this feature is simple: +
206 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.
208 .Here is a sample CMakeLists.txt that can be placed in ProjectSpecific folder:
210 cmake_minimum_required(VERSION 2.6)
212 ### set your own buildflags:
213 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=c++98 -D_GNU_SOURCE -pedantic -Wno-variadic-macros")
215 ##overwrite priojecttypes.h:
216 CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/ProjectSpecific/overwrite/projecttypes.h ${CMAKE_SOURCE_DIR}/include/projecttypes.h COPYONLY)
218 if(WITH_PLUGIN_ROUTING)
219 add_subdirectory (../PluginRoutingInterfaceMyRoutingPlugin ${CMAKE_CURRENT_BINARY_DIR}/PluginRoutingInterfaceMyRoutingPlugin )
220 endif(WITH_PLUGIN_ROUTING)
222 if(WITH_PLUGIN_CONTROL)
223 add_subdirectory ( ../PluginControlInterfaceMyControlPlugin ${CMAKE_CURRENT_BINARY_DIR}/PluginControlInterfaceMyControlPlugin)
224 endif(WITH_PLUGIN_CONTROL)
228 === CommandLine options
229 The commandline options of the AudioManager:
232 AudioManagerDaemon Version: 3.0.11
233 Usage: AudioManagerDaemon [options]
235 -h: print this message
236 -i: info about current settings
238 -d: daemonize AudioManager
239 -T: DbusType to be used by CAmDbusWrapper (0=DBUS_SESSION[default], 1=DBUS_SYSTEM)
240 -p<path> path for sqlite database (default is in memory)
241 -t<port> port for telnetconnection
242 -m<max> number of max telnetconnections
243 -c<Name> use controllerPlugin <Name> (full path with .so ending)
244 -l<Name> replace command plugin directory with <Name> (full path)
245 -r<Name> replace routing plugin directory with <Name> (full path)
246 -L<Name> add command plugin directory with <Name> (full path)
247 -R<Name> add routing plugin directory with <Name> (full path)
252 The audiomanager has a build- in telnetserver that serves for debuggin purposes.
253 If you compile your AudioManager with TelnetServer support (cmake -DWITH_TELNET=ON), you will be able to
254 set with commandline argument -t the port number and with -m the maximum supported connections.
255 The default telnet port is 6060.
257 .For example, launch a telnet session on port 6060:
258 telnet localhost 6060
260 #>Welcome to GENIVI AudioManager ver-0.0.1-37-ga004215
263 .press 'help' to get a list of all supported commands on this level:
266 ####################################################
267 ####### The following commands are supported: ######
268 ####################################################
270 #exit - quit telnet session
271 #get - Go into 'get'-submenu
272 #help - show all possible commands
273 #info - Go into 'info'-submenu
274 #list - Go into 'list'-submenu
275 #set - Go into 'set'-submenu
279 .Now type one of these commands, for example 'get', followed with another 'help' to get a list of supported commands:
284 ####################################################
285 ####### The following commands are supported: ######
286 ####################################################
288 #.. - one step back in menu tree (back to root folder)
289 #exit - close telnet session
290 #help - show all possible commands
291 #recv - show receiverversion
292 #routing - show current routing
293 #sendv - show senderversion
297 .You can also execute several commands in a line:
299 #\Get>recv sendv .. help exit
301 # Ctrl: 1 | Cmd: 1 | Routing: 1
303 # Ctrl: 1 | Cmd: 1 | Routing: 1
304 ####################################################
305 ######## The following commands are supported: ######
306 ####################################################
308 #exit - quit telnet session
309 #get - Go into 'get'-submenu
310 #help - show all possible commands
311 #info - Go into 'info'-submenu
312 #list - Go into 'list'-submenu
313 #set - Go into 'set'-submenu
315 #Your wish is my command ... bye!
316 #Connection closed by foreign host.
321 The source code if formatted with eclipse, the style sheet used can be found in the cmake folder:
323 cmake/AudioManager_Codestyle.xml
326 == Working on the code & contribution
328 .First get the code from the git:
331 .Get an overview of all branches:
334 .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)
335 git checkout <your branch>
338 .Best practice is to create a local branch based on the current branch:
339 git branch working_branch
341 Start working, best practice is to commit smaller, compilable peaced during the work that makes it easier to
344 .If you want to commit you changes, send them to the audiomanager-dev list, you can create a patch like this:
345 git format-patch working_branch <your branch>
347 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.
349 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
355 / \ _ _ __| (_) ___ | \/ | __ _ _ __ __ _ __ _ ___ _ __
356 / _ \| | | |/ _` | |/ _ \| |\/| |/ _` | '_ \ / _` |/ _` |/ _ \ '__|
357 / ___ \ |_| | (_| | | (_) | | | | (_| | | | | (_| | (_| | __/ |
358 /_/ \_\__,_|\__,_|_|\___/|_| |_|\__,_|_| |_|\__,_|\__, |\___|_|
374 )4QQQQ^ .yQQQQ, QQQQQQQ
375 aa 4QQQW' )?QQQP' gmQQma
377 ???? aQQQ6p _aQQQQa "??"+
378 qaaa, ]QQQQQQ jQQQQQQf -aaaap
379 jQQWWQ )????' )4QQQQP' mQWQWQf
381 )WQQQQ yQQWWQp ayQQQap QQQQQQf
382 )QQQQQ QQQQQQf ]QQQQQQQ, QQQQQQf
383 ]QQQQD QQQQQQf ]QQQQQQQ[ QQQQQQf
384 ??': QQQQQQf ]QQQQQQQ[ 4QQQQQf
385 QQQQQQf ]QQQQQQQ[ =????'I
392 qaayQQQQQQQQQwaa ]mmmmmmmmmmmmmm ]mmmmmmg, ]mmm[ ]mmmm 4mmmg ymmm' ]mmmm pwLq
393 jQQQQD???????QWWQf ]QQQP?????????? ]QQQWQQQQp ]QQQf ]QQQQ 4QQQ6. _yQQQ' ]QQQQ \!'a'
394 ]QQQf )???' ]QQQ6aaaaaaaaap ]QQQf)4QQQ6, ]QQQf ]QQQQ |4QQQ6 jmQQQ'v ]QQQQ
395 ]QQQ[ ]QQQQWWQQf ]QQQQQQQWQWQWQf ]QQQf ?QQQQa ]QQQf ]QQQQ i4QQQ6 qQQQQ' ]QQQQ
396 ]QQQ6, . qQQQf ]QQQf ]QQQf ]4QQQ6jQQQf ]QQQQ 4QQQ6gQWQQ' ]QQQQ
397 4QQQQQQQQQQQQQQW' ]QQQQQQWQWQWQWQ ]QQQf i?QQQQQQQf ]QQQQ ]QQQQQQQ' ]QQQQ
398 ++"??????????` ]""!"""""""""""S ]""!' ]"""!""' -""!" """!""' ]""!"