pulseaudio print lots of error when selecting unavailable profile

Bug #1750947 reported by Hui Wang on 2018-02-22
58
This bug affects 25 people
Affects Status Importance Assigned to Milestone
HWE Next
Critical
Unassigned
pulseaudio (Ubuntu)
Critical
Unassigned
Xenial
Undecided
Unassigned

Bug Description

SRU Document:

[Impact]

A HDMI audio device usually has several output ports, each port represents a profile in pulseaudio, without this patch, the puseaudio always choose the first profile no matter it is active or not.

[Test Case]

connect each port of HDMI device, and check if the profile of that port is active or not.

[Regression Potential]

The patch will check all ports under each profile, if a profile only contains unavailable ports, this profile will be set to unavailable as well. Without this patch, all profiles are always available, then if a profile includes a unusable hdmi-output, and pulseaudio select this profile to be active (since its priority is the highest), the kernel audio driver will crash.

I think this patch will not introduce regression:
1) It is a correct logic to set a profile to be unavailable if it only contains unavailable ports.
2) pulseaudio-artful and pulseaudio-bionic already include this patch, they work very well
3) I tested this patch on 1 lenovo laptop, 1 lenovo desktop, 1 dell laptop and 1 dell desktop, all worked well as before
4) tested this patch on two dell machines (LOAD5-DVT2-A2 and Dawson-JC-C without analogue audio) which have unusable hdmi-output profile on them, the kernel driver did not crash anymore and audio function worked very well.

[Other Info]

Only pulseaudio-xenial has this problem.

we need to backport this commit to pulseaudio-xenial.

https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=a222a07920731f3c4967faccab7469af50b428a4

After printing out the error logs, the kernel crashes and system hangs.

Hui Wang (hui.wang) on 2018-02-22
Changed in pulseaudio (Ubuntu):
importance: Undecided → Critical
tags: added: originate-from-1737727 somerville
Changed in hwe-next:
importance: Undecided → Critical
Daniel van Vugt (vanvugt) wrote :

If this is a crash then it's very likely we already have a bug report for it.

Can you find a stack trace of the crash?

Changed in pulseaudio (Ubuntu):
status: New → Incomplete
Hui Wang (hui.wang) wrote :

E: [alsa-sink-HDMI 0] alsa-util.c: snd_pcm_avail() returned a value that is exceptionally large: 26649288 bytes (151073 ms).
E: [alsa-sink-HDMI 0] alsa-util.c: Most likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers.
E: [alsa-sink-HDMI 0] alsa-util.c: snd_pcm_dump():
E: [alsa-sink-HDMI 0] alsa-util.c: Hooks PCM
E: [alsa-sink-HDMI 0] alsa-util.c: Its setup is:
...
E: [alsa-sink-HDMI 0] alsa-util.c: Slave: Hardware PCM card 0 'HD-Audio Generic' device 3 subdevice 0
E: [alsa-sink-HDMI 0] alsa-util.c: Its setup is:
...
E: [alsa-sink-HDMI 0] alsa-util.c: snd_pcm_delay() returned a value that is exceptionally large: -25928392 bytes (-146986 ms).
E: [alsa-sink-HDMI 0] alsa-util.c: Most likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers.
E: [alsa-sink-HDMI 0] alsa-util.c: snd_pcm_dump():
E: [alsa-sink-HDMI 0] alsa-util.c: Hooks PCM
E: [alsa-sink-HDMI 0] alsa-util.c: Its setup is:
...
E: [alsa-sink-HDMI 0] alsa-util.c: Slave: Hardware PCM card 0 'HD-Audio Generic' device 3 subdevice 0
E: [alsa-sink-HDMI 0] alsa-util.c: Its setup is:
...

summary: - pulseaudio crashed when selecting unavailable profile
+ pulseaudio print lots of error when selecting unavailable profile
description: updated
Hui Wang (hui.wang) wrote :

[ 800.271277] Freezing user space processes ...
[ 820.267656] Freezing of tasks failed after 20.006 seconds (1 tasks refusing to freeze, wq_busy=0):
[ 820.267704] alsa-sink-HDMI D 0 1554 1117 0x00000004
[ 820.267710] Call Trace:
[ 820.267723] __schedule+0x3c2/0x8b0
[ 820.267727] schedule+0x36/0x80
[ 820.267730] schedule_timeout+0x17a/0x360
[ 820.267735] ? call_timer_fn+0x140/0x140
[ 820.267745] snd_power_wait+0xba/0x110 [snd]
[ 820.267751] ? snd_power_wait+0xba/0x110 [snd]
[ 820.267756] ? wake_up_q+0x70/0x70
[ 820.267766] snd_pcm_common_ioctl1+0x41/0x930 [snd_pcm]
[ 820.267772] snd_pcm_playback_ioctl1+0x13e/0x250 [snd_pcm]
[ 820.267777] ? eventfd_ctx_read+0x67/0x210
[ 820.267784] snd_pcm_playback_ioctl+0x28/0x40 [snd_pcm]
[ 820.267789] do_vfs_ioctl+0xa1/0x5f0
[ 820.267792] SyS_ioctl+0x79/0x90
[ 820.267796] entry_SYSCALL_64_fastpath+0x1e/0xa9
[ 820.267798] RIP: 0033:0x7fb4d9bbdf07
[ 820.267800] RSP: 002b:00007fb4d5d3cc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 820.267803] RAX: ffffffffffffffda RBX: 00007fb4d5d3cca0 RCX: 00007fb4d9bbdf07
[ 820.267805] RDX: 0000000001888d20 RSI: 0000000000004122 RDI: 0000000000000016
[ 820.267807] RBP: 0000000001888d20 R08: 0000000000000043 R09: 0000000000000001
[ 820.267808] R10: 000000000185f870 R11: 0000000000000246 R12: 0000000001888d20
[ 820.267810] R13: 0000000000000000 R14: 00007fb4d5d3a650 R15: 0000000000615080
[ 820.267837] OOM killer enabled.
[ 820.267838] Restarting tasks ... done.

