summaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-ti/recipes-multimedia/pulseaudio
AgeCommit message (Collapse)AuthorFilesLines
2017-09-08Upgrade to pyroChanghyeok Bae3-5/+7
u-boot: v2017.01 dlt-daemon: Remove gzipnative inheritance - gzipnative.bbclass is removed in pyro branch. - See ab0f46400c113c0d893be872727a67739d5e794d in poky. gpm: Remove bbappend file - upstream(meta-openembedded) is using git(v1.99.7) and this is not required anymore. gnutls: Remove bbappend file - The patch is already applied in upstream. agl-image-minimal: Remove ROOTFS_PKGMANAGE_BOOTSTRAP - ROOTFS_PKGMANAGE_BOOTSTRAP is removed in upstream. - Please see 529244ee212fe14019e35a5f163fab705ddbf141 in poky. freetype: Change hash value for v2.7.1 binary shadow: Remove shadow_%.bbappend - It's already applied upstream poky. Remove nativesdk-packagegroup-sdk-host.bbappend - It's already applied in upstream poky. faac: Remove bbappend file - It's already applied meta-openembedded upstream. pulseaudio: Change bbappend naming - Upstream yocto provides pulseaudio v10.0. weston: re-create patch to apply new version (v2.0.0) - Remove 0001-compositor-drm.c-Launch-without-input-devices.patch because it's already applied in new version. mesa: Remove 12.0.3 recipe and fix build error for qemux86-64 - Yocto upstream supports 17.0.2 and v12.0.3 is not required anymore in raspberrypi - Error: | configure: error: --enable-gallium-llvm selected but llvm-config is not found wayland-ivi-extension: Upgrade to latest master version - Due to weston upgrade, wayland-ivi-extension should be upgraded. packagegroup-ivi-common-core-multimedia: Remove alsa-lib - alsa-lib has empty package and it's not required anymore. Add agl-driver and agl-passenger in group and passwd - Parsing Error: agl-users: groupname agl-passenger does not have a static ID defined. poky-agl.conf: Change gstreamer default version to v1.10.x - Yocto upstream moves gstreamer to v1.10.4. af-main: Fix build error - Error: file /usr/local conflicts between attempted installs of af-main-1.0-r0.corei7_64 and base-files-3.0.14-r89.qemux86_64 intel-corei7-64: Change gstreamer-vaapi-1.0 name - gstreamer-vaapi-1.0 is moved to oe-core and its name is changed to gstreamer1.0-vaapi. linux-raspberrypi: Drop 4.4 bbappend - The upstream meta-raspberrypi doesn't support v4.4 anymore. - CVE patches are not required anymore. glibc: Remove bbappend - The bug-20116 is already applied in 2.25 cynara,security-manager: Fix build error - cynara: Replace bb.data to d - security-manager: Temporarily use 'no' in APPLY variable u-boot-ota: Add SRC_URI - In pyro, SRC_URI and S is moved from .inc to .bb linux-yocto: Remove 4.8 and 4.4 bbappend - Yocto 2.3 (Pyro) doesn't support v4.8 kernel anymore. - CVE patches in meta-agl-bsp are already applied in Yocto 2.3. tcf-agent: Remove bbappend file - This change is merged to upstream poky (pyro) bluez5: Remove recipe and add .bbappend - Yocto 2.3 (Pyro) already has same version. - bluetooth.conf file is added in .bbappend python-pycrypto: Remove recipe - meta-openembedded (Pyro) already has same version. meta-agl-bsp/classes/image.bbclass: Arrange for pyro - image.bbclass is taken from poky/meta/classes/image.bbclass and only changed IMAGE_TYPE_vm variable. libsoup: Fix native build error temporarily v2 (jsmoeller): meta-agl-bsp/meta-ti: - workaround patches in meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad_%.bbappend - fix old python code in meta-ti/recipes-arago/ipumm-fw/ipumm-fw_3.00.13.00.bb - workaround patches in meta-ti/recipes-arago/weston/weston_%.bbappend - make specific to dra7xx-evm: -- meta-ti/recipes-bsp/alsa-state/alsa-state.bbappend -- meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend -- rename meta-ti/recipes-multimedia/pulseaudio/pulseaudio/dra7xx-evm-set-default-sink-source.patch -- rename meta-ti/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend TODO/FIXME's in: - meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad_%.bbappend - meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend - meta-agl-bsp/meta-ti/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend - meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend Bug-AGL: SPEC-646 Change-Id: I4162ae887d3334e9102575e3724483aa25f4bd9c Signed-off-by: Changhyeok Bae <changhyeok.bae@gmail.com> Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org> Reviewed-on: https://gerrit.automotivelinux.org/gerrit/10457
2017-08-04meta-agl-bsp: meta-ti: pulseaudio: set sink/source for dra7xx-evmMatt Porter2-0/+20
pulseaudio, by default, chooses alsa_output.platform-omap-hdmi-audio.0.auto.analog-stereo as the default sink. This is not desired since the HDMI is not normally used as the dra7xx-evm includes an LCD. Configure the CPU board's alsa_output.platform-sound0.analog-stereo (Line-Out/Headphone) as the default sink and configure the default source too. Bug-AGL: SPEC-804 Change-Id: I5d19aa564c8c162d1f5c68ae298d1d25592c8dc9 Signed-off-by: Matt Porter <mporter@konsulko.com> Reviewed-on: https://gerrit.automotivelinux.org/gerrit/10497 Reviewed-by: Thomas Rini <trini@konsulko.com> Tested-by: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org> ci-image-build: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org> ci-image-boot-test: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org> Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
lor: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright (C) 2022,2023 Konsulko Group
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <QDebug>
#include <QtConcurrent>

