View | Details | Raw Unified | Return to bug 210124 | Differences between
and this patch

Collapse All | Expand All

(-)audio/Makefile (+2 lines)
Lines 609-614 Link Here
609
    SUBDIR += pragha
609
    SUBDIR += pragha
610
    SUBDIR += puddletag
610
    SUBDIR += puddletag
611
    SUBDIR += pulseaudio
611
    SUBDIR += pulseaudio
612
    SUBDIR += pulseaudio-module-sndio
612
    SUBDIR += py-al
613
    SUBDIR += py-al
613
    SUBDIR += py-ao
614
    SUBDIR += py-ao
614
    SUBDIR += py-apetag
615
    SUBDIR += py-apetag
Lines 697-702 Link Here
697
    SUBDIR += smasher
698
    SUBDIR += smasher
698
    SUBDIR += snack
699
    SUBDIR += snack
699
    SUBDIR += snd
700
    SUBDIR += snd
701
    SUBDIR += sndio
700
    SUBDIR += solfege
702
    SUBDIR += solfege
701
    SUBDIR += sonata
703
    SUBDIR += sonata
702
    SUBDIR += sooperlooper
704
    SUBDIR += sooperlooper
(-)audio/pulseaudio-module-sndio/Makefile (+32 lines)
Line 0 Link Here
1
# Created by: Tobias Kortkamp <t@tobik.me>
2
# $FreeBSD$
3
4
PORTNAME=	pulseaudio
5
PORTVERSION=	8.0
6
CATEGORIES=	audio
7
MASTER_SITES=	http://freedesktop.org/software/pulseaudio/releases/
8
PKGNAMESUFFIX=	-module-sndio
9
10
MAINTAINER=	t@tobik.me
11
COMMENT=	Sndio module for PulseAudio
12
13
LICENSE=	ISCL
14
15
LIB_DEPENDS+=	libsndio.so:audio/sndio \
16
		libpulse.so:audio/pulseaudio
17
18
USES=	pkgconfig tar:xz
19
20
PULSE_MODULE_DIR=	lib/pulse-${PORTVERSION}/modules
21
22
PLIST_FILES=	${PULSE_MODULE_DIR}/module-sndio.so
23
24
post-extract:
25
	${CP} ${FILESDIR}/* ${WRKSRC}
26
27
do-install:
28
	${MKDIR} ${STAGEDIR}${PREFIX}/${PULSE_MODULE_DIR}/
29
	${INSTALL_LIB} ${WRKSRC}/module-sndio.so \
30
		${STAGEDIR}${PREFIX}/${PULSE_MODULE_DIR}/
31
32
.include <bsd.port.mk>
(-)audio/pulseaudio-module-sndio/distinfo (+2 lines)
Line 0 Link Here
1
SHA256 (pulseaudio-8.0.tar.xz) = 690eefe28633466cfd1ab9d85ebfa9376f6b622deec6bfee5091ac9737cd1989
2
SIZE (pulseaudio-8.0.tar.xz) = 1517656
(-)audio/pulseaudio-module-sndio/files/Makefile (+26 lines)
Line 0 Link Here
1
PULSEAUDIO_SRC?=.
2
3
LOCALBASE?=	/usr/local
4
5
CFLAGS+=	`pkg-config --cflags libpulse`
6
LDFLAGS+=	`pkg-config --libs libpulse`
7
8
CFLAGS+=	-fPIC -DPIC
9
10
CFLAGS+=	-I${PULSEAUDIO_SRC}/src
11
12
all: module-sndio.so
13
14
module-sndio.so: module-sndio.o
15
	${CC} -shared module-sndio.o \
16
		-Wl,-rpath -Wl,${LOCALBASE}/lib \
17
		-Wl,-rpath -Wl,${LOCALBASE}/lib/pulseaudio \
18
		${LDFLAGS} \
19
		-L${LOCALBASE}/lib/pulseaudio \
20
		-lpulsecore-8.0 \
21
		-lpulsecommon-8.0 \
22
		-lsndio \
23
		-o module-sndio.so
24
25
clean:
26
	rm -f module-sndio.o module-sndio.so
(-)audio/pulseaudio-module-sndio/files/config.h (+762 lines)
Line 0 Link Here
1
/* config.h.  Generated from config.h.in by configure.  */
2
/* config.h.in.  Generated from configure.ac by autoheader.  */
3
4
/* Define if building universal (internal helper macro) */
5
/* #undef AC_APPLE_UNIVERSAL_BUILD */
6
7
/* Have ARM atomic instructions. */
8
/* #undef ATOMIC_ARM_INLINE_ASM */
9
10
/* special arm linux implementation */
11
/* #undef ATOMIC_ARM_LINUX_HELPERS */
12
13
/* Enable memory barriers */
14
/* #undef ATOMIC_ARM_MEMORY_BARRIER_ENABLED */
15
16
/* Canonical host string. */
17
#define CANONICAL_HOST "amd64-portbld-freebsd10.3"
18
19
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
20
   systems. This function is required for `alloca.c' support on those systems.
21
   */
22
/* #undef CRAY_STACKSEG_END */
23
24
/* Define to 1 if using `alloca.c'. */
25
/* #undef C_ALLOCA */
26
27
/* Disable Orc */
28
/* #undef DISABLE_ORC */
29
30
/* Legacy database entry format */
31
#define ENABLE_LEGACY_DATABASE_ENTRY_FORMAT 1
32
33
/* Define to 1 if translation of program messages to the user's native
34
   language is requested. */
35
#define ENABLE_NLS 1
36
37
/* Define to the type of elements in the array set by `getgroups'. Usually
38
   this is either `int' or `gid_t'. */
39
#define GETGROUPS_T gid_t
40
41
/* Gettext package */
42
#define GETTEXT_PACKAGE "pulseaudio"
43
44
/* Define to 1 if you have the `accept4' function. */
45
#define HAVE_ACCEPT4 1
46
47
/* Define to 1 if you have `alloca', as a function or macro. */
48
#define HAVE_ALLOCA 1
49
50
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
51
   */
52
/* #undef HAVE_ALLOCA_H */
53
54
/* Have ALSA? */
55
/* #undef HAVE_ALSA */
56
57
/* Have ALSA UCM? */
58
/* #undef HAVE_ALSA_UCM */
59
60
/* Have ARMv6 instructions. */
61
/* #undef HAVE_ARMV6 */
62
63
/* Define to 1 if you have the <arpa/inet.h> header file. */
64
#define HAVE_ARPA_INET_H 1
65
66
/* Have __sync_bool_compare_and_swap() and friends. */
67
#define HAVE_ATOMIC_BUILTINS 1
68
69
/* Define to 1 if you have the <atomic_ops.h> header file. */
70
/* #undef HAVE_ATOMIC_OPS_H */
71
72
/* Bluez 5 native headset backend enabled */
73
/* #undef HAVE_BLUEZ_5_NATIVE_HEADSET */
74
75
/* Bluez 5 ofono headset backend enabled */
76
/* #undef HAVE_BLUEZ_5_OFONO_HEADSET */
77
78
/* Define to 1 if you have the <byteswap.h> header file. */
79
/* #undef HAVE_BYTESWAP_H */
80
81
/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
82
   CoreFoundation framework. */
83
/* #undef HAVE_CFLOCALECOPYCURRENT */
84
85
/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
86
   the CoreFoundation framework. */
87
/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
88
89
/* Define to 1 if you have the `chmod' function. */
90
#define HAVE_CHMOD 1
91
92
/* Define to 1 if you have the `chown' function. */
93
#define HAVE_CHOWN 1
94
95
/* Define to 1 if you have the `clock_gettime' function. */
96
#define HAVE_CLOCK_GETTIME 1
97
98
/* Have CoreAudio? */
99
/* #undef HAVE_COREAUDIO */
100
101
/* Define to 1 if you have the <CoreAudio/CoreAudio.h> header file. */
102
/* #undef HAVE_COREAUDIO_COREAUDIO_H */
103
104
/* Define to 1 if you have the `ctime_r' function. */
105
#define HAVE_CTIME_R 1
106
107
/* Have D-Bus. */
108
#define HAVE_DBUS 1
109
110
/* Define to 1 if you have the `dbus_watch_get_unix_fd' function. */
111
#define HAVE_DBUS_WATCH_GET_UNIX_FD 1
112
113
/* Define if the GNU dcgettext() function is already present or preinstalled.
114
   */
115
#define HAVE_DCGETTEXT 1
116
117
/* Define to 1 if you have the declaration of `environ', and to 0 if you
118
   don't. */