Daniel van Vugt (vanvugt) wrote :

Sorry, I missed the part about the crashes being in the kernel.

Still, part of the above sounds like bug 1274115.

Changed in pulseaudio (Ubuntu):
status: Incomplete → Fix Released
assignee: Hui Wang (hui.wang) → nobody
Daniel van Vugt (vanvugt) wrote :

Commit a222a07920731f3c4967faccab7469af50b428a4 is obviously a little old. So "Fix Released" for current series. Only needs some work to get it into xenial.

Hui Wang (hui.wang) wrote :

reply #5, yes, only xenial needs this commit because artful and bionic already had this commit.

Hui Wang (hui.wang) wrote :

@Daniel,

How about I cherry-pick that commit a222a07920 to ubuntu-xenial branch?

Daniel van Vugt (vanvugt) wrote :

Yes I think that's what we need.

Hui Wang (hui.wang) wrote :

OK, got it. thanks.

Hui Wang (hui.wang) wrote :

Already pushed the fix to ubuntu-xenial branch, and this is the debdiff against 3.8. If everything is ok, please trigger the SRU build.

thx.

Timo Aaltonen (tjaalton) wrote :

added a pointer to this bug and uploaded

Timo Aaltonen (tjaalton) wrote :

update the description to add the usual impact/test case/regression potential etc

Hui Wang (hui.wang) on 2018-03-08
description: updated
description: updated
Hui Wang (hui.wang) wrote :

This fixed the "missing LP bug number problem". Please help trigger the SRU build.

thx.

Robie Basak (racb) wrote :

> [Regression Potential]

> no regression possibility, since this commit is already in artful and bionic.

No. Please review https://wiki.ubuntu.com/StableReleaseUpdates#Why and https://wiki.ubuntu.com/StableReleaseUpdates#Procedure and update the bug description accordingly.

Hui Wang (hui.wang) wrote :

@Robie,

Updated [Regression Potential] as shown below:

The patch will check all ports under each profile, if a profile only contains unavailable ports, this profile will be set to unavailable as well. Without this patch, all profiles are always available, then if a profile includes a unusable hdmi-output, and pulseaudio choose this profile to be active (since its priority is the highest), the kernel audio driver will crash.

I think this patch will not introduce regression:
1) It is a correct logic to set a profile to be unavailable if it only contains unavailable ports.
2) pulseaudio-artful and pulseaudio-bionic already include this patch, they work very well
3) I tested this patch on 1 lenovo laptop, 1 lenovo desktop, 1 dell laptop and 1 dell desktop, all worked well as before
4) tested this patch on two dell machines (LOAD5-DVT2-A2 and Dawson-JC-C without analogue audio) which have unusable hdmi-output profile on them, the kernel driver did not crash anymore and audio function worked very well.

description: updated
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pulseaudio (Ubuntu Xenial):
status: New → Confirmed
Łukasz Zemczak (sil2100) wrote :

I will be accepting this upload, but for future reference: in the regression potential field please also include an assessment where possible regressions can appear. This should be mostly hypothetical, but think of this section as a hint for testers who'd like to know what to test to see if anything isn't broken. Also, this section should give us, the SRU team, a good understanding of how badly broken other things can get in the worst-case scenario if this upload gets approved. Usually this involves looking at the patch and checking which other use-cases it can effect and, in some bizarre circumstance, break those by accident.

Changed in pulseaudio (Ubuntu Xenial):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-xenial

Hello Hui, or anyone else affected,

Accepted pulseaudio into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pulseaudio/1:8.0-0ubuntu3.9 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Shih-Yuan Lee (fourdollars) wrote :

I have checked pulseaudio/1:8.0-0ubuntu3.9 on xenial and it does fix the problem.

tags: added: verification-done-xenial
removed: verification-needed-xenial
Hui Wang (hui.wang) on 2018-04-13
tags: added: verification-done
removed: verification-needed

The verification of the Stable Release Update for pulseaudio has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers