pulseaudio: generalize recipe and add support to MAX98089 sound card profile

Add pulseaudio audio profile for MAX98089 sound card and
generalize the recipe to support multiple platforms with
the same audio sound card.

https://jira.digi.com/browse/DEL-6461

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
Arturo Buzarra 2019-02-25 16:30:04 +01:00
parent eafa8684a3
commit 2ecc433295
8 changed files with 131 additions and 24 deletions

View File

@ -0,0 +1,4 @@
# Digi ConnectCore HDMI sound card
ATTRS{id}=="imxhdmisoc", ENV{PULSE_PROFILE_SET}="dey-audio-hdmi.conf"
SUBSYSTEM=="platform", KERNEL=="*hdmi_video", ACTION=="change", RUN+="/etc/udev/scripts/hdmi_hotplug.sh"

View File

@ -13,7 +13,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
; Audio profile for Digi ConnectCore 6 HDMI sound card
; Audio profile for Digi ConnectCore HDMI sound card
;
; Copyright (C) 2017 by Digi International Inc.
;

View File

@ -0,0 +1,2 @@
# Digi ConnectCore MAX98089 sound card
ATTRS{id}=="imxmax98088", ENV{PULSE_PROFILE_SET}="dey-audio-max98089.conf"

View File

@ -0,0 +1,75 @@
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of the
# License, or (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
; Audio profile for Digi ConnectCore MAX98089 sound card
;
; Copyright (C) 2019 by Digi International Inc.
;
; This device can operate in either mono or stereo for output, input or duplex
;
; Profile probing is skipped to save time during loading
;
; See default.conf for an explanation on the directives used here.
[General]
auto-profiles = no
[Mapping analog-mono]
device-strings = hw:%f
channel-map = mono
priority = 2
[Mapping analog-stereo]
device-strings = hw:%f
channel-map = left,right
priority = 60
[Profile input:analog-mono]
description = Analog Mono Input
input-mappings = analog-mono
skip-probe = yes
priority = 2
[Profile input:analog-stereo]
description = Analog Stereo Input
input-mappings = analog-stereo
skip-probe = yes
priority = 60
[Profile output:analog-mono]
description = Analog Mono Output
output-mappings = analog-mono
skip-probe = yes
priority = 200
[Profile output:analog-mono+input:analog-mono]
description = Analog Mono Duplex
output-mappings = analog-mono
input-mappings = analog-mono
skip-probe = yes
priority = 202
[Profile output:analog-stereo]
description = Analog Stereo Output
output-mappings = analog-stereo
skip-probe = yes
priority = 6000
[Profile output:analog-stereo+input:analog-stereo]
description = Analog Stereo Duplex
output-mappings = analog-stereo
input-mappings = analog-stereo
skip-probe = yes
priority = 6060

View File

@ -0,0 +1,2 @@
# Digi ConnectCore SGTL5000 sound card
ATTRS{id}=="sgtl5000audio", ENV{PULSE_PROFILE_SET}="dey-audio-sgtl5000.conf"

View File

@ -13,7 +13,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
; Audio profile for Digi ConnectCore 6 SBC SGTL5000 sound card
; Audio profile for Digi ConnectCore SGTL5000 sound card
;
; Copyright (C) 2017 by Digi International Inc.
;

View File

@ -1,35 +1,59 @@
# Copyright (C) 2017 Digi International
# Copyright (C) 2019 Digi International
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
SRC_URI_append_ccimx6ulsbc = " file://0001-pulseaudio-keep-headphones-volume-in-platforms-witho.patch"
SRC_URI_append_ccimx6 = " \
file://hdmi_hotplug.sh \
file://dey-audio-hdmi.conf \
file://dey-audio-sgtl5000.conf \
# Configuration files for SGTL500 sound card
CFG_SGTL5000 = " \
file://sgtl5000/dey-audio-sgtl5000.conf \
file://sgtl5000/90-pulseaudio.rules \
"
# Configuration files for MAX98089 sound card
CFG_MAX98089 = " \
file://max98089/dey-audio-max98089.conf \
file://max98089/90-pulseaudio.rules \
"
# Configuration files for HDMI sound card
CFG_HDMI = " \
file://hdmi/hdmi_hotplug.sh \
file://hdmi/dey-audio-hdmi.conf \
file://hdmi/90-pulseaudio-hdmi.rules \
"
SOUND_CARD ?= "max98089"
SOUND_CARD_ccimx6 ?= "sgtl5000"
AUDIO_HDMI ?= ""
AUDIO_HDMI_ccimx6 = "yes"
SRC_URI_append = " \
${@oe.utils.conditional('SOUND_CARD', 'sgtl5000', '${CFG_SGTL5000}', '', d)} \
${@oe.utils.conditional('SOUND_CARD', 'max98089', '${CFG_MAX98089}', '', d)} \
${@oe.utils.conditional('AUDIO_HDMI', 'yes', '${CFG_HDMI}', '', d)} \
"
SRC_URI_append_ccimx6ulsbc = " \
file://0001-pulseaudio-keep-headphones-volume-in-platforms-witho.patch \
"
EXTRA_OECONF_append_ccimx6 = " --disable-memfd"
do_install_append_ccimx6() {
install -d ${D}${sysconfdir}/udev/scripts
install -m 0755 ${WORKDIR}/hdmi_hotplug.sh ${D}${sysconfdir}/udev/scripts
do_install_append() {
install -d ${D}${datadir}/pulseaudio/alsa-mixer/profile-sets
install -m 0644 ${WORKDIR}/dey-audio-hdmi.conf ${D}${datadir}/pulseaudio/alsa-mixer/profile-sets
install -m 0644 ${WORKDIR}/dey-audio-sgtl5000.conf ${D}${datadir}/pulseaudio/alsa-mixer/profile-sets
install -m 0644 ${WORKDIR}/${SOUND_CARD}/dey-audio-*.conf ${D}${datadir}/pulseaudio/alsa-mixer/profile-sets
install -d ${D}${base_libdir}/udev/rules.d
install -m 0644 ${WORKDIR}/${SOUND_CARD}/90-pulseaudio.rules ${D}${base_libdir}/udev/rules.d
# Configuration files for HDMI sound card
if [ "${AUDIO_HDMI}" = "yes" ]; then
install -d ${D}${sysconfdir}/udev/scripts
install -m 0755 ${WORKDIR}/hdmi/hdmi_hotplug.sh ${D}${sysconfdir}/udev/scripts
install -m 0644 ${WORKDIR}/hdmi/dey-audio-hdmi.conf ${D}${datadir}/pulseaudio/alsa-mixer/profile-sets
install -m 0644 ${WORKDIR}/hdmi/90-pulseaudio-hdmi.rules ${D}${base_libdir}/udev/rules.d
fi
sed -i -e '/load-module module-suspend-on-idle/{s,$, timeout=0,g}' ${D}${sysconfdir}/pulse/default.pa
cat >> ${D}${base_libdir}/udev/rules.d/90-pulseaudio.rules <<-_EOL_
# Digi ConnectCore 6 SBC HDMI
ATTRS{id}=="imxhdmisoc", ENV{PULSE_PROFILE_SET}="dey-audio-hdmi.conf"
# Digi ConnectCore 6 SBC SGTL5000
ATTRS{id}=="sgtl5000audio", ENV{PULSE_PROFILE_SET}="dey-audio-sgtl5000.conf"
SUBSYSTEM=="platform", KERNEL=="*hdmi_video", ACTION=="change", RUN+="/etc/udev/scripts/hdmi_hotplug.sh"
_EOL_
}
PACKAGE_ARCH = "${MACHINE_ARCH}"