119
#define HAVE_DECL_ENVIRON 0
120
121
/* Have dladdr? */
122
#define HAVE_DLADDR 1
123
124
/* Define to 1 if you have the <dlfcn.h> header file. */
125
#define HAVE_DLFCN_H 1
126
127
/* Define to 1 if you have the <execinfo.h> header file. */
128
#define HAVE_EXECINFO_H 1
129
130
/* Have CPU with fast 64-bit operations? */
131
#define HAVE_FAST_64BIT_OPERATIONS 1
132
133
/* Define to 1 if you have the `fchmod' function. */
134
#define HAVE_FCHMOD 1
135
136
/* Define to 1 if you have the `fchown' function. */
137
#define HAVE_FCHOWN 1
138
139
/* Define to 1 if you have the `fork' function. */
140
#define HAVE_FORK 1
141
142
/* Define to 1 if you have the `fstat' function. */
143
#define HAVE_FSTAT 1
144
145
/* Have gdbm? */
146
/* #undef HAVE_GDBM */
147
148
/* Define to 1 if you have the <gdbm.h> header file. */
149
/* #undef HAVE_GDBM_H */
150
151
/* Define to 1 if you have the `getaddrinfo' function. */
152
#define HAVE_GETADDRINFO 1
153
154
/* Define to 1 if you have the `getgrgid_r' function. */
155
#define HAVE_GETGRGID_R 1
156
157
/* Define to 1 if you have the `getgrnam_r' function. */
158
#define HAVE_GETGRNAM_R 1
159
160
/* Define to 1 if your system has a working `getgroups' function. */
161
#define HAVE_GETGROUPS 1
162
163
/* Define to 1 if you have the `getopt_long' function. */
164
#define HAVE_GETOPT_LONG 1
165
166
/* Define to 1 if you have the `getpwnam_r' function. */
167
#define HAVE_GETPWNAM_R 1
168
169
/* Define to 1 if you have the `getpwuid_r' function. */
170
#define HAVE_GETPWUID_R 1
171
172
/* Define if the GNU gettext() function is already present or preinstalled. */
173
#define HAVE_GETTEXT 1
174
175
/* Define to 1 if you have the `gettimeofday' function. */
176
#define HAVE_GETTIMEOFDAY 1
177
178
/* Define to 1 if you have the `getuid' function. */
179
#define HAVE_GETUID 1
180
181
/* Have GLIB? */
182
#define HAVE_GLIB 1
183
184
/* Define to 1 if you have the <glob.h> header file. */
185
#define HAVE_GLOB_H 1
186
187
/* Define to 1 if you have the <grp.h> header file. */
188
#define HAVE_GRP_H 1
189
190
/* Have GTK? */
191
/* #undef HAVE_GTK */
192
193
/* Have HAL compatibility. */
194
/* #undef HAVE_HAL_COMPAT */
195
196
/* Define if you have the iconv() function and it works. */
197
#define HAVE_ICONV 1
198
199
/* Define to 1 if you have the <inttypes.h> header file. */
200
#define HAVE_INTTYPES_H 1
201
202
/* Define this to enable IPv6 connection support */
203
#define HAVE_IPV6 1
204
205
/* Define to 1 if you have the <langinfo.h> header file. */
206
#define HAVE_LANGINFO_H 1
207
208
/* Have libasyncns? */
209
/* #undef HAVE_LIBASYNCNS */
210
211
/* Define to 1 if you have the `gdbm' library (-lgdbm). */
212
/* #undef HAVE_LIBGDBM */
213
214
/* Define to 1 if you have the `iberty' library (-liberty). */
215
/* #undef HAVE_LIBIBERTY */
216
217
/* Have libsamplerate? */
218
/* #undef HAVE_LIBSAMPLERATE */
219
220
/* Have tcpwrap? */
221
#define HAVE_LIBWRAP /**/
222
223
/* Define to 1 if you have the <linux/input.h> header file. */
224
/* #undef HAVE_LINUX_INPUT_H */
225
226
/* Define to 1 if you have the <linux/sockios.h> header file. */
227
/* #undef HAVE_LINUX_SOCKIOS_H */
228
229
/* Define to 1 if you have the <locale.h> header file. */
230
#define HAVE_LOCALE_H 1
231
232
/* Define to 1 if you have the `lrintf' function. */
233
#define HAVE_LRINTF 1
234
235
/* Define to 1 if you have the `lstat' function. */
236
#define HAVE_LSTAT 1
237
238
/* Define to 1 if you have the <memory.h> header file. */
239
#define HAVE_MEMORY_H 1
240
241
/* Define to 1 if you have the `mkfifo' function. */
242
#define HAVE_MKFIFO 1
243
244
/* Define to 1 if you have the `mlock' function. */
245
#define HAVE_MLOCK 1
246
247
/* Define to 1 if you have the <mmsystem.h> header file. */
248
/* #undef HAVE_MMSYSTEM_H */
249
250
/* Define to 1 if you have the `nanosleep' function. */
251
#define HAVE_NANOSLEEP 1
252
253
/* Have NEON support? */
254
/* #undef HAVE_NEON */
255
256
/* Define to 1 if you have the <netdb.h> header file. */
257
#define HAVE_NETDB_H 1
258
259
/* Define to 1 if you have the <netinet/in.h> header file. */
260
#define HAVE_NETINET_IN_H 1
261
262
/* Define to 1 if you have the <netinet/in_systm.h> header file. */
263
#define HAVE_NETINET_IN_SYSTM_H 1
264
265
/* Define to 1 if you have the <netinet/ip.h> header file. */
266
#define HAVE_NETINET_IP_H 1
267
268
/* Define to 1 if you have the <netinet/tcp.h> header file. */
269
#define HAVE_NETINET_TCP_H 1
270
271
/* Define to 1 if you have the `open64' function. */
272
/* #undef HAVE_OPEN64 */
273
274
/* Have OpenSSL */
275
#define HAVE_OPENSSL 1
276
277
/* Use Orc */
278
#define HAVE_ORC 1
279
280
/* Have OSS output? */
281
#define HAVE_OSS_OUTPUT 1
282
283
/* Have OSS wrapper (padsp)? */
284
#define HAVE_OSS_WRAPPER 1
285
286
/* Define to 1 if you have the `paccept' function. */
287
/* #undef HAVE_PACCEPT */
288
289
/* Define to 1 if you have the <pcreposix.h> header file. */
290
#define HAVE_PCREPOSIX_H 1
291
292
/* Define to 1 if you have the `pipe' function. */
293
#define HAVE_PIPE 1
294
295
/* Define to 1 if you have the `pipe2' function. */
296
#define HAVE_PIPE2 1
297
298
/* Define to 1 if you have the <poll.h> header file. */
299
#define HAVE_POLL_H 1
300
301
/* Define to 1 if you have the `posix_fadvise' function. */
302
#define HAVE_POSIX_FADVISE 1
303
304
/* Define to 1 if you have the `posix_madvise' function. */
305
#define HAVE_POSIX_MADVISE 1
306
307
/* Define to 1 if you have the `posix_memalign' function. */
308
#define HAVE_POSIX_MEMALIGN 1
309
310
/* Define to 1 if you have the `ppoll' function. */
311
#define HAVE_PPOLL 1
312
313
/* Define if you have POSIX threads libraries and header files. */
314
#define HAVE_PTHREAD 1
315
316
/* Define to 1 if you have the `pthread_getname_np' function. */
317
/* #undef HAVE_PTHREAD_GETNAME_NP */
318
319
/* Have PTHREAD_PRIO_INHERIT. */
320
#define HAVE_PTHREAD_PRIO_INHERIT 1
321
322
/* Define to 1 if you have the `pthread_setaffinity_np' function. */
323
#define HAVE_PTHREAD_SETAFFINITY_NP 1
324
325
/* Define to 1 if you have the `pthread_setname_np' function. */
326
/* #undef HAVE_PTHREAD_SETNAME_NP */
327
328
/* Define to 1 if you have the <pwd.h> header file. */
329
#define HAVE_PWD_H 1
330
331
/* Define to 1 if you have the `readlink' function. */
332
#define HAVE_READLINK 1
333
334
/* Define to 1 if you have the `regexec' function. */
335
#define HAVE_REGEXEC 1
336
337
/* Define to 1 if you have the <regex.h> header file. */
338
#define HAVE_REGEX_H 1
339
340
/* Define to 1 if you have the <sched.h> header file. */
341
#define HAVE_SCHED_H 1
342
343
/* Define to 1 if you have the `setegid' function. */
344
#define HAVE_SETEGID 1
345
346
/* Define to 1 if you have the `seteuid' function. */
347
#define HAVE_SETEUID 1
348
349
/* Define to 1 if you have the `setpgid' function. */
350
#define HAVE_SETPGID 1
351
352
/* Define to 1 if you have the `setregid' function. */
353
#define HAVE_SETREGID 1
354
355
/* Define to 1 if you have the `setresgid' function. */
356
#define HAVE_SETRESGID 1
357
358
/* Define to 1 if you have the `setresuid' function. */
359
#define HAVE_SETRESUID 1
360
361
/* Define to 1 if you have the `setreuid' function. */
362
#define HAVE_SETREUID 1
363
364
/* Define to 1 if you have the `setsid' function. */
365
#define HAVE_SETSID 1
366
367
/* Define to 1 if you have the `shm_open' function. */
368
#define HAVE_SHM_OPEN 1
369
370
/* Define to 1 if you have the `sig2str' function. */
371
/* #undef HAVE_SIG2STR */
372
373
/* Define to 1 if you have the `sigaction' function. */
374
#define HAVE_SIGACTION 1
375
376
/* Have SIGXCPU? */
377
#define HAVE_SIGXCPU 1
378
379
/* Have simple? */
380
#define HAVE_SIMPLEDB 1
381
382
/* Define to 1 if you have the `sleep' function. */
383
#define HAVE_SLEEP 1
384
385
/* Have Solaris audio? */
386
/* #undef HAVE_SOLARIS */
387
388
/* Have soxr */
389
/* #undef HAVE_SOXR */
390
391
/* Have speex */
392
#define HAVE_SPEEX 1
393
394
/* Define to 1 if the system has the type `ssize_t'. */
395
#define HAVE_SSIZE_T 1
396
397
/* Define to 1 if you have the <stdint.h> header file. */
398
#define HAVE_STDINT_H 1
399
400
/* Define to 1 if you have the <stdlib.h> header file. */
401
#define HAVE_STDLIB_H 1
402
403
/* Have _Bool. */
404
#define HAVE_STD_BOOL 1
405
406
/* Define to 1 if you have the `strerror_r' function. */
407
#define HAVE_STRERROR_R 1
408
409
/* Define to 1 if you have the <strings.h> header file. */
410
#define HAVE_STRINGS_H 1
411
412
/* Define to 1 if you have the <string.h> header file. */
413
#define HAVE_STRING_H 1
414
415
/* Define to 1 if you have the `strsignal' function. */
416
#define HAVE_STRSIGNAL 1
417
418
/* Define to 1 if you have the `strtod_l' function. */
419
#define HAVE_STRTOD_L 1
420
421
/* Define to 1 if you have the `strtof' function. */
422
#define HAVE_STRTOF 1
423
424
/* Define to 1 if you have the `symlink' function. */
425
#define HAVE_SYMLINK 1
426
427
/* Define to 1 if you have the `sysconf' function. */
428
#define HAVE_SYSCONF 1
429
430
/* Define to 1 if you have the <syslog.h> header file. */
431
#define HAVE_SYSLOG_H 1
432
433
/* Have SYSTEMDDAEMON? */
434
/* #undef HAVE_SYSTEMD_DAEMON */
435
436
/* Have SYSTEMDJOURNAL? */
437
/* #undef HAVE_SYSTEMD_JOURNAL */
438
439
/* Have SYSTEMDLOGIN? */
440
/* #undef HAVE_SYSTEMD_LOGIN */
441
442
/* Define to 1 if you have the <sys/atomic.h> header file. */
443
/* #undef HAVE_SYS_ATOMIC_H */
444
445
/* Define to 1 if you have the <sys/audio.h> header file. */
446
/* #undef HAVE_SYS_AUDIO_H */
447
448
/* Define to 1 if you have the <sys/capability.h> header file. */
449
/* #undef HAVE_SYS_CAPABILITY_H */
450
451
/* Define to 1 if you have the <sys/dl.h> header file. */
452
/* #undef HAVE_SYS_DL_H */
453
454
/* Define to 1 if you have the <sys/eventfd.h> header file. */
455
/* #undef HAVE_SYS_EVENTFD_H */
456
457
/* Define to 1 if you have the <sys/filio.h> header file. */
458
#define HAVE_SYS_FILIO_H 1
459
460
/* Define to 1 if you have the <sys/ioctl.h> header file. */
461
#define HAVE_SYS_IOCTL_H 1
462
463
/* Define to 1 if you have the <sys/mman.h> header file. */
464
#define HAVE_SYS_MMAN_H 1
465
466
/* Define to 1 if you have the <sys/prctl.h> header file. */
467
/* #undef HAVE_SYS_PRCTL_H */
468
469
/* Define to 1 if you have the <sys/resource.h> header file. */
470
#define HAVE_SYS_RESOURCE_H 1
471
472
/* Define to 1 if you have the <sys/select.h> header file. */
473
#define HAVE_SYS_SELECT_H 1
474
475
/* Define to 1 if you have the <sys/socket.h> header file. */
476
#define HAVE_SYS_SOCKET_H 1
477
478
/* Define to 1 if you have the <sys/soundcard.h> header file. */
479
#define HAVE_SYS_SOUNDCARD_H 1
480
481
/* Define to 1 if you have the <sys/stat.h> header file. */
482
#define HAVE_SYS_STAT_H 1
483
484
/* Define to 1 if you have the <sys/syscall.h> header file. */
485
#define HAVE_SYS_SYSCALL_H 1
486
487
/* Define to 1 if you have the <sys/types.h> header file. */
488
#define HAVE_SYS_TYPES_H 1
489
490
/* Define to 1 if you have the <sys/uio.h> header file. */
491
#define HAVE_SYS_UIO_H 1
492
493
/* Define to 1 if you have the <sys/un.h> header file. */
494
#define HAVE_SYS_UN_H 1
495
496
/* Define to 1 if you have the <sys/wait.h> header file. */
497
#define HAVE_SYS_WAIT_H 1
498
499
/* Have tdb? */
500
/* #undef HAVE_TDB */
501
502
/* Have UDEV. */
503
/* #undef HAVE_UDEV */
504
505
/* Define to 1 if you have the `uname' function. */
506
#define HAVE_UNAME 1
507
508
/* Define to 1 if you have the <unistd.h> header file. */
509
#define HAVE_UNISTD_H 1
510
511
/* Define to 1 if you have the <use-case.h> header file. */
512
/* #undef HAVE_USE_CASE_H */
513
514
/* Define to 1 if you have the `usleep' function. */
515
#define HAVE_USLEEP 1
516
517
/* Define to 1 if you have the <valgrind/memcheck.h> header file. */
518
/* #undef HAVE_VALGRIND_MEMCHECK_H */
519
520
/* Define to 1 if you have the `vfork' function. */
521
#define HAVE_VFORK 1
522
523
/* Define to 1 if you have the <vfork.h> header file. */
524
/* #undef HAVE_VFORK_H */
525
526
/* Have WaveOut audio? */
527
/* #undef HAVE_WAVEOUT */
528
529
/* Define to 1 if you have the <windows.h> header file. */
530
/* #undef HAVE_WINDOWS_H */
531
532
/* Define to 1 if you have the <winsock2.h> header file. */
533
/* #undef HAVE_WINSOCK2_H */
534
535
/* Define to 1 if `fork' works. */
536
#define HAVE_WORKING_FORK 1
537
538
/* Define to 1 if `vfork' works. */
539
#define HAVE_WORKING_VFORK 1
540
541
/* Define to 1 if you have the <ws2tcpip.h> header file. */
542
/* #undef HAVE_WS2TCPIP_H */
543
544
/* Have X11? */
545
#define HAVE_X11 1
546
547
/* Define to 1 if you have the <xlocale.h> header file. */
548
#define HAVE_XLOCALE_H 1
549
550
/* Define to 1 if you have the
551
   </System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h>
552
   header file. */
