[-]
[+]
|
Changed |
_service:tar_git:audiosystem-passthrough.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:audiosystem-passthrough.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/mer-hybris/audiosystem-passthrough.git</param>
<param name="branch">master</param>
- <param name="revision">1.1.2</param>
+ <param name="revision">1.3.0</param>
<param name="token"/>
<param name="debian"/>
<param name="dumb"/>
|
[-]
[+]
|
Changed |
_service:tar_git:audiosystem-passthrough-1.3.0.tar.bz2/Makefile
^
|
@@ -17,7 +17,7 @@
all: $(EXE) pkgconfig
-PCVERSION = 1.1.0
+PCVERSION = 1.3.0
SRC_DIR = src
BUILD_DIR = build
|
[-]
[+]
|
Changed |
_service:tar_git:audiosystem-passthrough-1.3.0.tar.bz2/README.md
^
|
@@ -13,12 +13,13 @@
* Normal mode
* Dummy mode - exposes the service but only replies OK to all method calls)
* qti - IQcRilAudio
- * QCom devices which use vendor.qti.hardware.radio.am@1.0::IQcRilAudioCallback
- hidl service for setting voice call related parameters
+ * Devices which use vendor.qti.hardware.radio.am@1.0::IQcRilAudioCallback
+ or vendor.qti.qcril.am@1.0::IQcRilAudioCallback hidl service for
+ setting voice call related parameters.
* hw2_0 - android.hardware.audio@2.0
* Devices which use android.hardware.audio@2.0::IDevicesFactory/default and
- android.hardware.audio@2.0::IDevice services for setting voice call related parameters,
- but it have only dummy implementation for now
+ android.hardware.audio@2.0::IDevice services for setting voice call
+ related parameters. Right now hw2_0 has only dummy implementation.
### Command line arguments
@@ -54,7 +55,7 @@
This can be used on devices where AudioFlinger service needs to be present
but isn't used for anything.
-Package audiosystem-passthrough-dummy-hw2_0 contain service file which
+Package audiosystem-passthrough-dummy-hw2_0 contains a service file which
starts audiosystem-passthrough in android.hardware.audio@2.0 dummy mode.
This can be used on devices where android.hardware.audio@2.0 service
needs to be present but isn't used for anything.
|
[-]
[+]
|
Changed |
_service:tar_git:audiosystem-passthrough-1.3.0.tar.bz2/src/impl-af.c
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 Jolla Ltd.
+ * Copyright (C) 2019-2022 Jolla Ltd.
*
* Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
*
@@ -34,6 +34,7 @@
#include <gbinder.h>
#include <glib-unix.h>
+#include <unistd.h>
#include "common.h"
#include "impl.h"
@@ -165,7 +166,7 @@
AfApp* app = user_data;
if (gbinder_servicemanager_is_present(app->sm)) {
- DBG("Service manager has reappeared.");
+ DBG("Service manager has appeared.");
gbinder_servicemanager_add_service(app->sm, SERVICE_NAME, app->local,
app_add_service_done, app);
} else {
@@ -193,10 +194,20 @@
GMainLoop *mainloop,
const AppConfig *config)
{
+ const gchar *device = config->device ? config->device : BINDER_DEVICE;
+
memset(&_app, 0, sizeof(_app));
+
+ if (!g_file_test(device, G_FILE_TEST_EXISTS)) {
+ int times = 60;
+ DBG("Device node %s doesn't exist, let's wait for it for a while...", device);
+ while (!g_file_test(device, G_FILE_TEST_EXISTS) && times--)
+ usleep(500000); /* 0.5 seconds */
+ }
+
_app.loop = mainloop;
_app.config = config;
- _app.sm = gbinder_servicemanager_new(BINDER_DEVICE);
+ _app.sm = gbinder_servicemanager_new(device);
_app.local = gbinder_servicemanager_new_local_object(_app.sm,
SERVICE_IFACE,
app_reply,
|
[-]
[+]
|
Changed |
_service:tar_git:audiosystem-passthrough-1.3.0.tar.bz2/src/impl-qti.c
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 Jolla Ltd.
+ * Copyright (C) 2019-2022 Jolla Ltd.
*
* Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
*
@@ -40,15 +40,28 @@
#include "logging.h"
#include "dbus-comms.h"
-#define BINDER_DEVICE GBINDER_DEFAULT_HWBINDER
-#define QCRIL_IFACE_1_0(x) "vendor.qti.hardware.radio.am@1.0::" x
-#define QCRIL_AUDIO_1_0 QCRIL_IFACE_1_0("IQcRilAudio")
-#define QCRIL_AUDIO_CALLBACK_1_0 QCRIL_IFACE_1_0("IQcRilAudioCallback")
-
-#define OFONO_RIL_SUBSCRIPTION_CONF "/etc/ofono/ril_subscription.conf"
-#define OFONO_RIL_SUBSCRIPTION_D "/etc/ofono/ril_subscription.d"
-#define OFONO_RIL_SLOTS_MAX (4)
+#define BINDER_DEVICE GBINDER_DEFAULT_HWBINDER
+#define QCRIL_IFACE_HW_RADIO_1_0(x) "vendor.qti.hardware.radio.am@1.0::" x
+#define QCRIL_AUDIO_HW_RADIO_1_0 QCRIL_IFACE_HW_RADIO_1_0("IQcRilAudio")
+#define QCRIL_AUDIO_HW_RADIO_CALLBACK_1_0 QCRIL_IFACE_HW_RADIO_1_0("IQcRilAudioCallback")
+#define QCRIL_IFACE_1_0(x) "vendor.qti.qcril.am@1.0::" x
+#define QCRIL_AUDIO_1_0 QCRIL_IFACE_1_0("IQcRilAudio")
+#define QCRIL_AUDIO_CALLBACK_1_0 QCRIL_IFACE_1_0("IQcRilAudioCallback")
+
+#define OFONO_RIL_SUBSCRIPTION_CONF "/etc/ofono/ril_subscription.conf"
+#define OFONO_RIL_SUBSCRIPTION_D "/etc/ofono/ril_subscription.d"
+#define OFONO_RIL_SLOTS_MAX (4)
+
+struct qcril_iface_name {
+ const gchar *name;
+ const gchar *callback;
+};
+static const struct qcril_iface_name qcril_iface_names[] = {
+ { QCRIL_AUDIO_HW_RADIO_1_0, QCRIL_AUDIO_HW_RADIO_CALLBACK_1_0 },
+ { QCRIL_AUDIO_1_0, QCRIL_AUDIO_CALLBACK_1_0 },
+ { NULL, NULL }
+};
enum qcril_audio_methods {
QCRIL_AUDIO_SET_CALLBACK = GBINDER_FIRST_CALL_TRANSACTION,
@@ -66,6 +79,8 @@
HidlApp *app;
char* fqname;
gchar* slot;
+ const gchar *interface_name;
+ const gchar *callback_name;
GBinderServiceManager* sm;
GBinderLocalObject* local;
GBinderRemoteObject* remote;
@@ -170,7 +185,7 @@
AmClient* am = user_data;
const char* iface = gbinder_remote_request_interface(req);
- if (!g_strcmp0(iface, QCRIL_AUDIO_CALLBACK_1_0)) {
+ if (!g_strcmp0(iface, am->callback_name)) {
GBinderReader reader;
GBinderLocalReply* reply = gbinder_local_object_new_reply(obj);
const char* str;
@@ -204,19 +219,38 @@
AmClient* am)
{
int status = 0;
- am->remote = gbinder_servicemanager_get_service_sync(am->sm,
- am->fqname, &status); /* auto-released reference */
+ int i;
+
+ for (i = 0; qcril_iface_names[i].name; i++) {
+ const gchar *interface_name = qcril_iface_names[i].name;
+ const gchar *callback_name = qcril_iface_names[i].callback;
+ gchar *fqname;
+
+ fqname = g_strconcat(interface_name, "/", am->slot, NULL);
+ am->remote = gbinder_servicemanager_get_service_sync(am->sm,
+ fqname, &status); /* auto-released reference */
+ if (am->remote) {
+ am->fqname = fqname;
+ am->interface_name = interface_name;
+ am->callback_name = callback_name;
+ break;
+ } else {
+ DBG("Couldn't connect to %s, trying next...", interface_name);
+ g_free(fqname);
+ continue;
+ }
+ }
if (am->remote) {
GBinderLocalRequest* req;
DBG("Connected to %s", am->fqname);
gbinder_remote_object_ref(am->remote);
- am->client = gbinder_client_new(am->remote, QCRIL_AUDIO_1_0);
+ am->client = gbinder_client_new(am->remote, am->interface_name);
am->death_id = gbinder_remote_object_add_death_handler(am->remote,
am_remote_died, am);
am->local = gbinder_servicemanager_new_local_object(am->sm,
- QCRIL_AUDIO_CALLBACK_1_0, am_client_callback, am);
+ am->callback_name, am_client_callback, am);
/* oneway IQcRilAudio::setCallback(IQcRilAudioCallback) */
req = gbinder_client_new_request(am->client);
@@ -227,6 +261,15 @@
DBG("setCallback %s status %d", am->slot, status);
return TRUE;
}
+
+ ERR("No interfaces could be configured!");
+
+ am->interface_name = qcril_iface_names[0].name;
+ am->callback_name = qcril_iface_names[0].callback;
+ am->fqname = g_strconcat(am->interface_name, "/", am->slot, NULL);
+
+ ERR("TODO defaulting to wait for %s, if this is not desired please update implementation.", am->fqname);
+
return FALSE;
}
@@ -256,7 +299,6 @@
am->app = app;
am->slot = g_strdup(slot);
- am->fqname = g_strconcat(QCRIL_AUDIO_1_0, "/", slot, NULL);
am->sm = gbinder_servicemanager_ref(app->sm);
return am;
}
@@ -408,7 +450,7 @@
_app.loop = mainloop;
_app.config = config;
- _app.sm = gbinder_servicemanager_new(BINDER_DEVICE);
+ _app.sm = gbinder_servicemanager_new(config->device ? config->device : BINDER_DEVICE);
if (!app_parse_all_slots(&_app))
return FALSE;
|
[-]
[+]
|
Changed |
_service:tar_git:audiosystem-passthrough-1.3.0.tar.bz2/src/impl.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 Jolla Ltd.
+ * Copyright (C) 2019-2022 Jolla Ltd.
*
* Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
*
@@ -46,6 +46,7 @@
typedef struct app_config {
gchar *address;
+ gchar *device;
gboolean dummy_mode;
gboolean verbose;
gint binder_index;
|
[-]
[+]
|
Changed |
_service:tar_git:audiosystem-passthrough-1.3.0.tar.bz2/src/passthrough-helper.c
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 Jolla Ltd.
+ * Copyright (C) 2019-2022 Jolla Ltd.
*
* Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
*
@@ -125,10 +125,13 @@
GError* error = NULL;
gchar *type_str = NULL;
gchar *address_str = NULL;
+ gchar *device_str = NULL;
gint idx = -1;
GOptionContext* options = NULL;
GOptionEntry entries[] = {
+ { "device", 'd', G_OPTION_ARG_NONE, G_OPTION_ARG_STRING,
+ &device_str, "Binder device node." },
{ "address", 'a', G_OPTION_FLAG_NONE, G_OPTION_ARG_STRING,
&address_str, "DBus address for PulseAudio module interface.", NULL },
{ "idx", 'i', G_OPTION_FLAG_NONE, G_OPTION_ARG_INT,
@@ -189,6 +192,11 @@
app->config.dummy_mode = TRUE;
}
+ if (device_str) {
+ app->config.device = device_str;
+ device_str = NULL;
+ }
+
app->loop = g_main_loop_new(NULL, TRUE);
if (!app_implementations[app->type].init(app->loop, &app->config))
goto fail;
@@ -202,6 +210,7 @@
fail:
g_free(address_str);
g_free(type_str);
+ g_free(device_str);
if (options)
g_option_context_free(options);
@@ -224,6 +233,7 @@
if (app->type >= 0 && app->ret == RET_OK)
app->ret = app_implementations[app->type].done();
g_free(app->config.address);
+ g_free(app->config.device);
}
int main(int argc, char* argv[])
|
[-]
[+]
|
Changed |
_service:tar_git:audiosystem-passthrough-dummy-hw2_0.service
^
|
@@ -1,6 +1,7 @@
[Unit]
Description=Binder android.hardware.audio@2.0 dummy service
-After=pre-user-session.target
+After=droid-hal-init.service
+Before=ofono.service
[Service]
Environment=AUDIOSYSTEM_PASSTHROUGH_TYPE=hw2_0
@@ -9,4 +10,4 @@
Restart=always
[Install]
-WantedBy=user-session.target
\ No newline at end of file
+WantedBy=multi-user.target
|