#include "vehiclesignals.h"
#include "QtKuksaClient.h"

VehicleSignals::VehicleSignals(const VehicleSignalsConfig &config, QObject *parent) :
	QObject(parent),
	m_config(config)
{
	// Create gRPC channel
	// NOTE: channel creation and waiting for connected state could be put into
	//       a thread that is spawned here.

  	QString host = m_config.hostname();
	host += ":";
	host += QString::number(m_config.port());

	std::shared_ptr<grpc::Channel> channel;
	if (!m_config.caCert().isEmpty()) {
		qInfo() << "Using TLS";
		grpc::SslCredentialsOptions options;
		options.pem_root_certs = m_config.caCert().toStdString();
		if (!m_config.tlsServerName().isEmpty()) {
			grpc::ChannelArguments args;
			auto target = m_config.tlsServerName();
			qInfo() << "Overriding TLS target name with " << target;
			args.SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, target.toStdString());
			channel = grpc::CreateCustomChannel(host.toStdString(), grpc::SslCredentials(options), args);
		} else {
			channel = grpc::CreateChannel(host.toStdString(), grpc::SslCredentials(options));
		}
	} else {
		channel = grpc::CreateChannel(host.toStdString(), grpc::InsecureChannelCredentials());
	}

	m_broker = new QtKuksaClient(channel, config);
	if (!m_broker)
		qCritical() << "gRPC client initialization failed";

	QObject::connect(m_broker, &QtKuksaClient::connected, this, &VehicleSignals::onConnected);
}

VehicleSignals::~VehicleSignals()
{
	delete m_broker;
}

void VehicleSignals::connect()
{
	// QtKuksaClient will call our onConnected slot when the channel
	// is connected, and then we pass that along via our connected
	// signal.
	if (m_broker)
		m_broker->connect();
}

void VehicleSignals::authorize()
{
	// Databroker has no separate authorize call, so this is a no-op
	emit authorized();
}

void VehicleSignals::get(const QString &path, const bool actuator)
{
	if (m_broker)
		m_broker->get(path, actuator);
}

void VehicleSignals::set(const QString &path, const QString &value, const bool actuator)
{
	if (m_broker)
		m_broker->set(path, value, actuator);
}

void VehicleSignals::set(const QString &path, const qint32 value, const bool actuator)
{
	if (m_broker)
		m_broker->set(path, value, actuator);
}

void VehicleSignals::set(const QString &path, const qint64 value, const bool actuator)
{
	if (m_broker)
		m_broker->set(path, value, actuator);
}

void VehicleSignals::set(const QString &path, const quint32 value, const bool actuator)
{
	if (m_broker)
		m_broker->set(path, value, actuator);
}

void VehicleSignals::set(const QString &path, const quint64 value, const bool actuator)
{
	if (m_broker)
		m_broker->set(path, value, actuator);
}

void VehicleSignals::set(const QString &path, const float value, const bool actuator)
{
	if (m_broker)
		m_broker->set(path, value, actuator);
}

void VehicleSignals::set(const QString &path, const double value, const bool actuator)
{
	if (m_broker)
		m_broker->set(path, value, actuator);
}

void VehicleSignals::subscribe(const QString &path, bool actuator)
{
	if (m_broker)
		m_broker->subscribe(path, actuator);
}

void VehicleSignals::subscribe(const QMap<QString, bool> &signals_)
{
	if (m_broker)
		m_broker->subscribe(signals_);
}

// Slots

void VehicleSignals::onConnected()
{
	QObject::connect(m_broker, &QtKuksaClient::getResponse, this, &VehicleSignals::onGetResponse);
	QObject::connect(m_broker, &QtKuksaClient::setResponse, this, &VehicleSignals::onSetResponse);
	QObject::connect(m_broker, &QtKuksaClient::subscribeResponse, this, &VehicleSignals::onSubscribeResponse);
	//QObject::connect(m_broker, &QtKuksaClient::subscribeDone, this, &VehicleSignals::onSubscribeDone);

	emit connected();
}

void VehicleSignals::onGetResponse(QString path, QString value, QString timestamp)
{
	emit getSuccessResponse(path, value, timestamp);
}

void VehicleSignals::onSetResponse(QString path, QString error)
{
	emit setErrorResponse(path, error);
}

void VehicleSignals::onSubscribeResponse(QString path, QString value, QString timestamp)
{
	if (m_config.verbose() > 1)
		qDebug() << "VehicleSignals::onSubscribeResponse: got " << path << " = " << value;
	emit signalNotification(path, value, timestamp);
}

void VehicleSignals::onSubscribeDone(const QMap<QString, bool> &signals_, bool canceled)
{
	if (!canceled) {
		// queue up a resubscribe attempt
		QFuture<void> future = QtConcurrent::run(&VehicleSignals::resubscribe, this, signals_);
	}
}

// Private

void VehicleSignals::resubscribe(const QMap<QString, bool> &signals_)
{
	// Delay 100 milliseconds between subscribe attempts
	QThread::msleep(100);

	if (m_broker)
		m_broker->subscribe(signals_);
}