553
/* #undef HAVE__SYSTEM_LIBRARY_FRAMEWORKS_CORESERVICES_FRAMEWORK_HEADERS_CORESERVICES_H */
554
555
/* Define as const if the declaration of iconv() needs const. */
556
#define ICONV_CONST 
557
558
/* Define INADDR_NONE if not found in <netinet/in.h> */
559
/* #undef INADDR_NONE */
560
561
/* Define to the sub-directory in which libtool stores uninstalled libraries.
562
   */
563
#define LT_OBJDIR ".libs/"
564
565
/* Build target is Darwin. */
566
/* #undef OS_IS_DARWIN */
567
568
/* Build target is Windows. */
569
/* #undef OS_IS_WIN32 */
570
571
/* Name of package */
572
#define PACKAGE "pulseaudio"
573
574
/* Define to the address where bug reports for this package should be sent. */
575
#define PACKAGE_BUGREPORT "pulseaudio-discuss (at) lists (dot) freedesktop (dot) org"
576
577
/* Define to the full name of this package. */
578
#define PACKAGE_NAME "pulseaudio"
579
580
/* Define to the full name and version of this package. */
581
#define PACKAGE_STRING "pulseaudio 8.0"
582
583
/* Define to the one symbol short name of this package. */
584
#define PACKAGE_TARNAME "pulseaudio"
585
586
/* Define to the home page for this package. */
587
#define PACKAGE_URL "http://pulseaudio.org/"
588
589
/* Define to the version of this package. */
590
#define PACKAGE_VERSION "8.0"
591
592
/* Location of pactl binary */
593
#define PACTL_BINARY "/usr/local/bin/pactl"
594
595
/* Access group */
596
#define PA_ACCESS_GROUP "pulse-access"
597
598
/* Location of pulseaudio binary */
599
#define PA_BINARY "/usr/local/bin/pulseaudio"
600
601
/* The CFLAGS used during compilation */
602
#define PA_CFLAGS "-O2 -pipe  -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing -Wall -W -Wextra -Wno-long-long -Wno-overlength-strings -Wundef -Wformat=2 -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -fno-common -fdiagnostics-show-option -fdiagnostics-color=auto"
603
604
/* Location of configuration files */
605
#define PA_DEFAULT_CONFIG_DIR "/usr/local/etc/pulse"
606
607
/* Modules dir */
608
#define PA_DLSEARCHPATH "/usr/local/lib/pulse-8.0/modules"
609
610
/* PulseAudio include dir */
611
#define PA_INCDIR "/usr/local/include"
612
613
/* PulseAudio library dir */
614
#define PA_LIBDIR "/usr/local/lib"
615
616
/* D-Bus machine-id file */
617
#define PA_MACHINE_ID "/usr/local/etc/machine-id"
618
619
/* Fallback machine-id file */
620
#define PA_MACHINE_ID_FALLBACK "/var/lib/dbus/machine-id"
621
622
/* Shared object extension */
623
#define PA_SOEXT ".so"
624
625
/* System config dir */
626
#define PA_SYSTEM_CONFIG_PATH "/var/lib/pulse"
627
628
/* Group for the PulseAudio system daemon */
629
#define PA_SYSTEM_GROUP "pulse"
630
631
/* System runtime dir */
632
#define PA_SYSTEM_RUNTIME_PATH "/var/run/pulse"
633
634
/* System state dir */
635
#define PA_SYSTEM_STATE_PATH "/var/lib/pulse"
636
637
/* User for running the PulseAudio system daemon */
638
#define PA_SYSTEM_USER "pulse"
639
640
/* Define to necessary symbol if this constant uses a non-standard name on
641
   your system. */
