FreeBSD Bugzilla – Attachment 171185 Details for
Bug 210124
[NEW PORT] audio/sndio: Small audio and MIDI framework from the OpenBSD project
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
sndio.diff
sndio.diff (text/plain), 51.45 KB, created by
Tobias Kortkamp
on 2016-06-08 08:04:11 UTC
(
hide
)
Description:
sndio.diff
Filename:
MIME Type:
Creator:
Tobias Kortkamp
Created:
2016-06-08 08:04:11 UTC
Size:
51.45 KB
patch
obsolete
>Index: audio/Makefile >=================================================================== >--- audio/Makefile (revision 416533) >+++ audio/Makefile (working copy) >@@ -609,6 +609,7 @@ > SUBDIR += pragha > SUBDIR += puddletag > SUBDIR += pulseaudio >+ SUBDIR += pulseaudio-module-sndio > SUBDIR += py-al > SUBDIR += py-ao > SUBDIR += py-apetag >@@ -697,6 +698,7 @@ > SUBDIR += smasher > SUBDIR += snack > SUBDIR += snd >+ SUBDIR += sndio > SUBDIR += solfege > SUBDIR += sonata > SUBDIR += sooperlooper >Index: audio/pulseaudio-module-sndio/Makefile >=================================================================== >--- audio/pulseaudio-module-sndio/Makefile (nonexistent) >+++ audio/pulseaudio-module-sndio/Makefile (working copy) >@@ -0,0 +1,32 @@ >+# Created by: Tobias Kortkamp <t@tobik.me> >+# $FreeBSD$ >+ >+PORTNAME= pulseaudio >+PORTVERSION= 8.0 >+CATEGORIES= audio >+MASTER_SITES= http://freedesktop.org/software/pulseaudio/releases/ >+PKGNAMESUFFIX= -module-sndio >+ >+MAINTAINER= t@tobik.me >+COMMENT= Sndio module for PulseAudio >+ >+LICENSE= ISCL >+ >+LIB_DEPENDS+= libsndio.so:audio/sndio \ >+ libpulse.so:audio/pulseaudio >+ >+USES= pkgconfig tar:xz >+ >+PULSE_MODULE_DIR= lib/pulse-${PORTVERSION}/modules >+ >+PLIST_FILES= ${PULSE_MODULE_DIR}/module-sndio.so >+ >+post-extract: >+ ${CP} ${FILESDIR}/* ${WRKSRC} >+ >+do-install: >+ ${MKDIR} ${STAGEDIR}${PREFIX}/${PULSE_MODULE_DIR}/ >+ ${INSTALL_LIB} ${WRKSRC}/module-sndio.so \ >+ ${STAGEDIR}${PREFIX}/${PULSE_MODULE_DIR}/ >+ >+.include <bsd.port.mk> >Index: audio/pulseaudio-module-sndio/distinfo >=================================================================== >--- audio/pulseaudio-module-sndio/distinfo (nonexistent) >+++ audio/pulseaudio-module-sndio/distinfo (working copy) >@@ -0,0 +1,2 @@ >+SHA256 (pulseaudio-8.0.tar.xz) = 690eefe28633466cfd1ab9d85ebfa9376f6b622deec6bfee5091ac9737cd1989 >+SIZE (pulseaudio-8.0.tar.xz) = 1517656 >Index: audio/pulseaudio-module-sndio/files/Makefile >=================================================================== >--- audio/pulseaudio-module-sndio/files/Makefile (nonexistent) >+++ audio/pulseaudio-module-sndio/files/Makefile (working copy) >@@ -0,0 +1,26 @@ >+PULSEAUDIO_SRC?=. >+ >+LOCALBASE?= /usr/local >+ >+CFLAGS+= `pkg-config --cflags libpulse` >+LDFLAGS+= `pkg-config --libs libpulse` >+ >+CFLAGS+= -fPIC -DPIC >+ >+CFLAGS+= -I${PULSEAUDIO_SRC}/src >+ >+all: module-sndio.so >+ >+module-sndio.so: module-sndio.o >+ ${CC} -shared module-sndio.o \ >+ -Wl,-rpath -Wl,${LOCALBASE}/lib \ >+ -Wl,-rpath -Wl,${LOCALBASE}/lib/pulseaudio \ >+ ${LDFLAGS} \ >+ -L${LOCALBASE}/lib/pulseaudio \ >+ -lpulsecore-8.0 \ >+ -lpulsecommon-8.0 \ >+ -lsndio \ >+ -o module-sndio.so >+ >+clean: >+ rm -f module-sndio.o module-sndio.so >Index: audio/pulseaudio-module-sndio/files/config.h >=================================================================== >--- audio/pulseaudio-module-sndio/files/config.h (nonexistent) >+++ audio/pulseaudio-module-sndio/files/config.h (working copy) >@@ -0,0 +1,762 @@ >+/* config.h. Generated from config.h.in by configure. */ >+/* config.h.in. Generated from configure.ac by autoheader. */ >+ >+/* Define if building universal (internal helper macro) */ >+/* #undef AC_APPLE_UNIVERSAL_BUILD */ >+ >+/* Have ARM atomic instructions. */ >+/* #undef ATOMIC_ARM_INLINE_ASM */ >+ >+/* special arm linux implementation */ >+/* #undef ATOMIC_ARM_LINUX_HELPERS */ >+ >+/* Enable memory barriers */ >+/* #undef ATOMIC_ARM_MEMORY_BARRIER_ENABLED */ >+ >+/* Canonical host string. */ >+#define CANONICAL_HOST "amd64-portbld-freebsd10.3" >+ >+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP >+ systems. This function is required for `alloca.c' support on those systems. >+ */ >+/* #undef CRAY_STACKSEG_END */ >+ >+/* Define to 1 if using `alloca.c'. */ >+/* #undef C_ALLOCA */ >+ >+/* Disable Orc */ >+/* #undef DISABLE_ORC */ >+ >+/* Legacy database entry format */ >+#define ENABLE_LEGACY_DATABASE_ENTRY_FORMAT 1 >+ >+/* Define to 1 if translation of program messages to the user's native >+ language is requested. */ >+#define ENABLE_NLS 1 >+ >+/* Define to the type of elements in the array set by `getgroups'. Usually >+ this is either `int' or `gid_t'. */ >+#define GETGROUPS_T gid_t >+ >+/* Gettext package */ >+#define GETTEXT_PACKAGE "pulseaudio" >+ >+/* Define to 1 if you have the `accept4' function. */ >+#define HAVE_ACCEPT4 1 >+ >+/* Define to 1 if you have `alloca', as a function or macro. */ >+#define HAVE_ALLOCA 1 >+ >+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). >+ */ >+/* #undef HAVE_ALLOCA_H */ >+ >+/* Have ALSA? */ >+/* #undef HAVE_ALSA */ >+ >+/* Have ALSA UCM? */ >+/* #undef HAVE_ALSA_UCM */ >+ >+/* Have ARMv6 instructions. */ >+/* #undef HAVE_ARMV6 */ >+ >+/* Define to 1 if you have the <arpa/inet.h> header file. */ >+#define HAVE_ARPA_INET_H 1 >+ >+/* Have __sync_bool_compare_and_swap() and friends. */ >+#define HAVE_ATOMIC_BUILTINS 1 >+ >+/* Define to 1 if you have the <atomic_ops.h> header file. */ >+/* #undef HAVE_ATOMIC_OPS_H */ >+ >+/* Bluez 5 native headset backend enabled */ >+/* #undef HAVE_BLUEZ_5_NATIVE_HEADSET */ >+ >+/* Bluez 5 ofono headset backend enabled */ >+/* #undef HAVE_BLUEZ_5_OFONO_HEADSET */ >+ >+/* Define to 1 if you have the <byteswap.h> header file. */ >+/* #undef HAVE_BYTESWAP_H */ >+ >+/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the >+ CoreFoundation framework. */ >+/* #undef HAVE_CFLOCALECOPYCURRENT */ >+ >+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in >+ the CoreFoundation framework. */ >+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ >+ >+/* Define to 1 if you have the `chmod' function. */ >+#define HAVE_CHMOD 1 >+ >+/* Define to 1 if you have the `chown' function. */ >+#define HAVE_CHOWN 1 >+ >+/* Define to 1 if you have the `clock_gettime' function. */ >+#define HAVE_CLOCK_GETTIME 1 >+ >+/* Have CoreAudio? */ >+/* #undef HAVE_COREAUDIO */ >+ >+/* Define to 1 if you have the <CoreAudio/CoreAudio.h> header file. */ >+/* #undef HAVE_COREAUDIO_COREAUDIO_H */ >+ >+/* Define to 1 if you have the `ctime_r' function. */ >+#define HAVE_CTIME_R 1 >+ >+/* Have D-Bus. */ >+#define HAVE_DBUS 1 >+ >+/* Define to 1 if you have the `dbus_watch_get_unix_fd' function. */ >+#define HAVE_DBUS_WATCH_GET_UNIX_FD 1 >+ >+/* Define if the GNU dcgettext() function is already present or preinstalled. >+ */ >+#define HAVE_DCGETTEXT 1 >+ >+/* Define to 1 if you have the declaration of `environ', and to 0 if you >+ don't. */ >+#define HAVE_DECL_ENVIRON 0 >+ >+/* Have dladdr? */ >+#define HAVE_DLADDR 1 >+ >+/* Define to 1 if you have the <dlfcn.h> header file. */ >+#define HAVE_DLFCN_H 1 >+ >+/* Define to 1 if you have the <execinfo.h> header file. */ >+#define HAVE_EXECINFO_H 1 >+ >+/* Have CPU with fast 64-bit operations? */ >+#define HAVE_FAST_64BIT_OPERATIONS 1 >+ >+/* Define to 1 if you have the `fchmod' function. */ >+#define HAVE_FCHMOD 1 >+ >+/* Define to 1 if you have the `fchown' function. */ >+#define HAVE_FCHOWN 1 >+ >+/* Define to 1 if you have the `fork' function. */ >+#define HAVE_FORK 1 >+ >+/* Define to 1 if you have the `fstat' function. */ >+#define HAVE_FSTAT 1 >+ >+/* Have gdbm? */ >+/* #undef HAVE_GDBM */ >+ >+/* Define to 1 if you have the <gdbm.h> header file. */ >+/* #undef HAVE_GDBM_H */ >+ >+/* Define to 1 if you have the `getaddrinfo' function. */ >+#define HAVE_GETADDRINFO 1 >+ >+/* Define to 1 if you have the `getgrgid_r' function. */ >+#define HAVE_GETGRGID_R 1 >+ >+/* Define to 1 if you have the `getgrnam_r' function. */ >+#define HAVE_GETGRNAM_R 1 >+ >+/* Define to 1 if your system has a working `getgroups' function. */ >+#define HAVE_GETGROUPS 1 >+ >+/* Define to 1 if you have the `getopt_long' function. */ >+#define HAVE_GETOPT_LONG 1 >+ >+/* Define to 1 if you have the `getpwnam_r' function. */ >+#define HAVE_GETPWNAM_R 1 >+ >+/* Define to 1 if you have the `getpwuid_r' function. */ >+#define HAVE_GETPWUID_R 1 >+ >+/* Define if the GNU gettext() function is already present or preinstalled. */ >+#define HAVE_GETTEXT 1 >+ >+/* Define to 1 if you have the `gettimeofday' function. */ >+#define HAVE_GETTIMEOFDAY 1 >+ >+/* Define to 1 if you have the `getuid' function. */ >+#define HAVE_GETUID 1 >+ >+/* Have GLIB? */ >+#define HAVE_GLIB 1 >+ >+/* Define to 1 if you have the <glob.h> header file. */ >+#define HAVE_GLOB_H 1 >+ >+/* Define to 1 if you have the <grp.h> header file. */ >+#define HAVE_GRP_H 1 >+ >+/* Have GTK? */ >+/* #undef HAVE_GTK */ >+ >+/* Have HAL compatibility. */ >+/* #undef HAVE_HAL_COMPAT */ >+ >+/* Define if you have the iconv() function and it works. */ >+#define HAVE_ICONV 1 >+ >+/* Define to 1 if you have the <inttypes.h> header file. */ >+#define HAVE_INTTYPES_H 1 >+ >+/* Define this to enable IPv6 connection support */ >+#define HAVE_IPV6 1 >+ >+/* Define to 1 if you have the <langinfo.h> header file. */ >+#define HAVE_LANGINFO_H 1 >+ >+/* Have libasyncns? */ >+/* #undef HAVE_LIBASYNCNS */ >+ >+/* Define to 1 if you have the `gdbm' library (-lgdbm). */ >+/* #undef HAVE_LIBGDBM */ >+ >+/* Define to 1 if you have the `iberty' library (-liberty). */ >+/* #undef HAVE_LIBIBERTY */ >+ >+/* Have libsamplerate? */ >+/* #undef HAVE_LIBSAMPLERATE */ >+ >+/* Have tcpwrap? */ >+#define HAVE_LIBWRAP /**/ >+ >+/* Define to 1 if you have the <linux/input.h> header file. */ >+/* #undef HAVE_LINUX_INPUT_H */ >+ >+/* Define to 1 if you have the <linux/sockios.h> header file. */ >+/* #undef HAVE_LINUX_SOCKIOS_H */ >+ >+/* Define to 1 if you have the <locale.h> header file. */ >+#define HAVE_LOCALE_H 1 >+ >+/* Define to 1 if you have the `lrintf' function. */ >+#define HAVE_LRINTF 1 >+ >+/* Define to 1 if you have the `lstat' function. */ >+#define HAVE_LSTAT 1 >+ >+/* Define to 1 if you have the <memory.h> header file. */ >+#define HAVE_MEMORY_H 1 >+ >+/* Define to 1 if you have the `mkfifo' function. */ >+#define HAVE_MKFIFO 1 >+ >+/* Define to 1 if you have the `mlock' function. */ >+#define HAVE_MLOCK 1 >+ >+/* Define to 1 if you have the <mmsystem.h> header file. */ >+/* #undef HAVE_MMSYSTEM_H */ >+ >+/* Define to 1 if you have the `nanosleep' function. */ >+#define HAVE_NANOSLEEP 1 >+ >+/* Have NEON support? */ >+/* #undef HAVE_NEON */ >+ >+/* Define to 1 if you have the <netdb.h> header file. */ >+#define HAVE_NETDB_H 1 >+ >+/* Define to 1 if you have the <netinet/in.h> header file. */ >+#define HAVE_NETINET_IN_H 1 >+ >+/* Define to 1 if you have the <netinet/in_systm.h> header file. */ >+#define HAVE_NETINET_IN_SYSTM_H 1 >+ >+/* Define to 1 if you have the <netinet/ip.h> header file. */ >+#define HAVE_NETINET_IP_H 1 >+ >+/* Define to 1 if you have the <netinet/tcp.h> header file. */ >+#define HAVE_NETINET_TCP_H 1 >+ >+/* Define to 1 if you have the `open64' function. */ >+/* #undef HAVE_OPEN64 */ >+ >+/* Have OpenSSL */ >+#define HAVE_OPENSSL 1 >+ >+/* Use Orc */ >+#define HAVE_ORC 1 >+ >+/* Have OSS output? */ >+#define HAVE_OSS_OUTPUT 1 >+ >+/* Have OSS wrapper (padsp)? */ >+#define HAVE_OSS_WRAPPER 1 >+ >+/* Define to 1 if you have the `paccept' function. */ >+/* #undef HAVE_PACCEPT */ >+ >+/* Define to 1 if you have the <pcreposix.h> header file. */ >+#define HAVE_PCREPOSIX_H 1 >+ >+/* Define to 1 if you have the `pipe' function. */ >+#define HAVE_PIPE 1 >+ >+/* Define to 1 if you have the `pipe2' function. */ >+#define HAVE_PIPE2 1 >+ >+/* Define to 1 if you have the <poll.h> header file. */ >+#define HAVE_POLL_H 1 >+ >+/* Define to 1 if you have the `posix_fadvise' function. */ >+#define HAVE_POSIX_FADVISE 1 >+ >+/* Define to 1 if you have the `posix_madvise' function. */ >+#define HAVE_POSIX_MADVISE 1 >+ >+/* Define to 1 if you have the `posix_memalign' function. */ >+#define HAVE_POSIX_MEMALIGN 1 >+ >+/* Define to 1 if you have the `ppoll' function. */ >+#define HAVE_PPOLL 1 >+ >+/* Define if you have POSIX threads libraries and header files. */ >+#define HAVE_PTHREAD 1 >+ >+/* Define to 1 if you have the `pthread_getname_np' function. */ >+/* #undef HAVE_PTHREAD_GETNAME_NP */ >+ >+/* Have PTHREAD_PRIO_INHERIT. */ >+#define HAVE_PTHREAD_PRIO_INHERIT 1 >+ >+/* Define to 1 if you have the `pthread_setaffinity_np' function. */ >+#define HAVE_PTHREAD_SETAFFINITY_NP 1 >+ >+/* Define to 1 if you have the `pthread_setname_np' function. */ >+/* #undef HAVE_PTHREAD_SETNAME_NP */ >+ >+/* Define to 1 if you have the <pwd.h> header file. */ >+#define HAVE_PWD_H 1 >+ >+/* Define to 1 if you have the `readlink' function. */ >+#define HAVE_READLINK 1 >+ >+/* Define to 1 if you have the `regexec' function. */ >+#define HAVE_REGEXEC 1 >+ >+/* Define to 1 if you have the <regex.h> header file. */ >+#define HAVE_REGEX_H 1 >+ >+/* Define to 1 if you have the <sched.h> header file. */ >+#define HAVE_SCHED_H 1 >+ >+/* Define to 1 if you have the `setegid' function. */ >+#define HAVE_SETEGID 1 >+ >+/* Define to 1 if you have the `seteuid' function. */ >+#define HAVE_SETEUID 1 >+ >+/* Define to 1 if you have the `setpgid' function. */ >+#define HAVE_SETPGID 1 >+ >+/* Define to 1 if you have the `setregid' function. */ >+#define HAVE_SETREGID 1 >+ >+/* Define to 1 if you have the `setresgid' function. */ >+#define HAVE_SETRESGID 1 >+ >+/* Define to 1 if you have the `setresuid' function. */ >+#define HAVE_SETRESUID 1 >+ >+/* Define to 1 if you have the `setreuid' function. */ >+#define HAVE_SETREUID 1 >+ >+/* Define to 1 if you have the `setsid' function. */ >+#define HAVE_SETSID 1 >+ >+/* Define to 1 if you have the `shm_open' function. */ >+#define HAVE_SHM_OPEN 1 >+ >+/* Define to 1 if you have the `sig2str' function. */ >+/* #undef HAVE_SIG2STR */ >+ >+/* Define to 1 if you have the `sigaction' function. */ >+#define HAVE_SIGACTION 1 >+ >+/* Have SIGXCPU? */ >+#define HAVE_SIGXCPU 1 >+ >+/* Have simple? */ >+#define HAVE_SIMPLEDB 1 >+ >+/* Define to 1 if you have the `sleep' function. */ >+#define HAVE_SLEEP 1 >+ >+/* Have Solaris audio? */ >+/* #undef HAVE_SOLARIS */ >+ >+/* Have soxr */ >+/* #undef HAVE_SOXR */ >+ >+/* Have speex */ >+#define HAVE_SPEEX 1 >+ >+/* Define to 1 if the system has the type `ssize_t'. */ >+#define HAVE_SSIZE_T 1 >+ >+/* Define to 1 if you have the <stdint.h> header file. */ >+#define HAVE_STDINT_H 1 >+ >+/* Define to 1 if you have the <stdlib.h> header file. */ >+#define HAVE_STDLIB_H 1 >+ >+/* Have _Bool. */ >+#define HAVE_STD_BOOL 1 >+ >+/* Define to 1 if you have the `strerror_r' function. */ >+#define HAVE_STRERROR_R 1 >+ >+/* Define to 1 if you have the <strings.h> header file. */ >+#define HAVE_STRINGS_H 1 >+ >+/* Define to 1 if you have the <string.h> header file. */ >+#define HAVE_STRING_H 1 >+ >+/* Define to 1 if you have the `strsignal' function. */ >+#define HAVE_STRSIGNAL 1 >+ >+/* Define to 1 if you have the `strtod_l' function. */ >+#define HAVE_STRTOD_L 1 >+ >+/* Define to 1 if you have the `strtof' function. */ >+#define HAVE_STRTOF 1 >+ >+/* Define to 1 if you have the `symlink' function. */ >+#define HAVE_SYMLINK 1 >+ >+/* Define to 1 if you have the `sysconf' function. */ >+#define HAVE_SYSCONF 1 >+ >+/* Define to 1 if you have the <syslog.h> header file. */ >+#define HAVE_SYSLOG_H 1 >+ >+/* Have SYSTEMDDAEMON? */ >+/* #undef HAVE_SYSTEMD_DAEMON */ >+ >+/* Have SYSTEMDJOURNAL? */ >+/* #undef HAVE_SYSTEMD_JOURNAL */ >+ >+/* Have SYSTEMDLOGIN? */ >+/* #undef HAVE_SYSTEMD_LOGIN */ >+ >+/* Define to 1 if you have the <sys/atomic.h> header file. */ >+/* #undef HAVE_SYS_ATOMIC_H */ >+ >+/* Define to 1 if you have the <sys/audio.h> header file. */ >+/* #undef HAVE_SYS_AUDIO_H */ >+ >+/* Define to 1 if you have the <sys/capability.h> header file. */ >+/* #undef HAVE_SYS_CAPABILITY_H */ >+ >+/* Define to 1 if you have the <sys/dl.h> header file. */ >+/* #undef HAVE_SYS_DL_H */ >+ >+/* Define to 1 if you have the <sys/eventfd.h> header file. */ >+/* #undef HAVE_SYS_EVENTFD_H */ >+ >+/* Define to 1 if you have the <sys/filio.h> header file. */ >+#define HAVE_SYS_FILIO_H 1 >+ >+/* Define to 1 if you have the <sys/ioctl.h> header file. */ >+#define HAVE_SYS_IOCTL_H 1 >+ >+/* Define to 1 if you have the <sys/mman.h> header file. */ >+#define HAVE_SYS_MMAN_H 1 >+ >+/* Define to 1 if you have the <sys/prctl.h> header file. */ >+/* #undef HAVE_SYS_PRCTL_H */ >+ >+/* Define to 1 if you have the <sys/resource.h> header file. */ >+#define HAVE_SYS_RESOURCE_H 1 >+ >+/* Define to 1 if you have the <sys/select.h> header file. */ >+#define HAVE_SYS_SELECT_H 1 >+ >+/* Define to 1 if you have the <sys/socket.h> header file. */ >+#define HAVE_SYS_SOCKET_H 1 >+ >+/* Define to 1 if you have the <sys/soundcard.h> header file. */ >+#define HAVE_SYS_SOUNDCARD_H 1 >+ >+/* Define to 1 if you have the <sys/stat.h> header file. */ >+#define HAVE_SYS_STAT_H 1 >+ >+/* Define to 1 if you have the <sys/syscall.h> header file. */ >+#define HAVE_SYS_SYSCALL_H 1 >+ >+/* Define to 1 if you have the <sys/types.h> header file. */ >+#define HAVE_SYS_TYPES_H 1 >+ >+/* Define to 1 if you have the <sys/uio.h> header file. */ >+#define HAVE_SYS_UIO_H 1 >+ >+/* Define to 1 if you have the <sys/un.h> header file. */ >+#define HAVE_SYS_UN_H 1 >+ >+/* Define to 1 if you have the <sys/wait.h> header file. */ >+#define HAVE_SYS_WAIT_H 1 >+ >+/* Have tdb? */ >+/* #undef HAVE_TDB */ >+ >+/* Have UDEV. */ >+/* #undef HAVE_UDEV */ >+ >+/* Define to 1 if you have the `uname' function. */ >+#define HAVE_UNAME 1 >+ >+/* Define to 1 if you have the <unistd.h> header file. */ >+#define HAVE_UNISTD_H 1 >+ >+/* Define to 1 if you have the <use-case.h> header file. */ >+/* #undef HAVE_USE_CASE_H */ >+ >+/* Define to 1 if you have the `usleep' function. */ >+#define HAVE_USLEEP 1 >+ >+/* Define to 1 if you have the <valgrind/memcheck.h> header file. */ >+/* #undef HAVE_VALGRIND_MEMCHECK_H */ >+ >+/* Define to 1 if you have the `vfork' function. */ >+#define HAVE_VFORK 1 >+ >+/* Define to 1 if you have the <vfork.h> header file. */ >+/* #undef HAVE_VFORK_H */ >+ >+/* Have WaveOut audio? */ >+/* #undef HAVE_WAVEOUT */ >+ >+/* Define to 1 if you have the <windows.h> header file. */ >+/* #undef HAVE_WINDOWS_H */ >+ >+/* Define to 1 if you have the <winsock2.h> header file. */ >+/* #undef HAVE_WINSOCK2_H */ >+ >+/* Define to 1 if `fork' works. */ >+#define HAVE_WORKING_FORK 1 >+ >+/* Define to 1 if `vfork' works. */ >+#define HAVE_WORKING_VFORK 1 >+ >+/* Define to 1 if you have the <ws2tcpip.h> header file. */ >+/* #undef HAVE_WS2TCPIP_H */ >+ >+/* Have X11? */ >+#define HAVE_X11 1 >+ >+/* Define to 1 if you have the <xlocale.h> header file. */ >+#define HAVE_XLOCALE_H 1 >+ >+/* Define to 1 if you have the >+ </System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h> >+ header file. */ >+/* #undef HAVE__SYSTEM_LIBRARY_FRAMEWORKS_CORESERVICES_FRAMEWORK_HEADERS_CORESERVICES_H */ >+ >+/* Define as const if the declaration of iconv() needs const. */ >+#define ICONV_CONST >+ >+/* Define INADDR_NONE if not found in <netinet/in.h> */ >+/* #undef INADDR_NONE */ >+ >+/* Define to the sub-directory in which libtool stores uninstalled libraries. >+ */ >+#define LT_OBJDIR ".libs/" >+ >+/* Build target is Darwin. */ >+/* #undef OS_IS_DARWIN */ >+ >+/* Build target is Windows. */ >+/* #undef OS_IS_WIN32 */ >+ >+/* Name of package */ >+#define PACKAGE "pulseaudio" >+ >+/* Define to the address where bug reports for this package should be sent. */ >+#define PACKAGE_BUGREPORT "pulseaudio-discuss (at) lists (dot) freedesktop (dot) org" >+ >+/* Define to the full name of this package. */ >+#define PACKAGE_NAME "pulseaudio" >+ >+/* Define to the full name and version of this package. */ >+#define PACKAGE_STRING "pulseaudio 8.0" >+ >+/* Define to the one symbol short name of this package. */ >+#define PACKAGE_TARNAME "pulseaudio" >+ >+/* Define to the home page for this package. */ >+#define PACKAGE_URL "http://pulseaudio.org/" >+ >+/* Define to the version of this package. */ >+#define PACKAGE_VERSION "8.0" >+ >+/* Location of pactl binary */ >+#define PACTL_BINARY "/usr/local/bin/pactl" >+ >+/* Access group */ >+#define PA_ACCESS_GROUP "pulse-access" >+ >+/* Location of pulseaudio binary */ >+#define PA_BINARY "/usr/local/bin/pulseaudio" >+ >+/* The CFLAGS used during compilation */ >+#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" >+ >+/* Location of configuration files */ >+#define PA_DEFAULT_CONFIG_DIR "/usr/local/etc/pulse" >+ >+/* Modules dir */ >+#define PA_DLSEARCHPATH "/usr/local/lib/pulse-8.0/modules" >+ >+/* PulseAudio include dir */ >+#define PA_INCDIR "/usr/local/include" >+ >+/* PulseAudio library dir */ >+#define PA_LIBDIR "/usr/local/lib" >+ >+/* D-Bus machine-id file */ >+#define PA_MACHINE_ID "/usr/local/etc/machine-id" >+ >+/* Fallback machine-id file */ >+#define PA_MACHINE_ID_FALLBACK "/var/lib/dbus/machine-id" >+ >+/* Shared object extension */ >+#define PA_SOEXT ".so" >+ >+/* System config dir */ >+#define PA_SYSTEM_CONFIG_PATH "/var/lib/pulse" >+ >+/* Group for the PulseAudio system daemon */ >+#define PA_SYSTEM_GROUP "pulse" >+ >+/* System runtime dir */ >+#define PA_SYSTEM_RUNTIME_PATH "/var/run/pulse" >+ >+/* System state dir */ >+#define PA_SYSTEM_STATE_PATH "/var/lib/pulse" >+ >+/* User for running the PulseAudio system daemon */ >+#define PA_SYSTEM_USER "pulse" >+ >+/* Define to necessary symbol if this constant uses a non-standard name on >+ your system. */ >+/* #undef PTHREAD_CREATE_JOINABLE */ >+ >+/* The size of `void*', as computed by sizeof. */ >+#define SIZEOF_VOIDP 8 >+ >+/* If using the C implementation of alloca, define if you know the >+ direction of stack growth for your system; otherwise it will be >+ automatically deduced at runtime. >+ STACK_DIRECTION > 0 => grows toward higher addresses >+ STACK_DIRECTION < 0 => grows toward lower addresses >+ STACK_DIRECTION = 0 => direction of growth unknown */ >+/* #undef STACK_DIRECTION */ >+ >+/* Define to 1 if you have the ANSI C header files. */ >+#define STDC_HEADERS 1 >+ >+/* Define this if the compiler supports __thread for Thread-Local Storage */ >+#define SUPPORT_TLS___THREAD 1 >+ >+/* If the compiler supports a TLS storage class define it to that here */ >+#define TLS __thread >+ >+/* Define this if you want per-user esound socket directories */ >+#define USE_PER_USER_ESOUND_SOCKET 1 >+ >+/* Enable extensions on AIX 3, Interix. */ >+#ifndef _ALL_SOURCE >+# define _ALL_SOURCE 1 >+#endif >+/* Enable GNU extensions on systems that have them. */ >+#ifndef _GNU_SOURCE >+# define _GNU_SOURCE 1 >+#endif >+/* Enable threading extensions on Solaris. */ >+#ifndef _POSIX_PTHREAD_SEMANTICS >+# define _POSIX_PTHREAD_SEMANTICS 1 >+#endif >+/* Enable extensions on HP NonStop. */ >+#ifndef _TANDEM_SOURCE >+# define _TANDEM_SOURCE 1 >+#endif >+/* Enable general extensions on Solaris. */ >+#ifndef __EXTENSIONS__ >+# define __EXTENSIONS__ 1 >+#endif >+ >+ >+/* Version number of package */ >+#define VERSION "8.0" >+ >+/* Needed to avoid including unnecessary headers on Windows */ >+/* #undef WIN32_LEAN_AND_MEAN */ >+ >+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most >+ significant byte first (like Motorola and SPARC, unlike Intel). */ >+#if defined AC_APPLE_UNIVERSAL_BUILD >+# if defined __BIG_ENDIAN__ >+# define WORDS_BIGENDIAN 1 >+# endif >+#else >+# ifndef WORDS_BIGENDIAN >+/* # undef WORDS_BIGENDIAN */ >+# endif >+#endif >+ >+/* Needed to get NSIG on Mac OS X */ >+/* #undef _DARWIN_C_SOURCE */ >+ >+/* Enable large inode numbers on Mac OS X 10.5. */ >+#ifndef _DARWIN_USE_64_BIT_INODE >+# define _DARWIN_USE_64_BIT_INODE 1 >+#endif >+ >+/* Number of bits in a file offset, on hosts where this is settable. */ >+/* #undef _FILE_OFFSET_BITS */ >+ >+/* Define for large files, on AIX-style hosts. */ >+/* #undef _LARGE_FILES */ >+ >+/* Define to 1 if on MINIX. */ >+/* #undef _MINIX */ >+ >+/* Define to 2 if the system does not provide POSIX.1 features except with >+ this defined. */ >+/* #undef _POSIX_1_SOURCE */ >+ >+/* Needed on Solaris */ >+#define _POSIX_PTHREAD_SEMANTICS 1 >+ >+/* Define to 1 if you need to in order for `stat' and other things to work. */ >+/* #undef _POSIX_SOURCE */ >+ >+/* Needed to get declarations for msg_control and msg_controllen on Solaris */ >+/* #undef _XOPEN_SOURCE */ >+ >+/* Needed to get declarations for msg_control and msg_controllen on Solaris */ >+#define __EXTENSIONS__ 1 >+ >+/* Define to empty if `const' does not conform to ANSI C. */ >+/* #undef const */ >+ >+/* Define to `int' if <sys/types.h> doesn't define. */ >+/* #undef gid_t */ >+ >+/* Define to `long int' if <sys/types.h> does not define. */ >+/* #undef off_t */ >+ >+/* Define to `int' if <sys/types.h> does not define. */ >+/* #undef pid_t */ >+ >+/* Define to `unsigned int' if <sys/types.h> does not define. */ >+/* #undef size_t */ >+ >+/* Define ssize_t if it is not done by the standard libs. */ >+/* #undef ssize_t */ >+ >+/* Define to `int' if <sys/types.h> doesn't define. */ >+/* #undef uid_t */ >+ >+/* Define as `fork' if `vfork' does not work. */ >+/* #undef vfork */ >Index: audio/pulseaudio-module-sndio/files/module-sndio-symdef.h >=================================================================== >--- audio/pulseaudio-module-sndio/files/module-sndio-symdef.h (nonexistent) >+++ audio/pulseaudio-module-sndio/files/module-sndio-symdef.h (working copy) >@@ -0,0 +1,31 @@ >+/* $OpenBSD: module-sndio-symdef.h,v 1.2 2014/03/20 17:33:09 ajacoutot Exp $ */ >+ >+#ifndef foomodulesndiosymdeffoo >+#define foomodulesndiosymdeffoo >+ >+#include <pulsecore/core.h> >+#include <pulsecore/module.h> >+#include <pulsecore/macro.h> >+ >+#define pa__init module_sndio_LTX_pa__init >+#define pa__done module_sndio_LTX_pa__done >+#define pa__get_author module_sndio_LTX_pa__get_author >+#define pa__get_description module_sndio_LTX_pa__get_description >+#define pa__get_usage module_sndio_LTX_pa__get_usage >+#define pa__get_version module_sndio_LTX_pa__get_version >+#define pa__get_deprecated module_sndio_LTX_pa__get_deprecated >+#define pa__load_once module_sndio_LTX_pa__load_once >+#define pa__get_n_used module_sndio_LTX_pa__get_n_used >+ >+int pa__init(pa_module*m); >+void pa__done(pa_module*m); >+int pa__get_n_used(pa_module*m); >+ >+const char* pa__get_author(void); >+const char* pa__get_description(void); >+const char* pa__get_usage(void); >+const char* pa__get_version(void); >+const char* pa__get_deprecated(void); >+bool pa__load_once(void); >+ >+#endif >Index: audio/pulseaudio-module-sndio/files/module-sndio-sysex.h >=================================================================== >--- audio/pulseaudio-module-sndio/files/module-sndio-sysex.h (nonexistent) >+++ audio/pulseaudio-module-sndio/files/module-sndio-sysex.h (working copy) >@@ -0,0 +1,120 @@ >+/* $OpenBSD: module-sndio-sysex.h,v 1.1 2012/10/08 17:19:57 eric Exp $ */ >+/* >+ * Copyright (c) 2011 Alexandre Ratchov <alex@caoua.org> >+ * >+ * Permission to use, copy, modify, and distribute this software for any >+ * purpose with or without fee is hereby granted, provided that the above >+ * copyright notice and this permission notice appear in all copies. >+ * >+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES >+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF >+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR >+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES >+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN >+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF >+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. >+ */ >+#ifndef AUCAT_SYSEX_H >+#define AUCAT_SYSEX_H >+ >+#include <stdint.h> >+ >+/* >+ * start and end markers >+ */ >+#define SYSEX_START 0xf0 >+#define SYSEX_END 0xf7 >+ >+/* >+ * type/vendor namespace IDs we use >+ */ >+#define SYSEX_TYPE_RT 0x7f /* real-time universal */ >+#define SYSEX_TYPE_EDU 0x7d /* non-comercial */ >+ >+/* >+ * realtime messages in the "universal real-time" namespace >+ */ >+#define SYSEX_MTC 0x01 /* mtc messages */ >+#define SYSEX_MTC_FULL 0x01 /* mtc full frame message */ >+#define SYSEX_CONTROL 0x04 >+#define SYSEX_MASTER 0x01 >+#define SYSEX_MMC 0x06 >+#define SYSEX_MMC_STOP 0x01 >+#define SYSEX_MMC_START 0x02 >+#define SYSEX_MMC_LOC 0x44 >+#define SYSEX_MMC_LOC_LEN 0x06 >+#define SYSEX_MMC_LOC_CMD 0x01 >+ >+/* >+ * aucat-specific messages, in the "edu" namespace >+ */ >+#define SYSEX_AUCAT 0x23 /* aucat-specific */ >+#define SYSEX_AUCAT_MIXINFO 0x01 /* mixer info */ >+#define SYSEX_AUCAT_DUMPREQ 0x02 /* dump request */ >+#define SYSEX_AUCAT_DUMPEND 0x03 /* end of dump */ >+ >+/* >+ * minimum size of sysex message we accept >+ */ >+#define SYSEX_SIZE(m) (5 + sizeof(struct sysex_ ## m)) >+ >+/* >+ * all possible system exclusive messages we support. For aucat-specific >+ * messages we use the same header as real-time messages to simplify the >+ * message parser >+ */ >+struct sysex { >+ uint8_t start; >+ uint8_t type; /* type or vendor id */ >+ uint8_t dev; /* device or product id */ >+ uint8_t id0; /* message id */ >+ uint8_t id1; /* sub-id */ >+ union sysex_all { >+ struct sysex_empty { >+ uint8_t end; >+ } empty; >+ struct sysex_master { >+ uint8_t fine; >+ uint8_t coarse; >+ uint8_t end; >+ } master; >+ struct sysex_start { >+ uint8_t end; >+ } start; >+ struct sysex_stop { >+ uint8_t end; >+ } stop; >+ struct sysex_loc { >+ uint8_t len; >+ uint8_t cmd; >+ uint8_t hr; >+ uint8_t min; >+ uint8_t sec; >+ uint8_t fr; >+ uint8_t cent; >+ uint8_t end; >+ } loc; >+ struct sysex_full { >+ uint8_t hr; >+ uint8_t min; >+ uint8_t sec; >+ uint8_t fr; >+ uint8_t end; >+ } full; >+ struct sysex_mixinfo { >+ uint8_t chan; /* channel */ >+ uint8_t vol; /* current volume */ >+#define SYSEX_NAMELEN 10 /* \0 included */ >+ uint8_t name[SYSEX_NAMELEN]; /* stream name */ >+ uint8_t end; >+ } mixinfo; >+ struct sysex_dumpreq { >+ uint8_t end; >+ } dumpreq; >+ struct sysex_dumpend { >+ uint8_t end; >+ } dumpend; >+ } u; >+}; >+ >+#endif /* !defined(AUCAT_SYSEX_H) */ >Index: audio/pulseaudio-module-sndio/files/module-sndio.c >=================================================================== >--- audio/pulseaudio-module-sndio/files/module-sndio.c (nonexistent) >+++ audio/pulseaudio-module-sndio/files/module-sndio.c (working copy) >@@ -0,0 +1,672 @@ >+/* $OpenBSD: module-sndio.c,v 1.9 2016/02/06 07:48:37 ajacoutot Exp $ */ >+/* >+ * Copyright (c) 2012 Eric Faurot <eric@openbsd.org> >+ * >+ * Permission to use, copy, modify, and distribute this software for any >+ * purpose with or without fee is hereby granted, provided that the above >+ * copyright notice and this permission notice appear in all copies. >+ * >+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES >+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF >+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR >+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES >+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN >+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF >+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. >+ */ >+ >+#include <stdlib.h> >+#include <sndio.h> >+ >+#include "config.h" >+ >+#include <pulse/util.h> >+ >+#include <pulsecore/core-error.h> >+#include <pulsecore/thread.h> >+#include <pulsecore/sink.h> >+#include <pulsecore/source.h> >+#include <pulsecore/module.h> >+#include <pulsecore/sample-util.h> >+#include <pulsecore/core-util.h> >+#include <pulsecore/modargs.h> >+#include <pulsecore/log.h> >+#include <pulsecore/macro.h> >+#include <pulsecore/thread-mq.h> >+#include <pulsecore/rtpoll.h> >+#include <pulsecore/poll.h> >+ >+#include "module-sndio-symdef.h" >+#include "module-sndio-sysex.h" >+ >+/* >+ * TODO >+ * >+ * - handle latency correctly >+ * - make recording work correctly with playback >+ */ >+ >+PA_MODULE_AUTHOR("Eric Faurot"); >+PA_MODULE_DESCRIPTION("OpenBSD sndio sink/source"); >+PA_MODULE_VERSION("0.0"); >+PA_MODULE_LOAD_ONCE(false); >+PA_MODULE_USAGE( >+ "sink_name=<name for the sink> " >+ "sink_properties=<properties for the sink> " >+ "source_name=<name for the source> " >+ "source_properties=<properties for the source> " >+ "device=<sndio device> " >+ "record=<enable source?> " >+ "playback=<enable sink?> " >+ "format=<sample format> " >+ "rate=<sample rate> " >+ "channels=<number of channels> " >+ "channel_map=<channel map> "); >+ >+static const char* const modargs[] = { >+ "sink_name", >+ "sink_properties", >+ "source_name", >+ "source_properties", >+ "device", >+ "record", >+ "playback", >+ "format", >+ "rate", >+ "channels", >+ "channel_map", >+ NULL >+}; >+ >+struct userdata { >+ pa_core *core; >+ pa_module *module; >+ pa_sink *sink; >+ pa_source *source; >+ >+ pa_thread *thread; >+ pa_thread_mq thread_mq; >+ pa_rtpoll *rtpoll; >+ pa_rtpoll_item *rtpoll_item; >+ >+ pa_memchunk memchunk; >+ >+ struct sio_hdl *hdl; >+ struct sio_par par; >+ size_t bufsz; >+ >+ int sink_running; >+ unsigned int volume; >+ >+ int set_master; /* master we're writing */ >+ int last_master; /* last master we wrote */ >+ int feedback_master; /* actual master */ >+ int mst; >+ int midx; >+ int mlen; >+ int mready; >+#define MSGMAX 0x100 >+ uint8_t mmsg[MSGMAX]; >+}; >+ >+static void >+sndio_on_volume(void *arg, unsigned int vol) >+{ >+ struct userdata *u = arg; >+ >+ u->volume = vol; >+} >+ >+static void >+sndio_get_volume(pa_sink *s) >+{ >+ struct userdata *u = s->userdata; >+ int i; >+ uint32_t v; >+ >+ if (u->feedback_master >= SIO_MAXVOL) >+ v = PA_VOLUME_NORM; >+ else >+ v = PA_CLAMP_VOLUME((u->volume * PA_VOLUME_NORM) / SIO_MAXVOL); >+ >+ for (i = 0; i < s->real_volume.channels; i++) >+ s->real_volume.values[i] = v; >+} >+ >+static void >+sndio_set_volume(pa_sink *s) >+{ >+ struct userdata *u = s->userdata; >+ >+ if (s->real_volume.values[0] >= PA_VOLUME_NORM) >+ u->set_master = SIO_MAXVOL; >+ else >+ u->set_master = (s->real_volume.values[0] * SIO_MAXVOL) / PA_VOLUME_NORM; >+} >+ >+static int >+sndio_sink_message(pa_msgobject *o, int code, void *data, int64_t offset, >+ pa_memchunk *chunk) >+{ >+ struct userdata *u = PA_SINK(o)->userdata; >+ pa_sink_state_t state; >+ int ret; >+ >+ pa_log_debug( >+ "sndio_sink_msg: obj=%p code=%i data=%p offset=%lli chunk=%p", >+ o, code, data, offset, chunk); >+ switch (code) { >+ case PA_SINK_MESSAGE_GET_LATENCY: >+ pa_log_debug("sink:PA_SINK_MESSAGE_GET_LATENCY"); >+ *(pa_usec_t*)data = pa_bytes_to_usec(u->par.bufsz, >+ &u->sink->sample_spec); >+ return (0); >+ case PA_SINK_MESSAGE_SET_STATE: >+ pa_log_debug("sink:PA_SINK_MESSAGE_SET_STATE "); >+ state = (pa_sink_state_t)(data); >+ switch (state) { >+ case PA_SINK_SUSPENDED: >+ pa_log_debug("SUSPEND"); >+ if (u->sink_running == 1) >+ sio_stop(u->hdl); >+ u->sink_running = 0; >+ break; >+ case PA_SINK_IDLE: >+ case PA_SINK_RUNNING: >+ pa_log_debug((code == PA_SINK_IDLE) ? "IDLE":"RUNNING"); >+ if (u->sink_running == 0) >+ sio_start(u->hdl); >+ u->sink_running = 1; >+ break; >+ case PA_SINK_INVALID_STATE: >+ pa_log_debug("INVALID_STATE"); >+ break; >+ case PA_SINK_UNLINKED: >+ pa_log_debug("UNLINKED"); >+ break; >+ case PA_SINK_INIT: >+ pa_log_debug("INIT"); >+ break; >+ } >+ break; >+ default: >+ pa_log_debug("sink:PA_SINK_???"); >+ } >+ >+ ret = pa_sink_process_msg(o, code, data, offset, chunk); >+ >+ return (ret); >+} >+ >+static int >+sndio_source_message(pa_msgobject *o, int code, void *data, int64_t offset, >+ pa_memchunk *chunk) >+{ >+ struct userdata *u = PA_SOURCE(o)->userdata; >+ pa_source_state_t state; >+ int ret; >+ >+ pa_log_debug( >+ "sndio_source_msg: obj=%p code=%i data=%p offset=%lli chunk=%p", >+ o, code, data, offset, chunk); >+ switch (code) { >+ case PA_SOURCE_MESSAGE_GET_LATENCY: >+ pa_log_debug("source:PA_SOURCE_MESSAGE_GET_LATENCY"); >+ *(pa_usec_t*)data = pa_bytes_to_usec(u->bufsz, >+ &u->source->sample_spec); >+ return (0); >+ case PA_SOURCE_MESSAGE_SET_STATE: >+ pa_log_debug("source:PA_SOURCE_MESSAGE_SET_STATE "); >+ state = (pa_source_state_t)(data); >+ switch (state) { >+ case PA_SOURCE_SUSPENDED: >+ pa_log_debug("SUSPEND"); >+ sio_stop(u->hdl); >+ break; >+ case PA_SOURCE_IDLE: >+ case PA_SOURCE_RUNNING: >+ pa_log_debug((code == PA_SOURCE_IDLE)?"IDLE":"RUNNING"); >+ sio_start(u->hdl); >+ break; >+ case PA_SOURCE_INVALID_STATE: >+ pa_log_debug("INVALID_STATE"); >+ break; >+ case PA_SOURCE_UNLINKED: >+ pa_log_debug("UNLINKED"); >+ break; >+ case PA_SOURCE_INIT: >+ pa_log_debug("INIT"); >+ break; >+ } >+ break; >+ default: >+ pa_log_debug("source:PA_SOURCE_???"); >+ } >+ >+ ret = pa_source_process_msg(o, code, data, offset, chunk); >+ >+ return (ret); >+} >+ >+static void >+sndio_thread(void *arg) >+{ >+ struct userdata *u = arg; >+ int ret; >+ short revents, events; >+ struct pollfd *fds_sio; >+ size_t w, r, l; >+ char *p; >+ struct pa_memchunk memchunk; >+ >+ pa_log_debug("sndio thread starting up"); >+ >+ pa_thread_mq_install(&u->thread_mq); >+ >+ fds_sio = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL); >+ >+ revents = 0; >+ for (;;) { >+ pa_log_debug("sndio_thread: loop"); >+ >+ /* ??? oss does that. */ >+ if (u->sink >+ && PA_SINK_IS_OPENED(u->sink->thread_info.state) >+ && u->sink->thread_info.rewind_requested) >+ pa_sink_process_rewind(u->sink, 0); >+ >+ if (u->sink && >+ PA_SINK_IS_OPENED(u->sink->thread_info.state) >+ && (revents & POLLOUT)) { >+ if (u->memchunk.length <= 0) >+ pa_sink_render(u->sink, u->bufsz, &u->memchunk); >+ p = pa_memblock_acquire(u->memchunk.memblock); >+ w = sio_write(u->hdl, p + u->memchunk.index, >+ u->memchunk.length); >+ pa_memblock_release(u->memchunk.memblock); >+ pa_log_debug("wrote %zu bytes of %zu", w, >+ u->memchunk.length); >+ u->memchunk.index += w; >+ u->memchunk.length -= w; >+ if (u->memchunk.length <= 0) { >+ pa_memblock_unref(u->memchunk.memblock); >+ pa_memchunk_reset(&u->memchunk); >+ } >+ } >+ >+ if (u->source && >+ PA_SOURCE_IS_OPENED(u->source->thread_info.state) >+ && (revents & POLLIN)) { >+ memchunk.memblock = pa_memblock_new(u->core->mempool, >+ (size_t) -1); >+ l = pa_memblock_get_length(memchunk.memblock); >+ if (l > u->bufsz) >+ l = u->bufsz; >+ p = pa_memblock_acquire(memchunk.memblock); >+ r = sio_read(u->hdl, p, l); >+ pa_memblock_release(memchunk.memblock); >+ pa_log_debug("read %zu bytes of %zu", r, l); >+ memchunk.index = 0; >+ memchunk.length = r; >+ pa_source_post(u->source, &memchunk); >+ pa_memblock_unref(memchunk.memblock); >+ } >+ >+ events = 0; >+ if (u->source && >+ PA_SOURCE_IS_OPENED(u->source->thread_info.state)) >+ events |= POLLIN; >+ if (u->sink && >+ PA_SINK_IS_OPENED(u->sink->thread_info.state)) >+ events |= POLLOUT; >+ >+ /* >+ * XXX: {sio,mio}_pollfd() return the number >+ * of descriptors to poll(). It's not correct >+ * to assume only 1 descriptor is used >+ */ >+ >+ sio_pollfd(u->hdl, fds_sio, events); >+ >+ if ((ret = pa_rtpoll_run(u->rtpoll)) < 0) >+ goto fail; >+ if (ret == 0) >+ goto finish; >+ >+ revents = sio_revents(u->hdl, fds_sio); >+ >+ pa_log_debug("sndio_thread: loop ret=%i, revents=%x", ret, >+ (int)revents); >+ >+ if (revents & POLLHUP) { >+ pa_log("POLLHUP!"); >+ break; >+ } >+ } >+ >+ fail: >+ pa_asyncmsgq_post(u->thread_mq.outq, PA_MSGOBJECT(u->core), >+ PA_CORE_MESSAGE_UNLOAD_MODULE, u->module, 0, NULL, NULL); >+ pa_asyncmsgq_wait_for(u->thread_mq.inq, PA_MESSAGE_SHUTDOWN); >+ finish: >+ pa_log_debug("sndio thread shutting down"); >+} >+ >+int >+pa__init(pa_module *m) >+{ >+ bool record = false, playback = true; >+ pa_modargs *ma = NULL; >+ pa_sample_spec ss; >+ pa_channel_map map; >+ pa_sink_new_data sink; >+ pa_source_new_data source; >+ >+ struct sio_par par; >+ unsigned int mode = 0; >+ char buf[256]; >+ const char *name, *dev; >+ struct userdata *u = NULL; >+ int nfds; >+ struct pollfd; >+ >+ if ((u = calloc(1, sizeof(struct userdata))) == NULL) { >+ pa_log("Failed to allocate userdata"); >+ goto fail; >+ } >+ m->userdata = u; >+ u->core = m->core; >+ u->module = m; >+ u->rtpoll = pa_rtpoll_new(); >+ pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll); >+ >+ if (!(ma = pa_modargs_new(m->argument, modargs))) { >+ pa_log("Failed to parse module arguments."); >+ goto fail; >+ } >+ >+ if (pa_modargs_get_value_boolean(ma, "record", &record) < 0 || >+ pa_modargs_get_value_boolean(ma, "playback", &playback) < 0) { >+ pa_log("record= and playback= expect boolean argument"); >+ goto fail; >+ } >+ >+ if (playback) >+ mode |= SIO_PLAY; >+ if (record) >+ mode |= SIO_REC; >+ >+ if (!mode) { >+ pa_log("Neither playback nor record enabled for device"); >+ goto fail; >+ } >+ >+ dev = pa_modargs_get_value(ma, "device", NULL); >+ if ((u->hdl = sio_open(dev, mode, 1)) == NULL) { >+ pa_log("Cannot open sndio device."); >+ goto fail; >+ } >+ >+ ss = m->core->default_sample_spec; >+ map = m->core->default_channel_map; >+ >+ if (pa_modargs_get_sample_spec_and_channel_map(ma, &ss, &map, >+ PA_CHANNEL_MAP_OSS) < 0) { >+ pa_log("Failed to parse sample specification or channel map"); >+ goto fail; >+ } >+ >+ sio_initpar(&par); >+ par.rate = ss.rate; >+ par.pchan = (mode & SIO_PLAY) ? ss.channels : 0; >+ par.rchan = (mode & SIO_REC) ? ss.channels : 0; >+ par.sig = 1; >+ >+ switch (ss.format) { >+ case PA_SAMPLE_U8: >+ par.bits = 8; >+ par.bps = 1; >+ par.sig = 0; >+ break; >+ case PA_SAMPLE_S16LE: >+ case PA_SAMPLE_S16BE: >+ par.bits = 16; >+ par.bps = 2; >+ par.le = (ss.format == PA_SAMPLE_S16LE) ? 1 : 0; >+ break; >+ case PA_SAMPLE_S32LE: >+ case PA_SAMPLE_S32BE: >+ par.bits = 32; >+ par.bps = 4; >+ par.le = (ss.format == PA_SAMPLE_S32LE) ? 1 : 0; >+ break; >+ case PA_SAMPLE_S24LE: >+ case PA_SAMPLE_S24BE: >+ par.bits = 24; >+ par.bps = 3; >+ par.le = (ss.format == PA_SAMPLE_S24LE) ? 1 : 0; >+ break; >+ case PA_SAMPLE_S24_32LE: >+ case PA_SAMPLE_S24_32BE: >+ par.bits = 24; >+ par.bps = 4; >+ par.le = (ss.format == PA_SAMPLE_S24_32LE) ? 1 : 0; >+ par.msb = 0; /* XXX check this */ >+ break; >+ case PA_SAMPLE_ALAW: >+ case PA_SAMPLE_ULAW: >+ case PA_SAMPLE_FLOAT32LE: >+ case PA_SAMPLE_FLOAT32BE: >+ default: >+ pa_log("Unsupported sample format"); >+ goto fail; >+ } >+ >+ /* XXX what to do with channel map? */ >+ >+ if (sio_setpar(u->hdl, &par) == -1) { >+ pa_log("Could not set requested parameters"); >+ goto fail; >+ } >+ if (sio_getpar(u->hdl, &u->par) == -1) { >+ pa_log("Could not retreive parameters"); >+ goto fail; >+ } >+ if (u->par.rate != par.rate) >+ pa_log_warn("rate changed: %u -> %u", par.rate, u->par.rate); >+ if (u->par.pchan != par.pchan) >+ pa_log_warn("playback channels changed: %u -> %u", >+ par.rchan, u->par.rchan); >+ if (u->par.rchan != par.rchan) >+ pa_log_warn("record channels changed: %u -> %u", >+ par.rchan, u->par.rchan); >+ /* XXX check sample format */ >+ >+ ss.rate = u->par.rate; >+ ss.channels = (mode & SIO_PLAY) ? u->par.pchan : u->par.rchan; >+ /* XXX what to do with map? */ >+ >+ u->bufsz = u->par.bufsz * u->par.bps * u->par.pchan; >+ >+ nfds = sio_nfds(u->hdl); >+ u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, nfds); >+ if (u->rtpoll_item == NULL) { >+ pa_log("could not allocate poll item"); >+ goto fail; >+ } >+ >+ if (mode & SIO_PLAY) { >+ >+ pa_sink_new_data_init(&sink); >+ sink.driver = __FILE__; >+ sink.module = m; >+ sink.namereg_fail = true; >+ name = pa_modargs_get_value(ma, "sink_name", NULL); >+ if (name == NULL) { >+ sink.namereg_fail = false; >+ snprintf(buf, sizeof (buf), "sndio-sink"); >+ name = buf; >+ } >+ pa_sink_new_data_set_name(&sink, name); >+ pa_sink_new_data_set_sample_spec(&sink, &ss); >+ pa_sink_new_data_set_channel_map(&sink, &map); >+ pa_proplist_sets(sink.proplist, >+ PA_PROP_DEVICE_STRING, dev ? dev : "default"); >+ pa_proplist_sets(sink.proplist, >+ PA_PROP_DEVICE_API, "sndio"); >+ pa_proplist_sets(sink.proplist, >+ PA_PROP_DEVICE_DESCRIPTION, dev ? dev : "default"); >+ pa_proplist_sets(sink.proplist, >+ PA_PROP_DEVICE_ACCESS_MODE, "serial"); >+/* >+ pa_proplist_setf(sink.proplist, >+ PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%u", >+ u->par.bufsz * u->par.bps * u->par.pchan); >+*/ >+ >+/* >+ pa_proplist_setf(sink.proplist, >+ PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE, "%lu", >+ (unsigned long) (u->out_fragment_size)); >+*/ >+ if (pa_modargs_get_proplist(ma, "sink_properties", >+ sink.proplist, PA_UPDATE_REPLACE) < 0) { >+ pa_log("Invalid sink properties"); >+ pa_sink_new_data_done(&sink); >+ goto fail; >+ } >+ >+ u->sink = pa_sink_new(m->core, &sink, PA_SINK_LATENCY); >+ pa_sink_new_data_done(&sink); >+ if (u->sink == NULL) { >+ pa_log("Failed to create sync"); >+ goto fail; >+ } >+ >+ u->sink->userdata = u; >+ u->sink->parent.process_msg = sndio_sink_message; >+ pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq); >+ pa_sink_set_rtpoll(u->sink, u->rtpoll); >+ pa_sink_set_fixed_latency(u->sink, >+ pa_bytes_to_usec(u->bufsz, &u->sink->sample_spec)); >+ >+ sio_onvol(u->hdl, sndio_on_volume, u); >+ pa_sink_set_get_volume_callback(u->sink, sndio_get_volume); >+ pa_sink_set_set_volume_callback(u->sink, sndio_set_volume); >+ u->sink->n_volume_steps = SIO_MAXVOL + 1; >+ } >+ >+ if (mode & SIO_REC) { >+ pa_source_new_data_init(&source); >+ source.driver = __FILE__; >+ source.module = m; >+ source.namereg_fail = true; >+ name = pa_modargs_get_value(ma, "source_name", NULL); >+ if (name == NULL) { >+ source.namereg_fail = false; >+ snprintf(buf, sizeof (buf), "sndio-source"); >+ name = buf; >+ } >+ pa_source_new_data_set_name(&source, name); >+ pa_source_new_data_set_sample_spec(&source, &ss); >+ pa_source_new_data_set_channel_map(&source, &map); >+ pa_proplist_sets(source.proplist, >+ PA_PROP_DEVICE_STRING, dev ? dev : "default"); >+ pa_proplist_sets(source.proplist, >+ PA_PROP_DEVICE_API, "sndio"); >+ pa_proplist_sets(source.proplist, >+ PA_PROP_DEVICE_DESCRIPTION, dev ? dev : "default"); >+ pa_proplist_sets(source.proplist, >+ PA_PROP_DEVICE_ACCESS_MODE, "serial"); >+ pa_proplist_setf(source.proplist, >+ PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%u", >+ u->par.bufsz * u->par.bps * u->par.rchan); >+/* >+ pa_proplist_setf(source.proplist, >+ PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE, "%lu", >+ (unsigned long) (u->in_fragment_size)); >+*/ >+ if (pa_modargs_get_proplist(ma, "source_properties", >+ source.proplist, PA_UPDATE_REPLACE) < 0) { >+ pa_log("Invalid source properties"); >+ pa_source_new_data_done(&source); >+ goto fail; >+ } >+ >+ u->source = pa_source_new(m->core, &source, PA_SOURCE_LATENCY); >+ pa_source_new_data_done(&source); >+ if (u->source == NULL) { >+ pa_log("Failed to create source"); >+ goto fail; >+ } >+ >+ u->source->userdata = u; >+ u->source->parent.process_msg = sndio_source_message; >+ pa_source_set_asyncmsgq(u->source, u->thread_mq.inq); >+ pa_source_set_rtpoll(u->source, u->rtpoll); >+/* >+ pa_source_set_fixed_latency(u->source, >+ pa_bytes_to_usec(u->in_hwbuf_size, &u->source->sample_spec)); >+*/ >+ } >+ >+ pa_log_debug("buffer: frame=%u bytes=%zu msec=%u", u->par.bufsz, >+ u->bufsz, (unsigned int) pa_bytes_to_usec(u->bufsz, &u->sink->sample_spec)); >+ >+ pa_memchunk_reset(&u->memchunk); >+ >+ if ((u->thread = pa_thread_new("sndio", sndio_thread, u)) == NULL) { >+ pa_log("Failed to create sndio thread."); >+ goto fail; >+ } >+ >+ if (u->sink) >+ pa_sink_put(u->sink); >+ if (u->source) >+ pa_source_put(u->source); >+ >+ pa_modargs_free(ma); >+ >+ return (0); >+fail: >+ if (u) >+ pa__done(m); >+ if (ma) >+ pa_modargs_free(ma); >+ >+ return (-1); >+} >+ >+void >+pa__done(pa_module *m) >+{ >+ struct userdata *u; >+ >+ if (!(u = m->userdata)) >+ return; >+ >+ if (u->sink) >+ pa_sink_unlink(u->sink); >+ if (u->source) >+ pa_source_unlink(u->source); >+ if (u->thread) { >+ pa_asyncmsgq_send(u->thread_mq.inq, NULL, PA_MESSAGE_SHUTDOWN, >+ NULL, 0, NULL); >+ pa_thread_free(u->thread); >+ } >+ pa_thread_mq_done(&u->thread_mq); >+ >+ if (u->sink) >+ pa_sink_unref(u->sink); >+ if (u->source) >+ pa_source_unref(u->source); >+ if (u->memchunk.memblock) >+ pa_memblock_unref(u->memchunk.memblock); >+ if (u->rtpoll_item) >+ pa_rtpoll_item_free(u->rtpoll_item); >+ if (u->rtpoll) >+ pa_rtpoll_free(u->rtpoll); >+ if (u->hdl) >+ sio_close(u->hdl); >+ free(u); >+} >Index: audio/pulseaudio-module-sndio/pkg-descr >=================================================================== >--- audio/pulseaudio-module-sndio/pkg-descr (nonexistent) >+++ audio/pulseaudio-module-sndio/pkg-descr (working copy) >@@ -0,0 +1,3 @@ >+A module for PulseAudio to support playing to sndio servers. >+ >+WWW: http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/audio/pulseaudio/files/ >Index: audio/pulseaudio-module-sndio/pkg-message >=================================================================== >--- audio/pulseaudio-module-sndio/pkg-message (nonexistent) >+++ audio/pulseaudio-module-sndio/pkg-message (working copy) >@@ -0,0 +1,8 @@ >+To use it load the module with >+ >+ pacmd load-module module-sndio device=snd@<hostname>/0 >+ >+then set the default sink or use audio/pavucontrol to set a new sink >+for a specific stream >+ >+ pacmd set-default-sink sndio-sink >Index: audio/sndio/Makefile >=================================================================== >--- audio/sndio/Makefile (nonexistent) >+++ audio/sndio/Makefile (working copy) >@@ -0,0 +1,30 @@ >+# Created by: Tobias Kortkamp <t@tobik.me> >+# $FreeBSD$ >+ >+PORTNAME= sndio >+PORTVERSION= 1.1.0 >+CATEGORIES= audio >+MASTER_SITES= http://www.sndio.org/ >+ >+MAINTAINER= t@tobik.me >+COMMENT= Small audio and MIDI framework from the OpenBSD project >+ >+LICENSE= ISCL >+ >+HAS_CONFIGURE= yes >+CONFIGURE_ARGS= --prefix=${PREFIX} --mandir=${PREFIX}/man >+ >+USE_LDCONFIG= yes >+ >+# Parallel build leads to problems, but sndio is very quick to compile >+# as is so not worth fixing >+MAKE_JOBS_UNSAFE= yes >+ >+post-install: >+ @${STRIP_CMD} \ >+ ${STAGEDIR}${PREFIX}/lib/libsndio.so.6.1 \ >+ ${STAGEDIR}${PREFIX}/bin/sndiod \ >+ ${STAGEDIR}${PREFIX}/bin/aucat \ >+ ${STAGEDIR}${PREFIX}/bin/midicat >+ >+.include <bsd.port.mk> >Index: audio/sndio/distinfo >=================================================================== >--- audio/sndio/distinfo (nonexistent) >+++ audio/sndio/distinfo (working copy) >@@ -0,0 +1,3 @@ >+TIMESTAMP = 1465315037 >+SHA256 (sndio-1.1.0.tar.gz) = fcd7f845ff70f38c2898d737450b8aa3e1bb0afb9d147e8429ef22c0b2c2db57 >+SIZE (sndio-1.1.0.tar.gz) = 121018 >Index: audio/sndio/files/patch-configure >=================================================================== >--- audio/sndio/files/patch-configure (nonexistent) >+++ audio/sndio/files/patch-configure (working copy) >@@ -0,0 +1,15 @@ >+--- configure.orig 2015-12-15 05:28:04 UTC >++++ configure >+@@ -71,6 +71,12 @@ case `uname` in >+ defs='-DHAVE_ARC4RANDOM -DHAVE_ISSETUGID \\\ >+ -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRTONUM' >+ ;; >++ FreeBSD) >++ user=_sndio >++ so="$so libsndio.so" >++ defs='-DHAVE_ARC4RANDOM -DHAVE_ISSETUGID \\\ >++ -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRTONUM' >++ ;; >+ esac >+ >+ # shell word separator (none) >Index: audio/sndio/pkg-descr >=================================================================== >--- audio/sndio/pkg-descr (nonexistent) >+++ audio/sndio/pkg-descr (working copy) >@@ -0,0 +1,11 @@ >+Sndio is a small audio and MIDI framework part of the OpenBSD >+project. >+ >+It provides an lightweight audio & MIDI server and a fully documented >+user-space API to access either the server or directly the hardware in >+a uniform way. Sndio is designed to work for desktop applications, >+but pays special attention to synchronization mechanisms and >+reliability required by music applications. Reliability through >+simplicity are part of the project goals. >+ >+WWW: http://www.sndio.org/ >Index: audio/sndio/pkg-message >=================================================================== >--- audio/sndio/pkg-message (nonexistent) >+++ audio/sndio/pkg-message (working copy) >@@ -0,0 +1,7 @@ >+sndio has no hardware support on FreeBSD currently, so this port is >+only useful if you have a sndio server running on a Linux or OpenBSD >+host. >+ >+Since there is no direct sndio support in FreeBSD ports (yet), it is >+recommended to use PulseAudio via audio/pulseaudio-module-sndio to >+access your sndio server. >Index: audio/sndio/pkg-plist >=================================================================== >--- audio/sndio/pkg-plist (nonexistent) >+++ audio/sndio/pkg-plist (working copy) >@@ -0,0 +1,35 @@ >+bin/aucat >+bin/midicat >+bin/sndiod >+include/sndio.h >+lib/libsndio.so >+lib/libsndio.so.6.1 >+man/man1/aucat.1.gz >+man/man1/midicat.1.gz >+man/man3/mio_close.3.gz >+man/man3/mio_eof.3.gz >+man/man3/mio_nfds.3.gz >+man/man3/mio_open.3.gz >+man/man3/mio_pollfd.3.gz >+man/man3/mio_read.3.gz >+man/man3/mio_revents.3.gz >+man/man3/mio_write.3.gz >+man/man3/sio_close.3.gz >+man/man3/sio_eof.3.gz >+man/man3/sio_getcap.3.gz >+man/man3/sio_getpar.3.gz >+man/man3/sio_initpar.3.gz >+man/man3/sio_nfds.3.gz >+man/man3/sio_onmove.3.gz >+man/man3/sio_onvol.3.gz >+man/man3/sio_open.3.gz >+man/man3/sio_pollfd.3.gz >+man/man3/sio_read.3.gz >+man/man3/sio_revents.3.gz >+man/man3/sio_setpar.3.gz >+man/man3/sio_setvol.3.gz >+man/man3/sio_start.3.gz >+man/man3/sio_stop.3.gz >+man/man3/sio_write.3.gz >+man/man7/sndio.7.gz >+man/man8/sndiod.8.gz
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
tobik
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 210124
:
171185
|
171186
|
171187
|
172828
|
173095