-SUBDIRS = src # doc
+SUBDIRS = murphy # doc
MAINTAINERCLEANFILES = \
Makefile.in src/Makefile.in config.h.in configure \
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for pulseaudio-genivi-mir .
+# Generated by GNU Autoconf 2.68 for pulseaudio-murphy-ivi .
#
-# Report bugs to <janos.f.kovacs@nokia.com>.
+# Report bugs to <janos.kovacs@intel.com>.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: janos.f.kovacs@nokia.com about your system, including
-$0: any error possibly output before this message. Then
-$0: install a modern shell, or manually run the script
-$0: under such a shell if you do have one."
+$0: janos.kovacs@intel.com about your system, including any
+$0: error possibly output before this message. Then install
+$0: a modern shell, or manually run the script under such a
+$0: shell if you do have one."
fi
exit 1
fi
MAKEFLAGS=
# Identity of this package.
-PACKAGE_NAME='pulseaudio-genivi-mir'
-PACKAGE_TARNAME='pulseaudio-genivi-mir'
+PACKAGE_NAME='pulseaudio-murphy-ivi'
+PACKAGE_TARNAME='pulseaudio-murphy-ivi'
PACKAGE_VERSION=''
-PACKAGE_STRING='pulseaudio-genivi-mir '
-PACKAGE_BUGREPORT='janos.f.kovacs@nokia.com'
+PACKAGE_STRING='pulseaudio-murphy-ivi '
+PACKAGE_BUGREPORT='janos.kovacs@intel.com'
PACKAGE_URL=''
-ac_unique_file="src/module-genivi-mir.c"
+ac_unique_file="murphy/module-murphy-ivi.c"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
LTLIBOBJS
LIBOBJS
modlibexecdir
-PULSEAUDIO_HAS_PORTS
DBUS_LIBS
DBUS_CFLAGS
PULSEDEVEL_LIBS
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures pulseaudio-genivi-mir to adapt to many kinds of systems.
+\`configure' configures pulseaudio-murphy-ivi to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root
- [DATAROOTDIR/doc/pulseaudio-genivi-mir]
+ [DATAROOTDIR/doc/pulseaudio-murphy-ivi]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of pulseaudio-genivi-mir :";;
+ short | recursive ) echo "Configuration of pulseaudio-murphy-ivi :";;
esac
cat <<\_ACEOF
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
-Report bugs to <janos.f.kovacs@nokia.com>.
+Report bugs to <janos.kovacs@intel.com>.
_ACEOF
ac_status=$?
fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-pulseaudio-genivi-mir configure
+pulseaudio-murphy-ivi configure
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## --------------------------------------- ##
-## Report this to janos.f.kovacs@nokia.com ##
-## --------------------------------------- ##"
+( $as_echo "## ------------------------------------- ##
+## Report this to janos.kovacs@intel.com ##
+## ------------------------------------- ##"
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by pulseaudio-genivi-mir $as_me , which was
+It was created by pulseaudio-murphy-ivi $as_me , which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
# Define the identity of the package.
- PACKAGE='pulseaudio-genivi-mir'
+ PACKAGE='pulseaudio-murphy-ivi'
VERSION=''
fi
-PULSEAUDIO_HAS_PORTS=0
-echo -e "#include <pulsecore/pulsecore-config.h>\n #include <pulsecore/sink.h>\nint main() {\nreturn pa_sink_set_port((struct pa_sink *)0,\"\",0);\n}" | ${CC} ${CFLAGS} ${LIBPULSECORE_CFLAGS} ${LIBPULSE_CFLAGS} ${AM_LIBADD} ${LIBPULSECORE_LIBS} ${LIBPULSE_LIBS} -Wmissing-declarations -Werror -x c -c -o /dev/null - && PULSEAUDIO_HAS_PORTS=1
-
-
-ac_config_files="$ac_config_files Makefile src/Makefile doc/Makefile"
+ac_config_files="$ac_config_files Makefile murphy/Makefile doc/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by pulseaudio-genivi-mir $as_me , which was
+This file was extended by pulseaudio-murphy-ivi $as_me , which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Configuration commands:
$config_commands
-Report bugs to <janos.f.kovacs@nokia.com>."
+Report bugs to <janos.kovacs@intel.com>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-pulseaudio-genivi-mir config.status
+pulseaudio-murphy-ivi config.status
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "murphy/Makefile") CONFIG_FILES="$CONFIG_FILES murphy/Makefile" ;;
"doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
LIBPULSECORE_CFLAGS: ${LIBPULSECORE_CFLAGS}
LIBPULSECORE_LIBS: ${LIBPULSECORE_LIBS}
MAJORMINOR: ${PA_MAJORMINOR}
- PULSEAUDIO_HAS_PORTS: ${PULSEAUDIO_HAS_PORTS}
DBUS_CFLAGS: ${DBUS_CFLAGS}
DBUS_LIBS: ${DBUS_LIBS}
PD_SUPPORT: ${PD_SUPPORT}
AC_PREREQ(2.61)
-AC_INIT([pulseaudio-genivi-mir],[PAVER],[janos.f.kovacs@nokia.com])
+AC_INIT([pulseaudio-murphy-ivi],[PAVER],[janos.kovacs@intel.com])
DOC_SUPPORT_INIT()
-AC_CONFIG_SRCDIR([src/module-genivi-mir.c])
+AC_CONFIG_SRCDIR([murphy/module-murphy-ivi.c])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign 1.8.5 -Wall])
AS_HELP_STRING([--with-module-dir],[Directory where to install the modules to (defaults to ${LIBDIR}/pulse-${PA_MAJORMINOR}/modules/]),
[modlibexecdir=$withval], [modlibexecdir=${LIBDIR}/pulse-${PA_MAJORMINOR}/modules])
-PULSEAUDIO_HAS_PORTS=0
-echo -e "#include <pulsecore/pulsecore-config.h>\n #include <pulsecore/sink.h>\nint main() {\nreturn pa_sink_set_port((struct pa_sink *)0,\"\",0);\n}" | ${CC} ${CFLAGS} ${LIBPULSECORE_CFLAGS} ${LIBPULSE_CFLAGS} ${AM_LIBADD} ${LIBPULSECORE_LIBS} ${LIBPULSE_LIBS} -Wmissing-declarations -Werror -x c -c -o /dev/null - && PULSEAUDIO_HAS_PORTS=1
-AC_SUBST(PULSEAUDIO_HAS_PORTS)
-
AC_SUBST(modlibexecdir)
AC_CONFIG_FILES([
Makefile
- src/Makefile
+ murphy/Makefile
doc/Makefile
])
AC_OUTPUT
LIBPULSECORE_CFLAGS: ${LIBPULSECORE_CFLAGS}
LIBPULSECORE_LIBS: ${LIBPULSECORE_LIBS}
MAJORMINOR: ${PA_MAJORMINOR}
- PULSEAUDIO_HAS_PORTS: ${PULSEAUDIO_HAS_PORTS}
DBUS_CFLAGS: ${DBUS_CFLAGS}
DBUS_LIBS: ${DBUS_LIBS}
PD_SUPPORT: ${PD_SUPPORT}
-PACKAGE := genivi-mir
+PACKAGE := pulseaudio-module-murphy-ivi
VERSION := 1.1.10
THISDIR := fedora
# tarball type to use (git = HEAD, current = working copy)
type = current
-all: rpms cleanup
+all: rpms #cleanup
#showvar:
# @echo "$(var) = $($(var))"
cleanup:
-# rm -fr $(TMPDIR) && \
-# rm -f $(SPECFILE)
-# rm -f $(TARBALL)
+ rm -fr $(TMPDIR) && \
+ rm -f $(SPECFILE)
+ rm -f $(TARBALL)
# rules to patch the SPEC file and build a source tarball
$(SPECFILE): $(SPECFILE).in
Summary: Pulseaudio module for enforcing policy decisions in the audio domain
-Name: genivi-mir
+Name: pulseaudio-module-murphy-ivi
Version: ##__VERSION__##
Release: 0
License: LGPLv2.1
Group: System Environment/Daemons
-URL: http://meego.gitorious.org/maemo-multimedia/pulseaudio-policy-enforcement
+URL: https://github.com/otcshare/pulseaudio-module-murphy-ivi
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: pulseaudio-module-devel
%clean
-rm -rf $RPM_BUILD_ROOT
+#rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
--- /dev/null
+modlibexec_LTLIBRARIES = module-murphy-ivi.la
+
+module_murphy_ivi_la_SOURCES = \
+ module-murphy-ivi.c \
+ tracker.c \
+ node.c \
+ discover.c \
+ router.c \
+ switch.c \
+ audiomgr.c \
+ dbusif.c \
+ config.c \
+ utils.c
+
+#AM_CFLAGS = -pedantic
+
+module_murphy_ivi_la_LDFLAGS = -module -avoid-version -Wl,--no-undefined
+module_murphy_ivi_la_LIBADD = $(AM_LIBADD) $(DBUS_LIBS) $(LIBPULSE_LIBS) $(PULSEDEVEL_LIBS)
+module_murphy_ivi_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) $(LIBPULSE_CFLAGS) $(PULSEDEVEL_CFLAGS)
(to = pa_hashmap_get(am->nodes, hash_key(mir_output, cd->sink))))
{
pa_log_debug("routing '%s' => '%s'", from->amname, to->amname);
- if (!mir_switch_setup_link(u, from, to, FALSE))
+ if (!mir_switch_setup_link(u, from, to))
err = E_NOT_POSSIBLE;
}
else {
void pa_discover_add_sink(struct userdata *u, pa_sink *sink, pa_bool_t route)
{
+ pa_module *module;
pa_discover *discover;
mir_node *node;
pa_card *card;
pa_assert(sink);
pa_assert_se((discover = u->discover));
+ module = sink->module;
+
if ((card = sink->card)) {
if (!(key = node_key_from_card(u, mir_output, sink, buf, sizeof(buf))))
return;
}
}
}
- else {
+ else if (!module || !pa_streq(module, "module-combine-sink")) {
memset(&data, 0, sizeof(data));
data.key = pa_xstrdup(sink->name);
data.direction = mir_output;
data.implement = mir_device;
data.channels = sink->channel_map.channels;
+ data.muxidx = PA_IDXSET_INVALID;
if (sink == pa_utils_get_null_sink(u)) {
data.visible = FALSE;
void pa_discover_add_sink_input(struct userdata *u, pa_sink_input *sinp)
{
+ static const char combine_pattern[] = "Simultaneous output on ";
+
pa_proplist *pl;
pa_discover *discover;
mir_node data;
mir_node *node;
mir_node *sinknod;
char *name;
+ const char *media;
mir_node_type type;
char key[256];
pa_bool_t created;
pa_assert_se((discover = u->discover));
pa_assert_se((pl = sinp->proplist));
+
+ if ((media = pa_proplist_gets(sinp->proplist, PA_PROP_MEDIA_NAME)) &&
+ !strncmp(media, combine_pattern, sizeof(combine_pattern)-1))
+ {
+ pa_log_debug("handling new combine stream ...");
+ return;
+ }
+
name = pa_utils_get_sink_input_name(sinp);
- type = get_stream_routing_class(pl);
pa_log_debug("dealing with new stream '%s'", name);
- if (type == mir_node_type_unknown) {
+ if ((type = get_stream_routing_class(pl)) == mir_node_type_unknown) {
if ((type = guess_stream_node_type(pl)) == mir_node_type_unknown) {
pa_log_debug("cant find stream class for '%s'. "
"Leaving it alone", name);
set_stream_routing_properties(pl, type, NULL);
- /* make some post-routing here */
+ /* if needed, make some post-routing here */
}
/* we need to add this to main hashmap as that is used for loop
data.implement = mir_device;
data.paidx = PA_IDXSET_INVALID;
data.stamp = pa_utils_get_stamp();
+ data.muxidx = PA_IDXSET_INVALID;
cnam = pa_utils_get_card_name(card);
udd = pa_proplist_gets(card->proplist, "module-udev-detect.discovered");
data.amname = amname;
data.amdescr = (char *)cdescr;
data.pacard.index = card->index;
+ data.muxidx = PA_IDXSET_INVALID;
data.stamp = pa_utils_get_stamp();
cnam = pa_utils_get_card_name(card);
--- /dev/null
+#ifndef foomurphyivisymdeffoo
+#define foomurphyivisymdeffoo
+
+#include <pulsecore/core.h>
+#include <pulsecore/module.h>
+#include <pulsecore/macro.h>
+
+#define pa__init module_murphy_ivi_LTX_pa__init
+#define pa__done module_murphy_ivi_LTX_pa__done
+#define pa__get_author module_murphy_ivi_LTX_pa__get_author
+#define pa__get_description module_murphy_ivi_LTX_pa__get_description
+#define pa__get_usage module_murphy_ivi_LTX_pa__get_usage
+#define pa__get_version module_murphy_ivi_LTX_pa__get_version
+#define pa__load_once module_murphy_ivi_LTX_pa__load_once
+
+int pa__init(pa_module *m);
+void pa__done(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);
+pa_bool_t pa__load_once(void);
+
+#endif
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
-#include "module-genivi-mir-symdef.h"
+#include "module-murphy-ivi-symdef.h"
#include "userdata.h"
#include "tracker.h"
#include "discover.h"
#include "utils.h"
#ifndef DEFAULT_CONFIG_FILE
-#define DEFAULT_CONFIG_FILE "genivi-mir.conf"
+#define DEFAULT_CONFIG_FILE "murphy-ivi.conf"
#endif
PA_MODULE_AUTHOR("Janos Kovacs");
-PA_MODULE_DESCRIPTION("GenIVI and Murphy compliant audio policy module");
+PA_MODULE_DESCRIPTION("Murphy and GenIVI compliant audio policy module");
PA_MODULE_VERSION(PACKAGE_VERSION);
PA_MODULE_LOAD_ONCE(TRUE);
PA_MODULE_USAGE(
PRINT(" pacard.profile: '%s'", node->pacard.profile ?
node->pacard.profile : "");
PRINT(" paport : '%s'", node->paport ? node->paport : "");
+ PRINT(" muxidx : %u" , node->muxidx);
PRINT(" stamp : %u" , node->stamp);
#undef PRINT
uint32_t paidx; /**< sink|source|sink_input|source_output index*/
pa_node_card pacard; /**< pulse card related data, if any */
char *paport; /**< sink or source port if applies */
+ uint32_t muxidx; /**< for multiplexable input streams the index
+ of the combine module */
mir_dlist rtentries;/**< for devices: listhead of nodchain,
for streams: priority link (head is in
pa_router )
MIR_DLIST_FOR_EACH_BACKWARD(mir_node,rtentries, source, &router->nodlist) {
if (priority >= node_priority(u, source)) {
if ((target = route_stream(u, data)))
- mir_switch_setup_link(u, NULL, target, TRUE);
+ mir_switch_setup_link(u, NULL, target);
done = TRUE;
}
if ((sink = route_stream(u, source)))
- mir_switch_setup_link(u, source, sink, FALSE);
+ mir_switch_setup_link(u, source, sink);
}
if (!done && (target = route_stream(u, data)))
- mir_switch_setup_link(u, NULL, target, TRUE);
+ mir_switch_setup_link(u, NULL, target);
return target;
}
MIR_DLIST_FOR_EACH_BACKWARD(mir_node,rtentries, source, &router->nodlist) {
if ((sink = route_stream(u, source)))
- mir_switch_setup_link(u, source, sink, FALSE);
+ mir_switch_setup_link(u, source, sink);
}
ongoing_routing = FALSE;
#include "node.h"
-pa_bool_t mir_switch_setup_link(struct userdata *u,
- mir_node *from,
- mir_node *to,
- pa_bool_t prepare_only)
+pa_bool_t set_profile(struct userdata *, mir_node *);
+
+
+pa_bool_t mir_switch_setup_link(struct userdata *u,mir_node *from,mir_node *to)
{
pa_core *core;
pa_card *card;
pa_assert(to);
pa_assert_se((core = u->core));
-
- if (to->type == mir_bluetooth_a2dp || to->type == mir_bluetooth_sco) {
- if (!(card = pa_idxset_get_by_index(core->cards, to->pacard.index))) {
- pa_log("can't find card for '%s'", to->amname);
- return FALSE;
- }
-
- prof = card->active_profile;
-
- if (!pa_streq(to->pacard.profile, prof->name)) {
- pa_log_debug("changing profile '%s' => '%s'",
- prof->name, to->pacard.profile);
-
- if (u->state.profile) {
- pa_log("nested profile setting is not allowed. won't change "
- "'%s' => '%s'", prof->name, to->pacard.profile);
- return FALSE;
- }
-
- u->state.profile = to->pacard.profile;
-
- pa_card_set_profile(card, to->pacard.profile, FALSE);
-
- u->state.profile = NULL;
- }
+ if (!set_profile(u, to)) {
+ pa_log("can't route to '%s'", to->amname);
+ return FALSE;
}
if (to->paidx == PA_IDXSET_INVALID) {
return FALSE;
}
- if (prepare_only)
+ if (!from)
return TRUE;
+ if (!set_profile(u, from)) {
+ pa_log("can't route from '%s'", from->amname);
+ return FALSE;
+ }
+
if (!from || from->paidx == PA_IDXSET_INVALID) {
pa_log_debug("can't route '%s': no sink-input", to->amname);
return FALSE;
}
+pa_bool_t set_profile(struct userdata *u, mir_node *node)
+{
+ pa_core *core;
+ pa_card *card;
+ pa_card_profile *prof;
+
+ pa_assert(u);
+ pa_assert(node);
+ pa_assert_se((core = u->core));
+
+ if (node->implement != mir_device)
+ return TRUE;
+
+ if (node->type == mir_bluetooth_a2dp ||
+ node->type == mir_bluetooth_sco)
+ {
+ card = pa_idxset_get_by_index(core->cards, node->pacard.index);
+
+ if (!card) {
+ pa_log("can't find card for '%s'", node->amname);
+ return FALSE;
+ }
+
+ pa_assert_se(prof = card->active_profile);
+
+ if (!pa_streq(node->pacard.profile, prof->name)) {
+ pa_log_debug("changing profile '%s' => '%s'",
+ prof->name, node->pacard.profile);
+
+ if (u->state.profile) {
+ pa_log("nested profile setting is not allowed. won't change "
+ "'%s' => '%s'", prof->name, node->pacard.profile);
+ return FALSE;
+ }
+
+ u->state.profile = node->pacard.profile;
+
+ pa_card_set_profile(card, node->pacard.profile, FALSE);
+
+ u->state.profile = NULL;
+ }
+ }
+
+ return TRUE;
+}
+
+
/*
* Local Variables:
* c-basic-offset: 4
#include "userdata.h"
-pa_bool_t mir_switch_setup_link(struct userdata *, mir_node *, mir_node *,
- pa_bool_t);
+pa_bool_t mir_switch_setup_link(struct userdata *, mir_node *, mir_node *);
#endif /* foomirswitchfoo */
+++ /dev/null
-modlibexec_LTLIBRARIES = module-genivi-mir.la
-
-module_genivi_mir_la_SOURCES = \
- module-genivi-mir.c \
- tracker.c \
- node.c \
- discover.c \
- router.c \
- switch.c \
- audiomgr.c \
- dbusif.c \
- config.c \
- utils.c
-
-#AM_CFLAGS = -pedantic
-
-module_genivi_mir_la_LDFLAGS = -module -avoid-version -Wl,--no-undefined
-module_genivi_mir_la_LIBADD = $(AM_LIBADD) $(DBUS_LIBS) $(LIBPULSE_LIBS) $(PULSEDEVEL_LIBS)
-module_genivi_mir_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) $(LIBPULSE_CFLAGS) $(PULSEDEVEL_CFLAGS) -DPULSEAUDIO_HAS_PORTS=$(PULSEAUDIO_HAS_PORTS)
+++ /dev/null
-#ifndef foogenivimirsymdeffoo
-#define foogenivimirsymdeffoo
-
-#include <pulsecore/core.h>
-#include <pulsecore/module.h>
-#include <pulsecore/macro.h>
-
-#define pa__init module_genivi_mir_LTX_pa__init
-#define pa__done module_genivi_mir_LTX_pa__done
-#define pa__get_author module_genivi_mir_LTX_pa__get_author
-#define pa__get_description module_genivi_mir_LTX_pa__get_description
-#define pa__get_usage module_genivi_mir_LTX_pa__get_usage
-#define pa__get_version module_genivi_mir_LTX_pa__get_version
-#define pa__load_once module_genivi_mir_LTX_pa__load_once
-
-int pa__init(pa_module *m);
-void pa__done(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);
-pa_bool_t pa__load_once(void);
-
-#endif