642
/* #undef PTHREAD_CREATE_JOINABLE */
643
644
/* The size of `void*', as computed by sizeof. */
645
#define SIZEOF_VOIDP 8
646
647
/* If using the C implementation of alloca, define if you know the
648
   direction of stack growth for your system; otherwise it will be
649
   automatically deduced at runtime.
650
	STACK_DIRECTION > 0 => grows toward higher addresses
651
	STACK_DIRECTION < 0 => grows toward lower addresses
652
	STACK_DIRECTION = 0 => direction of growth unknown */
653
/* #undef STACK_DIRECTION */
654
655
/* Define to 1 if you have the ANSI C header files. */
656
#define STDC_HEADERS 1
657
658
/* Define this if the compiler supports __thread for Thread-Local Storage */
659
#define SUPPORT_TLS___THREAD 1
660
661
/* If the compiler supports a TLS storage class define it to that here */
662
#define TLS __thread
663
664
/* Define this if you want per-user esound socket directories */
665
#define USE_PER_USER_ESOUND_SOCKET 1
666
667
/* Enable extensions on AIX 3, Interix.  */
668
#ifndef _ALL_SOURCE
669
# define _ALL_SOURCE 1
670
#endif
671
/* Enable GNU extensions on systems that have them.  */
672
#ifndef _GNU_SOURCE
673
# define _GNU_SOURCE 1
674
#endif
675
/* Enable threading extensions on Solaris.  */
676
#ifndef _POSIX_PTHREAD_SEMANTICS
677
# define _POSIX_PTHREAD_SEMANTICS 1
678
#endif
679
/* Enable extensions on HP NonStop.  */
680
#ifndef _TANDEM_SOURCE
681
# define _TANDEM_SOURCE 1
682
#endif
683
/* Enable general extensions on Solaris.  */
684
#ifndef __EXTENSIONS__
685
# define __EXTENSIONS__ 1
686
#endif
687
688
689
/* Version number of package */
690
#define VERSION "8.0"
691
692
/* Needed to avoid including unnecessary headers on Windows */
693
/* #undef WIN32_LEAN_AND_MEAN */
694
695
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
696
   significant byte first (like Motorola and SPARC, unlike Intel). */
697
#if defined AC_APPLE_UNIVERSAL_BUILD
698
# if defined __BIG_ENDIAN__
699
#  define WORDS_BIGENDIAN 1
700
# endif
701
#else
702
# ifndef WORDS_BIGENDIAN
703
/* #  undef WORDS_BIGENDIAN */
704
# endif
705
#endif
706
707
/* Needed to get NSIG on Mac OS X */
708
/* #undef _DARWIN_C_SOURCE */
709
710
/* Enable large inode numbers on Mac OS X 10.5.  */
711
#ifndef _DARWIN_USE_64_BIT_INODE
712
# define _DARWIN_USE_64_BIT_INODE 1
713
#endif
714
715
/* Number of bits in a file offset, on hosts where this is settable. */
716
/* #undef _FILE_OFFSET_BITS */
717
718
/* Define for large files, on AIX-style hosts. */
719
/* #undef _LARGE_FILES */
720
721
/* Define to 1 if on MINIX. */
722
/* #undef _MINIX */
723
724
/* Define to 2 if the system does not provide POSIX.1 features except with
725
   this defined. */
726
/* #undef _POSIX_1_SOURCE */
727
728
/* Needed on Solaris */
729
#define _POSIX_PTHREAD_SEMANTICS 1
730
731
/* Define to 1 if you need to in order for `stat' and other things to work. */
732
/* #undef _POSIX_SOURCE */
733
734
/* Needed to get declarations for msg_control and msg_controllen on Solaris */
735
/* #undef _XOPEN_SOURCE */
736
737
/* Needed to get declarations for msg_control and msg_controllen on Solaris */
738
#define __EXTENSIONS__ 1
739
740
/* Define to empty if `const' does not conform to ANSI C. */
741
/* #undef const */
742
743
/* Define to `int' if <sys/types.h> doesn't define. */
744
/* #undef gid_t */
745
746
/* Define to `long int' if <sys/types.h> does not define. */
747
/* #undef off_t */
748
749
/* Define to `int' if <sys/types.h> does not define. */
750
/* #undef pid_t */
751
752
/* Define to `unsigned int' if <sys/types.h> does not define. */
753
/* #undef size_t */
754
755
/* Define ssize_t if it is not done by the standard libs. */
756
/* #undef ssize_t */
757
758
/* Define to `int' if <sys/types.h> doesn't define. */
759
/* #undef uid_t */
760
761
/* Define as `fork' if `vfork' does not work. */
762
/* #undef vfork */
(-)audio/pulseaudio-module-sndio/files/module-sndio-symdef.h (+31 lines)
Line 0 Link Here
1
/* $OpenBSD: module-sndio-symdef.h,v 1.2 2014/03/20 17:33:09 ajacoutot Exp $ */
2
3
#ifndef foomodulesndiosymdeffoo
4
#define foomodulesndiosymdeffoo
5
6
#include <pulsecore/core.h>
7
#include <pulsecore/module.h>
8
#include <pulsecore/macro.h>
9
10
#define pa__init module_sndio_LTX_pa__init
11
#define pa__done module_sndio_LTX_pa__done
12
#define pa__get_author module_sndio_LTX_pa__get_author
13
#define pa__get_description module_sndio_LTX_pa__get_description
14
#define pa__get_usage module_sndio_LTX_pa__get_usage
15
#define pa__get_version module_sndio_LTX_pa__get_version
16
#define pa__get_deprecated module_sndio_LTX_pa__get_deprecated
17
#define pa__load_once module_sndio_LTX_pa__load_once
18
#define pa__get_n_used module_sndio_LTX_pa__get_n_used
19
20
int pa__init(pa_module*m);
21
void pa__done(pa_module*m);
22
int pa__get_n_used(pa_module*m);
23
24
const char* pa__get_author(void);
25
const char* pa__get_description(void);
26
const char* pa__get_usage(void);
27
const char* pa__get_version(void);
28
const char* pa__get_deprecated(void);
29
bool pa__load_once(void);
30
31
#endif
(-)audio/pulseaudio-module-sndio/files/module-sndio-sysex.h (+120 lines)
Line 0 Link Here
1
/*	$OpenBSD: module-sndio-sysex.h,v 1.1 2012/10/08 17:19:57 eric Exp $	*/
2
/*
3
 * Copyright (c) 2011 Alexandre Ratchov <alex@caoua.org>
4
 *
5
 * Permission to use, copy, modify, and distribute this software for any
6
 * purpose with or without fee is hereby granted, provided that the above
7
 * copyright notice and this permission notice appear in all copies.
8
 *
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
 */
