03b4b639c20bf869fa0c43b6cb2c3d2f3915c423
[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                 -h: print this message  
137                 -i: info about current settings         
138                 -v: print version       
139                 -d: daemonize AudioManager      
140                 -p<path> path for sqlite database (default is in memory)        
141                 -t<port> port for telnetconnection      
142                 -m<max> number of max telnetconnections 
143                 -c<Name> use controllerPlugin <Name> (full path with .so ending)        
144                 -l<Name> replace command plugin directory with <Name> (full path)       
145                 -r<Name> replace routing plugin directory with <Name> (full path)       
146                 -L<Name> add command plugin directory with <Name> (full path)   
147                 -R<Name> add routing plugin directory with <Name> (full path)   
148
149
150 ***********************************************************************************************************
151 Telnet Server
152 ***********************************************************************************************************
153 The audiomanager has a build- in telnetserver that serves for debuggin purposes.
154 If you compile your AudioManager with TelnetServer support (cmake -DWITH_TELNET=ON), you will be able to 
155 set with commandline argument -t the port number and with -m the maximum supported connections. 
156 The default telnet port is 6060. 
157    
158    For example, launch a telnet session on port 6060:
159       telnet localhost 6060
160    
161       #>Welcome to GENIVI AudioManager ver-0.0.1-37-ga004215
162       #>
163    
164    press 'help' to get a list of all supported commands on this level:
165    
166       #>help
167       ####################################################
168       ####### The following commands are supported: ######
169       ####################################################
170       #
171       #exit  - quit telnet session
172       #get   - Go into 'get'-submenu
173       #help  - show all possible commands
174       #info  - Go into 'info'-submenu
175       #list  - Go into 'list'-submenu
176       #set   - Go into 'set'-submenu
177       #
178       #\>
179    
180    Now type one of these commands, for example 'get', followed with another 'help' to get a list of supported commands:
181    
182       #\>get
183       #
184       #\Get>help
185       ####################################################
186       ####### The following commands are supported: ######
187       ####################################################
188       # 
189       #.. - one step back in menu tree (back to root folder)
190       #exit  - close telnet session
191       #help  - show all possible commands
192       #recv  - show receiverversion 
193       #routing  - show current routing
194       #sendv - show senderversion
195       #
196       #\Get>
197    
198    You can also execute several commands in a line:
199    
200       #\Get>recv sendv .. help exit
201       #   Receiver versions:
202       #   Ctrl: 1 | Cmd: 1 | Routing: 1
203       #   Sender versions:
204       #   Ctrl: 1 | Cmd: 1 | Routing: 1
205       ####################################################
206       ######## The following commands are supported: ######
207       ####################################################
208       #
209       #exit  - quit telnet session
210       #get   - Go into 'get'-submenu
211       #help  - show all possible commands
212       #info  - Go into 'info'-submenu
213       #list  - Go into 'list'-submenu
214       #set   - Go into 'set'-submenu
215       #
216       #Your wish is my command ... bye!
217       #Connection closed by foreign host.
218
219
220 ***********************************************************************************************************
221 Code Formatting
222 ***********************************************************************************************************
223 The source code if formatted with eclipse, the style sheet used can be found in the cmake folder:
224 cmake/AudioManager_Codestyle.xml
225
226 ***********************************************************************************************************
227 Working on the code & contribution
228 ***********************************************************************************************************
229 First get the code from the git:
230         git clone https://<kavi-account>:<kavi-password>@git.genivi.org/srv/git/AudioManager
231
232 Get an overview of all branches:
233         git branch
234
235 Switch to the branch you want to work on (see versioning schmeme, the master is the feature branch) 
236 and verify that it has switched (* changed)
237         git checkout <your branch>
238         git branch
239
240 Best practice is to create a local branch based on the current branch:
241         git branch working_branch
242
243 Start working, best practice is to commit smaller, compilable peaced during the work that makes it easier to 
244 handle later on.
245
246 If you want to commit you changes, send them to the audiomanager-dev list, you can create a patch like this:
247         git format-patch working_branch <your branch>
248
249 This creates a set of patches that are published via the mailing list (this is already the submission under CLA). 
250 The patches will be discussed and then merged & uploaded on the git. For more information about git checkout the 
251 Genivi wiki and the stuff on the web.
252
253
254                                  _..-------++._
255                              _.-'/ |      _||  \"--._
256                        __.--'`._/_\j_____/_||___\    `----.
257                   _.--'_____    |          \     _____    /
258                 _j    /,---.\   |        =o |   /,---.\   |_
259                [__]==// .-. \\==`===========/==// .-. \\=[__]
260                  `-._|\ `-' /|___\_________/___|\ `-' /|_.'     
261                        `---'                     `---'