aboutsummaryrefslogtreecommitdiff
path: root/libraries/bluez-alsa/ortp.patch
blob: 7286d261a30313a1b02ef63af31a2b24c2d25359 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
*** a/bluez-alsa-1.2.0/README.md	2017-04-13 13:50:39.000000000 -0700
--- b/bluez-alsa-1.2.0/README.md	2018-04-26 13:33:35.943544513 -0700
***************
*** 23,28 ****
--- 23,36 ----
  	$ autoreconf --install
  	$ mkdir build && cd build
  	$ ../configure --enable-aac --enable-debug
+ 
+ or if you intend to stream audio from a Linux distribution using PulseAudio (see [this
+ issue](https://github.com/Arkq/bluez-alsa/issues/13))
+ 
+ 	$ ../configure --enable-aac --enable-debug --disable-payloadcheck
+ 
+ then
+ 
  	$ make && make install
  
  Dependencies:
***************
*** 31,44 ****
  - [bluez](http://www.bluez.org/) >= 5.0
  - [glib](https://wiki.gnome.org/Projects/GLib) with GIO support
  - [sbc](https://git.kernel.org/cgit/bluetooth/sbc.git)
- - [ortp](http://www.linphone.org/technical-corner/ortp.html) (required for compilation only)
  - [fdk-aac](https://github.com/mstorsjo/fdk-aac) (when AAC support is enabled with `--enable-aac`)
  
! Dependencies for `hcitop` (unless `--disable-hcitop` is specified during configuration):
  
  - [libbsd](https://libbsd.freedesktop.org/)
  - [ncurses](https://www.gnu.org/software/ncurses/)
  
  
  Configuration & Usage
  ---------------------
--- 39,54 ----
  - [bluez](http://www.bluez.org/) >= 5.0
  - [glib](https://wiki.gnome.org/Projects/GLib) with GIO support
  - [sbc](https://git.kernel.org/cgit/bluetooth/sbc.git)
  - [fdk-aac](https://github.com/mstorsjo/fdk-aac) (when AAC support is enabled with `--enable-aac`)
  
! Dependencies for `hcitop` (when `--enable-hcitop` is specified during configuration):
  
  - [libbsd](https://libbsd.freedesktop.org/)
  - [ncurses](https://www.gnu.org/software/ncurses/)
  
+ If you are using Debian-based distribution, take a look at the [.travis.yml](.travis.yml) file,
+ it might give you a hint about required packages.
+ 
  
  Configuration & Usage
  ---------------------
***************
*** 100,107 ****
  	alongside, but Bluetooth support has to be disabled in the PulseAudio. Any Bluetooth related
  	module has to be unloaded - e.g. `bluetooth-discover`, `bluez5-discover`.
  
- 	See also [this](https://github.com/Arkq/bluez-alsa/issues/13) PulseAudio related issue.
- 
  2. ALSA thread-safe API (alsa-lib >= 1.1.2).
  
  	Starting from ALSA library 1.1.2, it is possible to enable thread-safe API functions. It is a
--- 110,115 ----
*** a/bluez-alsa-1.2.0/configure.ac	2017-04-13 13:50:39.000000000 -0700
--- b/bluez-alsa-1.2.0/configure.ac	2018-04-26 13:30:55.692862106 -0700
***************
*** 34,41 ****
  
  AC_CHECK_LIB([pthread], [pthread_create],
  	[], [AC_MSG_ERROR([pthread library not found])])
- AC_CHECK_HEADERS([ortp/rtp.h],
- 	[], [AC_MSG_ERROR([ortp/rtp.h header not found])])
  AC_SEARCH_LIBS([clock_gettime], [rt],
  	[], [AC_MSG_ERROR([unable to find clock_gettime() function])])
  AC_SEARCH_LIBS([pow], [m],
--- 34,39 ----
***************
*** 57,74 ****
  	AC_DEFINE([ENABLE_AAC], [1], [Define to 1 if AAC is enabled.])
  ])
  
  AC_ARG_ENABLE([aplay],
! 	[AS_HELP_STRING([--disable-aplay], [disable building of aplay tool])])
  AM_CONDITIONAL([ENABLE_APLAY], [test "x$enable_aplay" != "xno"])
  
  AC_ARG_ENABLE([hcitop],
! 	[AS_HELP_STRING([--disable-hcitop], [disable building of hcitop tool])])
! AM_CONDITIONAL([ENABLE_HCITOP], [test "x$enable_hcitop" != "xno"])
  AM_COND_IF([ENABLE_HCITOP], [
  	PKG_CHECK_MODULES([LIBBSD], [libbsd])
  	PKG_CHECK_MODULES([NCURSES], [ncurses])
  ])
  
  AC_ARG_WITH([alsaplugindir],
  	AS_HELP_STRING([--with-alsaplugindir=dir], [path where ALSA plugin files are stored]),
  	[alsaplugindir="$withval"], [alsaplugindir="$libdir/alsa-lib"])
--- 55,85 ----
  	AC_DEFINE([ENABLE_AAC], [1], [Define to 1 if AAC is enabled.])
  ])
  
+ AC_ARG_ENABLE([payloadcheck],
+ 	[AS_HELP_STRING([--disable-payloadcheck], [disable RTP payload type check (workaround for a PulseAudio bug)])])
+ AM_CONDITIONAL([ENABLE_PAYLOADCHECK], [test "x$enable_payloadcheck" != "xno"])
+ AM_COND_IF([ENABLE_PAYLOADCHECK], [
+ 	AC_DEFINE([ENABLE_PAYLOADCHECK], [1], [Define to 1 if PAYLOADCHECK is enabled.])
+ ])
+ 
  AC_ARG_ENABLE([aplay],
! 	[AS_HELP_STRING([--disable-aplay], [disable building of bluealsa-aplay tool])])
  AM_CONDITIONAL([ENABLE_APLAY], [test "x$enable_aplay" != "xno"])
  
  AC_ARG_ENABLE([hcitop],
! 	[AS_HELP_STRING([--enable-hcitop], [enable building of hcitop tool])])
! AM_CONDITIONAL([ENABLE_HCITOP], [test "x$enable_hcitop" = "xyes"])
  AM_COND_IF([ENABLE_HCITOP], [
  	PKG_CHECK_MODULES([LIBBSD], [libbsd])
  	PKG_CHECK_MODULES([NCURSES], [ncurses])
  ])
  
+ # Since it is not possible to specify custom ALSA plugin directory, BlueALSA
+ # PCM plugin has to be installed prior to this test.
+ AC_ARG_ENABLE([pcm-test],
+ 	[AS_HELP_STRING([--enable-pcm-test], [enable PCM plugin test])])
+ AM_CONDITIONAL([ENABLE_PCM_TEST], [test "x$enable_pcm_test" = "xyes"])
+ 
  AC_ARG_WITH([alsaplugindir],
  	AS_HELP_STRING([--with-alsaplugindir=dir], [path where ALSA plugin files are stored]),
  	[alsaplugindir="$withval"], [alsaplugindir="$libdir/alsa-lib"])
*** a/bluez-alsa-1.2.0/src/a2dp-rtp.h	2017-04-13 13:50:39.000000000 -0700
--- b/bluez-alsa-1.2.0/src/a2dp-rtp.h	2018-04-26 13:31:29.385585082 -0700
***************
*** 1,6 ****
  /*
   * BlueALSA - a2dp-rtp.h
!  * Copyright (c) 2016 Arkadiusz Bokowy
   *
   * This file is a part of bluez-alsa.
   *
--- 1,6 ----
  /*
   * BlueALSA - a2dp-rtp.h
!  * Copyright (c) 2016-2017 Arkadiusz Bokowy
   *
   * This file is a part of bluez-alsa.
   *
***************
*** 12,18 ****
  #define BLUEALSA_A2DPRTP_H_
  
  #include <stdint.h>
! #include <ortp/rtp.h>
  
  /**
   * Media payload header for SBC. */
--- 12,39 ----
  #define BLUEALSA_A2DPRTP_H_
  
  #include <stdint.h>
! 
! typedef struct rtp_header {
! #if __BYTE_ORDER == __LITTLE_ENDIAN
! 	uint16_t cc:4;
! 	uint16_t extbit:1;
! 	uint16_t padbit:1;
! 	uint16_t version:2;
! 	uint16_t paytype:7;
! 	uint16_t markbit:1;
! #else
! 	uint16_t version:2;
! 	uint16_t padbit:1;
! 	uint16_t extbit:1;
! 	uint16_t cc:4;
! 	uint16_t markbit:1;
! 	uint16_t paytype:7;
! #endif
! 	uint16_t seq_number;
! 	uint32_t timestamp;
! 	uint32_t ssrc;
! 	uint32_t csrc[16];
! } __attribute__ ((packed)) rtp_header_t;
  
  /**
   * Media payload header for SBC. */
*** a/bluez-alsa-1.2.0/test/inc/a2dp.inc	2017-04-13 13:50:39.000000000 -0700
--- b/bluez-alsa-1.2.0/test/inc/a2dp.inc	2018-04-26 13:34:28.586111682 -0700
***************
*** 10,16 ****
--- 10,20 ----
   *
   */
  
+ #include <errno.h>
  #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <arpa/inet.h>
  #include <sbc/sbc.h>
  #include "../src/a2dp-codecs.h"
  #include "../src/a2dp-rtp.h"