17
#ifndef AUCAT_SYSEX_H
18
#define AUCAT_SYSEX_H
19
20
#include <stdint.h>
21
22
/*
23
 * start and end markers
24
 */
25
#define SYSEX_START		0xf0
26
#define SYSEX_END		0xf7
27
28
/*
29
 * type/vendor namespace IDs we use
30
 */
31
#define SYSEX_TYPE_RT		0x7f	/* real-time universal */
32
#define SYSEX_TYPE_EDU		0x7d	/* non-comercial */
33
34
/*
35
 * realtime messages in the "universal real-time" namespace
36
 */
37
#define SYSEX_MTC		0x01		/* mtc messages */
38
#define   SYSEX_MTC_FULL	0x01		/* mtc full frame message */
39
#define SYSEX_CONTROL		0x04
40
#define   SYSEX_MASTER		0x01
41
#define SYSEX_MMC		0x06
42
#define   SYSEX_MMC_STOP	0x01
43
#define   SYSEX_MMC_START	0x02
44
#define   SYSEX_MMC_LOC		0x44
45
#define   SYSEX_MMC_LOC_LEN	0x06
46
#define   SYSEX_MMC_LOC_CMD	0x01
47
48
/*
49
 * aucat-specific messages, in the "edu" namespace
50
 */
51
#define SYSEX_AUCAT		0x23		/* aucat-specific */
52
#define   SYSEX_AUCAT_MIXINFO	0x01		/* mixer info */
53
#define   SYSEX_AUCAT_DUMPREQ	0x02		/* dump request */
54
#define   SYSEX_AUCAT_DUMPEND	0x03		/* end of dump */
55
56
/*
57
 * minimum size of sysex message we accept
58
 */
59
#define SYSEX_SIZE(m)	(5 + sizeof(struct sysex_ ## m))
60
61
/*
62
 * all possible system exclusive messages we support. For aucat-specific
63
 * messages we use the same header as real-time messages to simplify the
64
 * message parser
65
 */
66
struct sysex {
67
	uint8_t start;
68
	uint8_t type;				/* type or vendor id */
69
	uint8_t dev;				/* device or product id */
70
	uint8_t id0;				/* message id */
71
	uint8_t id1;				/* sub-id */
72
	union sysex_all {
73
		struct sysex_empty {
74
			uint8_t end;
75
		} empty;
76
		struct sysex_master {
77
			uint8_t fine;
78
			uint8_t coarse;
79
			uint8_t end;
80
		} master;
81
		struct sysex_start {
82
			uint8_t end;
83
		} start;
84
		struct sysex_stop {
85
			uint8_t end;
86
		} stop;
87
		struct sysex_loc {
88
			uint8_t len;
89
			uint8_t cmd;
90
			uint8_t hr;
91
			uint8_t min;
92
			uint8_t sec;
93
			uint8_t fr;
94
			uint8_t cent;
95
			uint8_t end;
96
		} loc;
97
		struct sysex_full {
98
			uint8_t hr;
99
			uint8_t min;
100
			uint8_t sec;
101
			uint8_t fr;
102
			uint8_t end;
103
		} full;
104
		struct sysex_mixinfo {
105
			uint8_t chan;			/* channel */
106
			uint8_t vol;			/* current volume */
107
#define SYSEX_NAMELEN	10				/* \0 included */
108
			uint8_t name[SYSEX_NAMELEN];	/* stream name */
109
			uint8_t end;
110
		} mixinfo;
111
		struct sysex_dumpreq {
112
			uint8_t end;
113
		} dumpreq;
114
		struct sysex_dumpend {
115
			uint8_t end;
116
		} dumpend;
117
	} u;
118
};
119
120
#endif /* !defined(AUCAT_SYSEX_H) */
(-)audio/pulseaudio-module-sndio/files/module-sndio.c (+672 lines)
Line 0 Link Here
1
/* $OpenBSD: module-sndio.c,v 1.9 2016/02/06 07:48:37 ajacoutot Exp $ */
2
/*
3
 * Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
4
 *
5
 * Permission to use, copy, modify, and distribute this software for any
6
 * purpose with or without fee is hereby granted, provided that the above
7
 * copyright notice and this permission notice appear in all copies.
8
 *
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
 */
17
18
#include <stdlib.h>
19
#include <sndio.h>
20
21
#include "config.h"
22
23
#include <pulse/util.h>
24
25
#include <pulsecore/core-error.h>
26
#include <pulsecore/thread.h>
27
#include <pulsecore/sink.h>
28
#include <pulsecore/source.h>
29
#include <pulsecore/module.h>
30
#include <pulsecore/sample-util.h>
31
#include <pulsecore/core-util.h>
32
#include <pulsecore/modargs.h>
33
#include <pulsecore/log.h>
34
#include <pulsecore/macro.h>
35
#include <pulsecore/thread-mq.h>
36
#include <pulsecore/rtpoll.h>
37
#include <pulsecore/poll.h>
38
39
#include "module-sndio-symdef.h"
40
#include "module-sndio-sysex.h"
41
42
/*
43
 * TODO
44
 *
45
 * - handle latency correctly
46
 * - make recording work correctly with playback
47
 */
48
49
PA_MODULE_AUTHOR("Eric Faurot");
50
PA_MODULE_DESCRIPTION("OpenBSD sndio sink/source");
51
PA_MODULE_VERSION("0.0");
52
PA_MODULE_LOAD_ONCE(false);
53
PA_MODULE_USAGE(
54
	"sink_name=<name for the sink> "
55
	"sink_properties=<properties for the sink> "
56
	"source_name=<name for the source> "
57
	"source_properties=<properties for the source> "
58
	"device=<sndio device> "
59
	"record=<enable source?> "
60
	"playback=<enable sink?> "
61
	"format=<sample format> "
62
	"rate=<sample rate> "
63
	"channels=<number of channels> "
64
	"channel_map=<channel map> ");
65
66
static const char* const modargs[] = {
67
	"sink_name",
68
	"sink_properties",
69
	"source_name",
70
	"source_properties",
71
	"device",
72
	"record",
73
	"playback",
74
	"format",
75
	"rate",
76
	"channels",
77
	"channel_map",
78
	NULL
79
};
80
81
struct userdata {
82
	pa_core		*core;
83
	pa_module	*module;
84
	pa_sink		*sink;
85
	pa_source	*source;
86
87
	pa_thread	*thread;
88
	pa_thread_mq	 thread_mq;
89
	pa_rtpoll	*rtpoll;
90
	pa_rtpoll_item	*rtpoll_item;
91
92
	pa_memchunk	 memchunk;
93
94
	struct sio_hdl	*hdl;
95
	struct sio_par	 par;
96
	size_t		 bufsz;
97
98
	int		 sink_running;
99
	unsigned int	 volume;
100
101
	int		 set_master;		/* master we're writing */
102
	int		 last_master;		/* last master we wrote */
103
	int		 feedback_master;	/* actual master */
104
	int		 mst;
105
	int		 midx;
106
	int		 mlen;
107
	int		 mready;
108
#define MSGMAX		0x100
109
	uint8_t		 mmsg[MSGMAX];
110
};
111
112
static void
113
sndio_on_volume(void *arg, unsigned int vol)
114
{
115
	struct userdata *u = arg;
116
117
	u->volume = vol;
118
}
119
120
static void
121
sndio_get_volume(pa_sink *s)
122
{
123
	struct userdata *u = s->userdata;
124
	int		 i;
125
	uint32_t	 v;
126
127
	if (u->feedback_master >= SIO_MAXVOL)
128
		v = PA_VOLUME_NORM;
129
	else
130
		v = PA_CLAMP_VOLUME((u->volume * PA_VOLUME_NORM) / SIO_MAXVOL);
131
132
	for (i = 0; i < s->real_volume.channels; i++)
133
		s->real_volume.values[i] = v;
134
}
135
136
static void
137
sndio_set_volume(pa_sink *s)
138
{
139
	struct userdata *u = s->userdata;
140
141
	if (s->real_volume.values[0] >= PA_VOLUME_NORM)
142
		u->set_master = SIO_MAXVOL;
143
	else
144
		u->set_master = (s->real_volume.values[0] * SIO_MAXVOL) / PA_VOLUME_NORM;
145
}
146
147
static int
148
sndio_sink_message(pa_msgobject *o, int code, void *data, int64_t offset,
149
    pa_memchunk *chunk)
