meta-digi-dey: pulseaudio: reduce pulseaudio loading time

On boot, pulseaudio looks for the sound cards' corresponding profile sets, and
uses a default configuration if none is found. This was causing pulseaudio to
take up to 5 seconds trying every possible default profile.

This commit fixes this by creating a specific profile set for each of the sound
cards on the ccimx6sbc so pulseaudio doesn't spend time trying different
profiles that don't apply to our platform. It also adds udev rules so
pulseaudio knows which configuration to load for each card.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
Gabriel Valcazar 2017-01-18 10:40:53 +01:00
parent 73ebf262de
commit 25a5e7c7d3
3 changed files with 118 additions and 1 deletions

View File

@ -0,0 +1,35 @@
# 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 6 HDMI sound card
;
; Copyright (C) 2017 by Digi International Inc.
;
; This device has only one output (analog stereo)
;
; See default.conf for an explanation on the directives used here.
[General]
auto-profiles = no
[Mapping analog-stereo]
description = Analog Stereo
device-strings = hw:%f
channel-map = left,right
direction = output
[Profile output:analog-stereo]
description = Analog Stereo Output
output-mappings = analog-stereo

View File

@ -0,0 +1,69 @@
# 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 6 SBC SGTL5000 sound card
;
; Copyright (C) 2017 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]
description = Analog Mono
device-strings = hw:%f
channel-map = mono
[Mapping analog-stereo]
description = Analog Stereo
device-strings = hw:%f
channel-map = left,right
[Profile input:analog-mono]
description = Analog Mono Input
input-mappings = analog-mono
skip-probe = yes
[Profile input:analog-stereo]
description = Analog Stereo Input
input-mappings = analog-stereo
skip-probe = yes
[Profile output:analog-mono]
description = Analog Mono Output
output-mappings = analog-mono
skip-probe = yes
[Profile output:analog-mono+input:analog-mono]
description = Analog Mono Duplex
output-mappings = analog-mono
input-mappings = analog-mono
skip-probe = yes
[Profile output:analog-stereo]
description = Analog Stereo Output
output-mappings = analog-stereo
skip-probe = yes
[Profile output:analog-stereo+input:analog-stereo]
description = Analog Stereo Duplex
output-mappings = analog-stereo
input-mappings = analog-stereo
skip-probe = yes

View File

@ -3,14 +3,27 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
SRC_URI_append_ccimx6ulsbc = " file://0001-pulseaudio-keep-headphones-volume-in-platforms-witho.patch"
SRC_URI_append_ccimx6sbc = " file://hdmi_hotplug.sh"
SRC_URI_append_ccimx6sbc = " \
file://hdmi_hotplug.sh \
file://dey-audio-hdmi.conf \
file://dey-audio-sgtl5000.conf \
"
do_install_append_ccimx6sbc() {
install -d ${D}${sysconfdir}/udev/scripts
install -m 0755 ${WORKDIR}/hdmi_hotplug.sh ${D}${sysconfdir}/udev/scripts
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
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_
}