Pulseaudio Distorts HDMI Audio

Post Reply
Molorius
Posts: 62
Joined: Tue Mar 01, 2016 4:40 am
languages_spoken: English
ODROIDs: C1+, C2, GO
Has thanked: 0
Been thanked: 0
Contact:

Pulseaudio Distorts HDMI Audio

Unread post by Molorius » Fri Mar 08, 2019 2:43 pm

I have a problem after upgrading pulseaudio from version 1:11.1-1ubuntu7.1 to version 1:11.1-1ubuntu7.2. Before this, the audio through HDMI sounded great and had 2 channels (my TV only has 2, haven't tested with a different TV). After updating, it says that my TV only has the single audio channel and the audio is extremely distorted. I haven't tried with a USB DAC yet. Any thoughts on how to fix this? I tried using a fresh image, and pulseaudio (or one of its dependencies) is the package with the problem. Is anyone else experiencing this problem?

jk50
Posts: 2
Joined: Sun Jul 22, 2018 9:11 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by jk50 » Fri Mar 08, 2019 5:59 pm

I too have broken audio after March 7th upgrade of pulseaudio . Similar symptoms badly distorted and dropped to one channel.

richard-g8jvm
Posts: 411
Joined: Sun Jan 18, 2015 1:27 am
languages_spoken: english
ODROIDs: C1+ C2, XU4
Location: Telford UK
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by richard-g8jvm » Tue Mar 12, 2019 1:20 am

Hi
I've hit problems too
I've purge pulseaudio
hashed out all the update entries in the apt sources list

but trying to install an older version of pulseaudio is a pain

Code: Select all

odroid@odroid:/etc/apt$ apt list pulseaudio
Listing... Done
pulseaudio/bionic 1:11.1-1ubuntu7 arm64
N: There is 1 additional version. Please use the '-a' switch to see it
odroid@odroid:/etc/apt$ sudo apt install pulseaudio/bionic 1:11.1-1ubuntu7 arm64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package 1:11.1-1ubuntu7
E: Couldn't find any package by glob '1:11.1-1ubuntu7'
E: Couldn't find any package by regex '1:11.1-1ubuntu7'
E: Unable to locate package arm64


Ubuntu really is a love hate relationship

how do you install the earlier version ????

TIA
BR
Richard G8JVM

Molorius
Posts: 62
Joined: Tue Mar 01, 2016 4:40 am
languages_spoken: English
ODROIDs: C1+, C2, GO
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by Molorius » Tue Mar 12, 2019 1:31 am

Another thing I tried while downgrading was using

Code: Select all

aptitude install pulseaudio=1:11.1-1ubuntu7
but this did not properly work either. Installing a fresh image and holding the update with

Code: Select all

apt-mark hold pulseaudio
solves the issue, but anything compiled against the newer version (such as Retroarch) will crash all the time. I couldn't make an improvement by modifying files in /etc/pulse :(

richard-g8jvm
Posts: 411
Joined: Sun Jan 18, 2015 1:27 am
languages_spoken: english
ODROIDs: C1+ C2, XU4
Location: Telford UK
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by richard-g8jvm » Tue Mar 12, 2019 3:16 am

Didn't solve anything here
and even with apt mark hold pulseaudio
the damn thing just went and put the later version in.

All the desktop sounds are normal thru HDMI , but on Kodi just wispery chashing noises
and thats its main use.
BR
Richard G8JVM

richard-g8jvm
Posts: 411
Joined: Sun Jan 18, 2015 1:27 am
languages_spoken: english
ODROIDs: C1+ C2, XU4
Location: Telford UK
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by richard-g8jvm » Tue Mar 12, 2019 3:58 am

To get Pulse to revert to the previous versions you have to
load libpulse0 to the earlier version, then pulsedsp to the earlier version, then pulseaudio-utils to the earlier version

Then you can install pulseaudio to the earlier version

and it makes no difference what so ever to the sound on kodi , just wispery crashes
So it looks like one of the dependencies
any of this lot, with exception of above maybe
Depends: libapparmor1 (>= 2.7.0~beta1+bzr1772), libasound2 (>= 1.0.24.1), libc6 (>= 2.27), libcap2 (>= 1:2.10), libdbus-1-3 (>= 1.9.14), libgcc1 (>= 1:3.0), libice6 (>= 1:1.0.0), libltdl7 (>= 2.4.6), liborc-0.4-0 (>= 1:0.4.25), libpulse0 (= 1:11.1-1ubuntu7), libsm6, libsndfile1 (>= 1.0.20), libspeexdsp1 (>= 1.2~beta3.2-1), libstdc++6 (>= 4.1.1), libsystemd0, libtdb1 (>= 1.2.7+git20101214), libudev1 (>= 183), libwebrtc-audio-processing1, libx11-6, libx11-xcb1, libxcb1, libxtst6, adduser, lsb-base (>= 3.2-13), libasound2-plugins, pulseaudio-utils

Oh deep joy !
BR
Richard G8JVM

richard-g8jvm
Posts: 411
Joined: Sun Jan 18, 2015 1:27 am
languages_spoken: english
ODROIDs: C1+ C2, XU4
Location: Telford UK
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by richard-g8jvm » Tue Mar 12, 2019 4:30 am

Just tried to download the source code for 11.1, but it wont play because the init-tool is too ancient in the current 18.04 on the C2
so you cant even try to build from source .
megga miffed !
BR
Richard G8JVM

Molorius
Posts: 62
Joined: Tue Mar 01, 2016 4:40 am
languages_spoken: English
ODROIDs: C1+, C2, GO
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by Molorius » Tue Mar 12, 2019 8:33 am

Found a fix! They changed one line of a file that made the stereo options disappear, and the default mono setting has the distortion. Mono is distorted in 11.1 as well.

In /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf line 112 change

Code: Select all

device-strings = front:%f
to

Code: Select all

device-strings = front:%f hw:%f
The reasoning behind the change can be found in the mainline commit https://gitlab.freedesktop.org/pulseaud ... 18065edc40. Basically, the C2 sound is an edge case. You can add a custom profile to fix it too, but this is a quick fix. Apply by either rebooting or 'pulseaudio -k'.

pzad
Posts: 5
Joined: Fri Feb 17, 2017 1:27 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by pzad » Tue Mar 12, 2019 8:51 am

Molorius wrote:
Tue Mar 12, 2019 8:33 am
Found a fix! They changed one line of a file that made the stereo options disappear, and the default mono setting has the distortion. Mono is distorted in 11.1 as well.

In /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf line 112 change

Code: Select all

device-strings = front:%f
to

Code: Select all

device-strings = front:%f hw:%f
The reasoning behind the change can be found in the mainline commit https://gitlab.freedesktop.org/pulseaud ... 18065edc40. Basically, the C2 sound is an edge case. You can add a custom profile to fix it too, but this is a quick fix. Apply by either rebooting or 'pulseaudio -k'.
Excellent find/fix! I can confirm fix works and stereo is back

Molorius
Posts: 62
Joined: Tue Mar 01, 2016 4:40 am
languages_spoken: English
ODROIDs: C1+, C2, GO
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by Molorius » Tue Mar 12, 2019 9:03 am

Here's a patch file for it:

Code: Select all

--- /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf  2019-03-11 17:52:05.013134743 -0600
+++ /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf  2019-03-11 17:03:53.000000000 -0600
@@ -109,7 +109,7 @@
 priority = 2

 [Mapping analog-stereo]
-device-strings = front:%f
+device-strings = front:%f hw:%f
 channel-map = left,right
 paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-headphones analog-output-headphones-2
 paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headphone-mic analog-input-headset-mic
Save that as "pulseaudio_c2.patch" and apply it with:

Code: Select all

sudo patch -d/ -p0 < pulseaudio_c2.patch
Then restart pulseaudio with:

Code: Select all

pulseaudio -k
EDIT: fixed patch file
Last edited by Molorius on Tue Mar 12, 2019 9:06 am, edited 1 time in total.

richard-g8jvm
Posts: 411
Joined: Sun Jan 18, 2015 1:27 am
languages_spoken: english
ODROIDs: C1+ C2, XU4
Location: Telford UK
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by richard-g8jvm » Tue Mar 12, 2019 9:04 am

Does this also fix the problems on kodi sound ?
BR
Richard G8JVM

Molorius
Posts: 62
Joined: Tue Mar 01, 2016 4:40 am
languages_spoken: English
ODROIDs: C1+, C2, GO
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by Molorius » Tue Mar 12, 2019 9:11 am

It should, yes. Modify that file, restart pulseaudio, then go to the desktop sound settings. Go to the Hardware tab, then select any of the Analog Stereo Output options.

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by mad_ady » Tue Mar 12, 2019 6:05 pm

Thank you for the fix, @Molorius!
Question now is - what's the best way to deploy it to all C2 images? More and more people will notice it, and updating pulseaudio will cause it to break again...
@odroid - is there an odroid-tweaks binary on the C2 as there is on XU4? Maybe one could be created that runs at startup and uses sed to fix the config file (and restart pulseaudio if needed).

User avatar
odroid
Site Admin
Posts: 32677
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 209 times
Been thanked: 364 times
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by odroid » Tue Mar 12, 2019 6:20 pm

I don't want to add any additional strange script. Let's wait for Canonical's official fix.
Do you know where a right place to report the issue?

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by mad_ady » Tue Mar 12, 2019 6:28 pm

I'm guessing it should be reported to pulseaudio and if they find/recommend a better way to fix it it will be picked up by ubuntu after a while.

richard-g8jvm
Posts: 411
Joined: Sun Jan 18, 2015 1:27 am
languages_spoken: english
ODROIDs: C1+ C2, XU4
Location: Telford UK
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by richard-g8jvm » Tue Mar 12, 2019 9:22 pm

I've ended up with a fresh install and put pulseaudio on hold before doing any updates, and wait until a update from pulseaudio gets thru the system.
My C2 is used 100% with kodi, so I'll let the patch/fix get well tested on kodi first.
Richard
BR
Richard G8JVM

Molorius
Posts: 62
Joined: Tue Mar 01, 2016 4:40 am
languages_spoken: English
ODROIDs: C1+, C2, GO
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by Molorius » Wed Mar 13, 2019 1:26 am

The problem is fixed later in the mainline pulseaudio: https://gitlab.freedesktop.org/pulseaud ... 4808d3e779. But Ubuntu can be slow to move to newer versions, the most recent Ubuntu update to the file was from a commit in September 2017. The fix is from June 2018.

Molorius
Posts: 62
Joined: Tue Mar 01, 2016 4:40 am
languages_spoken: English
ODROIDs: C1+, C2, GO
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by Molorius » Wed Mar 13, 2019 1:28 am

Mono sound through HDMI is broken right now anyway, is there some way to disable that through the kernel?

richard-g8jvm
Posts: 411
Joined: Sun Jan 18, 2015 1:27 am
languages_spoken: english
ODROIDs: C1+ C2, XU4
Location: Telford UK
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by richard-g8jvm » Wed Mar 13, 2019 1:43 am

I tried to build pulse12, but init-tools is way too old .
I use linux Mint on the other computers, and one uses HDMI for audio out, so I'd better put a version hold on that as well, as that also uses
ubuntu 18.04 libs etc.
Do you know which version has the fix ?
BR
Richard G8JVM

Molorius
Posts: 62
Joined: Tue Mar 01, 2016 4:40 am
languages_spoken: English
ODROIDs: C1+, C2, GO
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by Molorius » Wed Mar 13, 2019 2:51 am

I disabled the mono channel in the kernel and now it works fine. Even though the mono hdmi channel is currently broken, I'm not sure that a kernel patch should be applied to fix a package bug....
@odroid do you think a kernel patch should be pushed as a fix?

The kernel can be patched to remove mono hdmi (then the new pulseaudio will enable stereo as a fallback) by changing sound/soc/aml/m8/aml_spdif_codec.c line 41 from ".channels_min = 1," to ".channels_min = 2,". I can make a pull request if it's agreed that this is a useful patch.

User avatar
odroid
Site Admin
Posts: 32677
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 209 times
Been thanked: 364 times
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by odroid » Wed Mar 13, 2019 8:45 am

@Molorius,
I fully agree. Please make a PR.

Molorius
Posts: 62
Joined: Tue Mar 01, 2016 4:40 am
languages_spoken: English
ODROIDs: C1+, C2, GO
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by Molorius » Wed Mar 13, 2019 11:47 am

@odroid I made the pull request.

User avatar
odroid
Site Admin
Posts: 32677
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 209 times
Been thanked: 364 times
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by odroid » Wed Mar 13, 2019 12:14 pm

Thank you for the PR.
We will check any possible side effects and merge it.
Kernel update package will be released by end of this week or sooner.

Edit:
It was merged and released with Kernel 3.16.63-38 package.
https://github.com/hardkernel/linux/com ... 5876403f91

Molorius
Posts: 62
Joined: Tue Mar 01, 2016 4:40 am
languages_spoken: English
ODROIDs: C1+, C2, GO
Has thanked: 0
Been thanked: 0
Contact:

Re: Pulseaudio Distorts HDMI Audio

Unread post by Molorius » Tue Mar 19, 2019 6:11 am

That is my first accepted pull request into a kernel, whoot.

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 1 guest