150
{
151
	struct userdata	*u = PA_SINK(o)->userdata;
152
	pa_sink_state_t	 state;
153
	int		 ret;
154
155
	pa_log_debug(
156
	    "sndio_sink_msg: obj=%p code=%i data=%p offset=%lli chunk=%p",
157
	    o, code, data, offset, chunk);
158
	switch (code) {
159
	case PA_SINK_MESSAGE_GET_LATENCY:
160
		pa_log_debug("sink:PA_SINK_MESSAGE_GET_LATENCY");
161
		*(pa_usec_t*)data = pa_bytes_to_usec(u->par.bufsz,
162
		    &u->sink->sample_spec);
163
		return (0);
164
	case PA_SINK_MESSAGE_SET_STATE:
165
		pa_log_debug("sink:PA_SINK_MESSAGE_SET_STATE ");
166
		state = (pa_sink_state_t)(data);
167
		switch (state) {
168
		case PA_SINK_SUSPENDED:
169
			pa_log_debug("SUSPEND");
170
			if (u->sink_running == 1)
171
				sio_stop(u->hdl);
172
			u->sink_running = 0;
173
			break;
174
		case PA_SINK_IDLE:
175
		case PA_SINK_RUNNING:
176
			pa_log_debug((code == PA_SINK_IDLE) ? "IDLE":"RUNNING");
177
			if (u->sink_running == 0)
178
				sio_start(u->hdl);
179
			u->sink_running = 1;
180
			break;
181
		case PA_SINK_INVALID_STATE:
182
			pa_log_debug("INVALID_STATE");
183
			break;
184
		case PA_SINK_UNLINKED:
185
			pa_log_debug("UNLINKED");
186
			break;
187
		case PA_SINK_INIT:
188
			pa_log_debug("INIT");
189
			break;
190
		}
191
		break;
192
	default:
193
		pa_log_debug("sink:PA_SINK_???");
194
	}
195
196
	ret = pa_sink_process_msg(o, code, data, offset, chunk);
197
198
	return (ret);
199
}
200
201
static int
202
sndio_source_message(pa_msgobject *o, int code, void *data, int64_t offset,
203
    pa_memchunk *chunk)
204
{
205
	struct userdata		*u = PA_SOURCE(o)->userdata;
206
	pa_source_state_t	 state;
207
	int			 ret;
208
209
	pa_log_debug(
210
	    "sndio_source_msg: obj=%p code=%i data=%p offset=%lli chunk=%p",
211
	    o, code, data, offset, chunk);
212
	switch (code) {
213
	case PA_SOURCE_MESSAGE_GET_LATENCY:
214
		pa_log_debug("source:PA_SOURCE_MESSAGE_GET_LATENCY");
215
		*(pa_usec_t*)data = pa_bytes_to_usec(u->bufsz,
216
		    &u->source->sample_spec);
217
		return (0);
218
	case PA_SOURCE_MESSAGE_SET_STATE:
219
		pa_log_debug("source:PA_SOURCE_MESSAGE_SET_STATE ");
220
		state = (pa_source_state_t)(data);
221
		switch (state) {
222
		case PA_SOURCE_SUSPENDED:
223
			pa_log_debug("SUSPEND");
224
			sio_stop(u->hdl);
225
			break;
226
		case PA_SOURCE_IDLE:
227
		case PA_SOURCE_RUNNING:
228
			pa_log_debug((code == PA_SOURCE_IDLE)?"IDLE":"RUNNING");
229
			sio_start(u->hdl);
230
			break;
231
		case PA_SOURCE_INVALID_STATE:
232
			pa_log_debug("INVALID_STATE");
233
			break;
234
		case PA_SOURCE_UNLINKED:
235
			pa_log_debug("UNLINKED");
236
			break;
237
		case PA_SOURCE_INIT:
238
			pa_log_debug("INIT");
239
			break;
240
		}
241
		break;
242
	default:
243
		pa_log_debug("source:PA_SOURCE_???");
244
	}
245
246
	ret = pa_source_process_msg(o, code, data, offset, chunk);
247
248
	return (ret);
249
}
250
251
static void
252
sndio_thread(void *arg)
253
{
254
	struct userdata	*u = arg;
255
	int		 ret;
256
	short		 revents, events;
257
	struct pollfd	*fds_sio;
258
	size_t		 w, r, l;
259
	char		*p;
260
	struct pa_memchunk memchunk;
261
262
	pa_log_debug("sndio thread starting up");
263
264
	pa_thread_mq_install(&u->thread_mq);
265
266
	fds_sio = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
267
268
	revents = 0;
269
	for (;;) {
270
		pa_log_debug("sndio_thread: loop");
271
272
		/* ??? oss does that. */
273
		if (u->sink
274
		    && PA_SINK_IS_OPENED(u->sink->thread_info.state)
275
		    && u->sink->thread_info.rewind_requested)
276
			pa_sink_process_rewind(u->sink, 0);
277
278
		if (u->sink &&
279
		    PA_SINK_IS_OPENED(u->sink->thread_info.state)
280
		    && (revents & POLLOUT)) {
281
			if (u->memchunk.length <= 0)
282
				pa_sink_render(u->sink, u->bufsz, &u->memchunk);
283
			p = pa_memblock_acquire(u->memchunk.memblock);
284
			w = sio_write(u->hdl, p + u->memchunk.index,
285
			    u->memchunk.length);
286
			pa_memblock_release(u->memchunk.memblock);
287
			pa_log_debug("wrote %zu bytes of %zu", w,
288
			    u->memchunk.length);
289
			u->memchunk.index += w;
290
			u->memchunk.length -= w;
291
			if (u->memchunk.length <= 0) {
292
				pa_memblock_unref(u->memchunk.memblock);
293
				pa_memchunk_reset(&u->memchunk);
294
			}
295
		}
296
297
		if (u->source &&
298
		    PA_SOURCE_IS_OPENED(u->source->thread_info.state)
299
		    && (revents & POLLIN)) {
300
			memchunk.memblock = pa_memblock_new(u->core->mempool,
301
			    (size_t) -1);
302
			l = pa_memblock_get_length(memchunk.memblock);
303
			if (l > u->bufsz)
304
				l = u->bufsz;
305
			p = pa_memblock_acquire(memchunk.memblock);
306
			r = sio_read(u->hdl, p, l);
307
			pa_memblock_release(memchunk.memblock);
308
			pa_log_debug("read %zu bytes of %zu", r, l);
309
			memchunk.index = 0;
310
			memchunk.length = r;
311
			pa_source_post(u->source, &memchunk);
312
			pa_memblock_unref(memchunk.memblock);
313
		}
314
315
		events = 0;
316
		if (u->source &&
317
		    PA_SOURCE_IS_OPENED(u->source->thread_info.state))
318
			events |= POLLIN;
319
		if (u->sink &&
320
		    PA_SINK_IS_OPENED(u->sink->thread_info.state))
321
			events |= POLLOUT;
322
323
		/*
324
		 * XXX: {sio,mio}_pollfd() return the number
325
		 * of descriptors to poll(). It's not correct
326
		 * to assume only 1 descriptor is used
327
		 */
328
329
		sio_pollfd(u->hdl, fds_sio, events);
330
331
		if ((ret = pa_rtpoll_run(u->rtpoll)) < 0)
332
	    		goto fail;
333
		if (ret == 0)
334
	    		goto finish;
335
336
		revents = sio_revents(u->hdl, fds_sio);
337
338
		pa_log_debug("sndio_thread: loop ret=%i, revents=%x", ret,
339
		    (int)revents);
340
341
		if (revents & POLLHUP) {
342
			pa_log("POLLHUP!");
343
			break;
344
		}
345
	}
346
347
    fail:
348
	pa_asyncmsgq_post(u->thread_mq.outq, PA_MSGOBJECT(u->core),
349
	    PA_CORE_MESSAGE_UNLOAD_MODULE, u->module, 0, NULL, NULL);
350
	pa_asyncmsgq_wait_for(u->thread_mq.inq, PA_MESSAGE_SHUTDOWN);
351
    finish:
352
	pa_log_debug("sndio thread shutting down");
353
}
354
355
int
356
pa__init(pa_module *m)
357
{
358
	bool			 record = false, playback = true;
359
	pa_modargs		*ma = NULL;
360
	pa_sample_spec		 ss;
361
	pa_channel_map		 map;
362
	pa_sink_new_data	 sink;
363
	pa_source_new_data	 source;
364
365
	struct sio_par		 par;
366
	unsigned int		 mode = 0;
367
	char			 buf[256];
368
	const char		*name, *dev;
369
	struct userdata		*u = NULL;
370
	int			 nfds;
371
	struct			 pollfd;
372
373
	if ((u = calloc(1, sizeof(struct userdata))) == NULL) {
374
		pa_log("Failed to allocate userdata");
375
		goto fail;
376
	}
377
	m->userdata = u;
378
	u->core = m->core;
379
	u->module = m;
380
	u->rtpoll = pa_rtpoll_new();
381
	pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
382
383
	if (!(ma = pa_modargs_new(m->argument, modargs))) {
384
		pa_log("Failed to parse module arguments.");
385
		goto fail;
386
	}
387
388
	if (pa_modargs_get_value_boolean(ma, "record", &record) < 0 ||
389
	    pa_modargs_get_value_boolean(ma, "playback", &playback) < 0) {
390
		pa_log("record= and playback= expect boolean argument");
391
		goto fail;
392
	}
393
394
	if (playback)
395
		mode |= SIO_PLAY;
396
	if (record)
397
		mode |= SIO_REC;
398
399
	if (!mode) {
400
		pa_log("Neither playback nor record enabled for device");
401
		goto fail;
402
	}
403
404
	dev = pa_modargs_get_value(ma, "device", NULL);
405
	if ((u->hdl = sio_open(dev, mode, 1)) == NULL) {
406
		pa_log("Cannot open sndio device.");
407
		goto fail;
408
	}
409
410
	ss = m->core->default_sample_spec;
411
	map = m->core->default_channel_map;
412
413
	if (pa_modargs_get_sample_spec_and_channel_map(ma, &ss, &map,
414
	    PA_CHANNEL_MAP_OSS) < 0) {
415
		pa_log("Failed to parse sample specification or channel map");
416
		goto fail;
417
	}
418
419
	sio_initpar(&par);
420
	par.rate = ss.rate;
421
	par.pchan = (mode & SIO_PLAY) ? ss.channels : 0;
422
	par.rchan = (mode & SIO_REC) ? ss.channels : 0;
423
	par.sig = 1;
424
425
	switch (ss.format) {
426
	case PA_SAMPLE_U8:
427
		par.bits = 8;
428
		par.bps = 1;
429
		par.sig = 0;
430
		break;
431
	case PA_SAMPLE_S16LE:
432
	case PA_SAMPLE_S16BE:
433
		par.bits = 16;
434
		par.bps = 2;
435
		par.le = (ss.format == PA_SAMPLE_S16LE) ? 1 : 0;
436
		break;
437
	case PA_SAMPLE_S32LE:
438
	case PA_SAMPLE_S32BE:
439
		par.bits = 32;
440
		par.bps = 4;
441
		par.le = (ss.format == PA_SAMPLE_S32LE) ? 1 : 0;
442
		break;
443
	case PA_SAMPLE_S24LE:
444
	case PA_SAMPLE_S24BE:
445
		par.bits = 24;
446
		par.bps = 3;
447
		par.le = (ss.format == PA_SAMPLE_S24LE) ? 1 : 0;
448
		break;
449
	case PA_SAMPLE_S24_32LE:
450
	case PA_SAMPLE_S24_32BE:
451
		par.bits = 24;
452
		par.bps = 4;
453
		par.le = (ss.format == PA_SAMPLE_S24_32LE) ? 1 : 0;
454
		par.msb = 0; /* XXX check this */
455
		break;
456
	case PA_SAMPLE_ALAW:
457
	case PA_SAMPLE_ULAW:
458
	case PA_SAMPLE_FLOAT32LE:
459
	case PA_SAMPLE_FLOAT32BE:
460
	default:
461
		pa_log("Unsupported sample format");
462
		goto fail;
463
	}
464
465
	/* XXX what to do with channel map? */
466
467
	if (sio_setpar(u->hdl, &par) == -1) {
468
		pa_log("Could not set requested parameters");
469
		goto fail;
470
	}
471
	if (sio_getpar(u->hdl, &u->par) == -1) {
472
		pa_log("Could not retreive parameters");
473
		goto fail;
474
	}
475
	if (u->par.rate != par.rate)
476
		pa_log_warn("rate changed: %u -> %u", par.rate, u->par.rate);
477
	if (u->par.pchan != par.pchan)
478
		pa_log_warn("playback channels changed: %u -> %u",
479
		    par.rchan, u->par.rchan);
480
	if (u->par.rchan != par.rchan)
481
		pa_log_warn("record channels changed: %u -> %u",
482
		    par.rchan, u->par.rchan);
483
	/* XXX check sample format */
484
485
	ss.rate = u->par.rate;
486
	ss.channels = (mode & SIO_PLAY) ? u->par.pchan : u->par.rchan;
487
	/* XXX what to do with map? */
488
489
	u->bufsz = u->par.bufsz * u->par.bps * u->par.pchan;
490
491
	nfds = sio_nfds(u->hdl);
492
	u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, nfds);
493
	if (u->rtpoll_item == NULL) {
494
		pa_log("could not allocate poll item");
495
		goto fail;
496
	}
497
498
	if (mode & SIO_PLAY) {
499
500
		pa_sink_new_data_init(&sink);
501
		sink.driver = __FILE__;
502
		sink.module = m;
503
		sink.namereg_fail = true;
504
		name = pa_modargs_get_value(ma, "sink_name", NULL);
505
		if (name == NULL) {
506
			sink.namereg_fail = false;
507
			snprintf(buf, sizeof (buf), "sndio-sink");
508
			name = buf;
509
		}
510
		pa_sink_new_data_set_name(&sink, name);
511
		pa_sink_new_data_set_sample_spec(&sink, &ss);
512
		pa_sink_new_data_set_channel_map(&sink, &map);
513
		pa_proplist_sets(sink.proplist,
514
		    PA_PROP_DEVICE_STRING, dev ? dev : "default");
515
		pa_proplist_sets(sink.proplist,
516
		    PA_PROP_DEVICE_API, "sndio");
517
		pa_proplist_sets(sink.proplist,
518
		    PA_PROP_DEVICE_DESCRIPTION, dev ? dev : "default");
519
		pa_proplist_sets(sink.proplist,
520
		    PA_PROP_DEVICE_ACCESS_MODE, "serial");
521
/*
522
		pa_proplist_setf(sink.proplist,
523
		    PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%u",
524
		    u->par.bufsz * u->par.bps * u->par.pchan);
525
*/
526
527
/*
528
		pa_proplist_setf(sink.proplist,
529
		    PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE, "%lu",
530
		    (unsigned long) (u->out_fragment_size));
531
*/
532
		if (pa_modargs_get_proplist(ma, "sink_properties",
533
		    sink.proplist, PA_UPDATE_REPLACE) < 0) {
534
			pa_log("Invalid sink properties");
535
			pa_sink_new_data_done(&sink);
536
			goto fail;
537
		}
538
539
		u->sink = pa_sink_new(m->core, &sink, PA_SINK_LATENCY);
540
		pa_sink_new_data_done(&sink);
541
		if (u->sink == NULL) {
542
			pa_log("Failed to create sync");
543
			goto fail;
544
		}
545
546
		u->sink->userdata = u;
547
		u->sink->parent.process_msg = sndio_sink_message;
548
		pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
549
		pa_sink_set_rtpoll(u->sink, u->rtpoll);
550
		pa_sink_set_fixed_latency(u->sink,
551
		    pa_bytes_to_usec(u->bufsz, &u->sink->sample_spec));
552
553
		sio_onvol(u->hdl, sndio_on_volume, u);
554
		pa_sink_set_get_volume_callback(u->sink, sndio_get_volume);
555
		pa_sink_set_set_volume_callback(u->sink, sndio_set_volume);
556
		u->sink->n_volume_steps = SIO_MAXVOL + 1;
557
	}
558
559
	if (mode & SIO_REC) {
560
		pa_source_new_data_init(&source);
561
		source.driver = __FILE__;
562
		source.module = m;
563
		source.namereg_fail = true;
564
		name = pa_modargs_get_value(ma, "source_name", NULL);
565
		if (name == NULL) {
566
			source.namereg_fail = false;
567
			snprintf(buf, sizeof (buf), "sndio-source");
568
			name = buf;
569
		}
570
		pa_source_new_data_set_name(&source, name);
571
		pa_source_new_data_set_sample_spec(&source, &ss);
572
		pa_source_new_data_set_channel_map(&source, &map);
573
		pa_proplist_sets(source.proplist,
574
		    PA_PROP_DEVICE_STRING, dev ? dev : "default");
575
		pa_proplist_sets(source.proplist,
576
		    PA_PROP_DEVICE_API, "sndio");
577
		pa_proplist_sets(source.proplist,
578
		    PA_PROP_DEVICE_DESCRIPTION, dev ? dev : "default");
579
		pa_proplist_sets(source.proplist,
580
		    PA_PROP_DEVICE_ACCESS_MODE, "serial");
581
		pa_proplist_setf(source.proplist,
582
		    PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%u",
583
		    u->par.bufsz * u->par.bps * u->par.rchan);
584
/*
585
		pa_proplist_setf(source.proplist,
586
		    PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE, "%lu",
587
		    (unsigned long) (u->in_fragment_size));
588
*/
589
		if (pa_modargs_get_proplist(ma, "source_properties",
590
		    source.proplist, PA_UPDATE_REPLACE) < 0) {
591
			pa_log("Invalid source properties");
592
			pa_source_new_data_done(&source);
593
			goto fail;
594
		}
595
596
		u->source = pa_source_new(m->core, &source, PA_SOURCE_LATENCY);
597
		pa_source_new_data_done(&source);
598
		if (u->source == NULL) {
599
			pa_log("Failed to create source");
600
			goto fail;
601
		}
602
603
		u->source->userdata = u;
604
		u->source->parent.process_msg = sndio_source_message;
605
		pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);
606
		pa_source_set_rtpoll(u->source, u->rtpoll);
607
/*
608
		pa_source_set_fixed_latency(u->source,
609
		    pa_bytes_to_usec(u->in_hwbuf_size, &u->source->sample_spec));
610
*/
611
	}
612
613
	pa_log_debug("buffer: frame=%u bytes=%zu msec=%u", u->par.bufsz,
614
	    u->bufsz, (unsigned int) pa_bytes_to_usec(u->bufsz, &u->sink->sample_spec));
615
616
	pa_memchunk_reset(&u->memchunk);
617
618
	if ((u->thread = pa_thread_new("sndio", sndio_thread, u)) == NULL) {
619
		pa_log("Failed to create sndio thread.");
620
		goto fail;
621
	}
622
623
	if (u->sink)
624
		pa_sink_put(u->sink);
625
	if (u->source)
626
		pa_source_put(u->source);
627
628
	pa_modargs_free(ma);
629
630
	return (0);
631
fail:
632
	if (u)
633
		pa__done(m);
634
	if (ma)
635
		pa_modargs_free(ma);
636
637
	return (-1);
638
}
639
640
void
641
pa__done(pa_module *m)
642
{
643
	struct userdata *u;
644
645
	if (!(u = m->userdata))
646
		return;
647
648
	if (u->sink)
649
		pa_sink_unlink(u->sink);
650
	if (u->source)
651
		pa_source_unlink(u->source);
652
	if (u->thread) {
653
		pa_asyncmsgq_send(u->thread_mq.inq, NULL, PA_MESSAGE_SHUTDOWN,
654
		    NULL, 0, NULL);
655
		pa_thread_free(u->thread);
656
	}
657
	pa_thread_mq_done(&u->thread_mq);
658
659
	if (u->sink)
660
		pa_sink_unref(u->sink);
661
	if (u->source)
662
		pa_source_unref(u->source);
663
	if (u->memchunk.memblock)
664
		pa_memblock_unref(u->memchunk.memblock);
665
	if (u->rtpoll_item)
666
		pa_rtpoll_item_free(u->rtpoll_item);
667
	if (u->rtpoll)
668
		pa_rtpoll_free(u->rtpoll);
669
	if (u->hdl)
670
		sio_close(u->hdl);
671
	free(u);
672
}
(-)audio/pulseaudio-module-sndio/pkg-descr (+3 lines)
Line 0 Link Here
1
A module for PulseAudio to support playing to sndio servers.
2
3
WWW: http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/audio/pulseaudio/files/
(-)audio/pulseaudio-module-sndio/pkg-message (+8 lines)
Line 0 Link Here
1
To use it load the module with
2
3
    pacmd load-module module-sndio device=snd@<hostname>/0
4
5
then set the default sink or use audio/pavucontrol to set a new sink
6
for a specific stream
7
8
    pacmd set-default-sink sndio-sink
(-)audio/sndio/Makefile (+30 lines)
Line 0 Link Here
1
# Created by: Tobias Kortkamp <t@tobik.me>
2
# $FreeBSD$
3
4
PORTNAME=	sndio
5
PORTVERSION=	1.1.0
6
CATEGORIES=	audio
7
MASTER_SITES=	http://www.sndio.org/
8
9
MAINTAINER=	t@tobik.me
10
COMMENT=	Small audio and MIDI framework from the OpenBSD project
11
12
LICENSE=	ISCL
13
14
HAS_CONFIGURE=	yes
15
CONFIGURE_ARGS=	--prefix=${PREFIX} --mandir=${PREFIX}/man
16
17
USE_LDCONFIG=	yes
18
19
# Parallel build leads to problems, but sndio is very quick to compile
20
# as is so not worth fixing
21
MAKE_JOBS_UNSAFE=	yes
22
23
post-install:
24
	@${STRIP_CMD} \
25
		${STAGEDIR}${PREFIX}/lib/libsndio.so.6.1 \
26
		${STAGEDIR}${PREFIX}/bin/sndiod \
27
		${STAGEDIR}${PREFIX}/bin/aucat \
28
		${STAGEDIR}${PREFIX}/bin/midicat
29
30
.include <bsd.port.mk>
(-)audio/sndio/distinfo (+3 lines)
Line 0 Link Here
1
TIMESTAMP = 1465315037
2
SHA256 (sndio-1.1.0.tar.gz) = fcd7f845ff70f38c2898d737450b8aa3e1bb0afb9d147e8429ef22c0b2c2db57
3
SIZE (sndio-1.1.0.tar.gz) = 121018
(-)audio/sndio/files/patch-configure (+15 lines)
Line 0 Link Here
1
--- configure.orig	2015-12-15 05:28:04 UTC
2
+++ configure
3
@@ -71,6 +71,12 @@ case `uname` in
4
 		defs='-DHAVE_ARC4RANDOM -DHAVE_ISSETUGID \\\
5
 		-DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRTONUM'
6
 		;;
7
+	FreeBSD)
8
+		user=_sndio
9
+		so="$so libsndio.so"
10
+		defs='-DHAVE_ARC4RANDOM -DHAVE_ISSETUGID \\\
11
+		-DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRTONUM'
12
+		;;
13
 esac
14
 
15
 # shell word separator (none)
(-)audio/sndio/pkg-descr (+11 lines)
Line 0 Link Here
1
Sndio is a small audio and MIDI framework part of the OpenBSD
2
project.
3
4
It provides an lightweight audio & MIDI server and a fully documented
5
user-space API to access either the server or directly the hardware in
6
a uniform way.  Sndio is designed to work for desktop applications,
7
but pays special attention to synchronization mechanisms and
8
reliability required by music applications.  Reliability through
9
simplicity are part of the project goals.
10
11
WWW: http://www.sndio.org/
(-)audio/sndio/pkg-message (+7 lines)
Line 0 Link Here
1
sndio has no hardware support on FreeBSD currently, so this port is
2
only useful if you have a sndio server running on a Linux or OpenBSD
3
host.
4
5
Since there is no direct sndio support in FreeBSD ports (yet), it is
6
recommended to use PulseAudio via audio/pulseaudio-module-sndio to
7
access your sndio server.
(-)audio/sndio/pkg-plist (+35 lines)
Line 0 Link Here
1
bin/aucat
2
bin/midicat
3
bin/sndiod
4
include/sndio.h
5
lib/libsndio.so
6
lib/libsndio.so.6.1
7
man/man1/aucat.1.gz
8
man/man1/midicat.1.gz
9
man/man3/mio_close.3.gz
10
man/man3/mio_eof.3.gz
11
man/man3/mio_nfds.3.gz
12
man/man3/mio_open.3.gz
13
man/man3/mio_pollfd.3.gz
14
man/man3/mio_read.3.gz
15
man/man3/mio_revents.3.gz
16
man/man3/mio_write.3.gz
17
man/man3/sio_close.3.gz
18
man/man3/sio_eof.3.gz
19
man/man3/sio_getcap.3.gz
20
man/man3/sio_getpar.3.gz
21
man/man3/sio_initpar.3.gz
22
man/man3/sio_nfds.3.gz
23
man/man3/sio_onmove.3.gz
24
man/man3/sio_onvol.3.gz
25
man/man3/sio_open.3.gz
26
man/man3/sio_pollfd.3.gz
27
man/man3/sio_read.3.gz
28
man/man3/sio_revents.3.gz
29
man/man3/sio_setpar.3.gz
30
man/man3/sio_setvol.3.gz
31
man/man3/sio_start.3.gz
32
man/man3/sio_stop.3.gz
33
man/man3/sio_write.3.gz
34
man/man7/sndio.7.gz
35
man/man8/sndiod.8.gz

Return to bug 210124