Bug 69676 - Assertion 'jack->path && jack->path->port' failed at modules/alsa/module-alsa-card.c:381, function report_jack_state()
Summary: Assertion 'jack->path && jack->path->port' failed at modules/alsa/module-alsa...
Status: RESOLVED FIXED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: alsa (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-22 14:05 UTC by Kalev Lember
Modified: 2014-01-10 11:19 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
alsa-info (11.09 KB, text/plain)
2013-09-22 14:06 UTC, Kalev Lember
Details
PA debug log (75.48 KB, text/plain)
2013-09-22 14:07 UTC, Kalev Lember
Details
backtrace (8.80 KB, text/plain)
2013-09-22 14:07 UTC, Kalev Lember
Details
more debug info (1.72 KB, patch)
2013-09-23 08:04 UTC, David Henningsson
Details | Splinter Review
more debug info (2.88 KB, patch)
2013-09-23 10:41 UTC, Kalev Lember
Details | Splinter Review
PA debug log 2 (77.31 KB, text/plain)
2013-09-23 10:42 UTC, Kalev Lember
Details
Drop unused paths (3.81 KB, text/plain)
2013-09-23 11:44 UTC, David Henningsson
Details

Description Kalev Lember 2013-09-22 14:05:59 UTC
Latest pulseaudio git master crashes here on startup with an assertion:

Assertion 'jack->path && jack->path->port' failed at modules/alsa/module-alsa-card.c:381, function report_jack_state(). Aborting.

This is a regression compared to 4.0 and I've bisected it to the following commit; reverting it fixes the crash for me:

commit ecf3ab2b5788c85c237eeb6429bd1d525b9ac0cc
Author: David Henningsson <david.henningsson@canonical.com>
Date:   Tue Jun 4 15:41:57 2013 +0200

    alsa-mixer: Add "Line Out" path
    
    If there is a "Line Out" jack present, then add this path. The fallback
    analog-output will be a subset of this path and removed.
    
    I only use the "Line Out Jack" or "Line Out Front Jack" for actual jack
    detection - without anything connected to the front jack, it makes little
    sense to enable the port.
    (Another option could perhaps be to use different paths for stereo line out
    and surround line outs, but that could be a possible future improvement.)
Comment 1 Kalev Lember 2013-09-22 14:06:39 UTC
Created attachment 86317 [details]
alsa-info
Comment 2 Kalev Lember 2013-09-22 14:07:31 UTC
Created attachment 86318 [details]
PA debug log
Comment 3 Kalev Lember 2013-09-22 14:07:59 UTC
Created attachment 86319 [details]
backtrace
Comment 4 Raymond 2013-09-23 05:37:14 UTC
the emulated hda codec does support Jack detection

DMI Information
!!---------------

Manufacturer:      Bochs
Product Name:      Bochs
Product Version:   
Firmware Version:  Bochs

Codec: Generic 1af4 ID 22
Address: 0
AFG Function Id: 0x1 (unsol 0)
Vendor Id: 0x1af40022
Subsystem Id: 0x1af40022
Revision Id: 0x100101




Node 0x03 [Pin Complex] wcaps 0x400101: Stereo
  Control: name="Line Out Phantom Jack", index=0, device=0
  Pincap 0x00000010: OUT
  Pin Default 0x00004010: [Jack] Line Out at Ext N/A
    Conn = Unknown, Color = Green
    DefAssociation = 0x1, Sequence = 0x0
  Pin-ctls: 0x40: OUT
  Connection: 1
     0x02


	control.5 {
		iface CARD
		name 'Line Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.6 {
		iface CARD
		name 'Line Out Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
Comment 5 David Henningsson 2013-09-23 08:04:08 UTC
Hi Kalev and thanks for testing, and the detailed bug report!

First, can you verify if it is jack->path or jack->path->port that fails, e g like this:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2013-September/018730.html

Assuming it's the latter (port) that fails, this port should have been added in add_profiles -> pa_alsa_path_set_add_ports -> device_port_alsa_init. I'm not exactly understanding why this does not happen.

Could you add some more instrumentation to this path, like in the attachment, and make a new PA debug log? Thanks!
Comment 6 David Henningsson 2013-09-23 08:04:39 UTC
Created attachment 86341 [details] [review]
more debug info
Comment 7 Kalev Lember 2013-09-23 10:40:12 UTC
(In reply to comment #5)
> Hi Kalev and thanks for testing, and the detailed bug report!

Thanks for looking at this, much appreciated!


> First, can you verify if it is jack->path or jack->path->port that fails, e
> g like this:
> http://lists.freedesktop.org/archives/pulseaudio-discuss/2013-September/
> 018730.html

It's the port, yes -- sorry, I should have mentioned that I printed out some of the struct members at the end of the attached backtrace log.


> Assuming it's the latter (port) that fails, this port should have been added
> in add_profiles -> pa_alsa_path_set_add_ports -> device_port_alsa_init. I'm
> not exactly understanding why this does not happen.
> 
> Could you add some more instrumentation to this path, like in the
> attachment, and make a new PA debug log? Thanks!

Done. I added a little bit more instrumentation there, attaching the diff as well for reference.
Comment 8 Kalev Lember 2013-09-23 10:41:58 UTC
Created attachment 86355 [details] [review]
more debug info
Comment 9 Kalev Lember 2013-09-23 10:42:39 UTC
Created attachment 86356 [details]
PA debug log 2
Comment 10 David Henningsson 2013-09-23 11:28:33 UTC
Thanks. I now saw the end of the backtrace, giving us a hint:

(gdb) p jack->path->name
$5 = 0x6f4740 "analog-output"

Analog output is removed (because analog-output-lineout is there), but it seems its jacks are somehow lingering around anyway.

Giving this a thought, I think the best thing to do is to remove that path a little more at the end of function "pa_alsa_profile_set_probe" where we also drop unsupported paths. This path is supported, but it's superfluous so it's dropped from the path set but not from the profile set.
Comment 11 David Henningsson 2013-09-23 11:44:42 UTC
Created attachment 86358 [details]
Drop unused paths

Could you check if this patch resolves your issue without causing any other issues? Thanks!
Comment 12 Kalev Lember 2013-09-23 11:56:37 UTC
(In reply to comment #11)
> Created attachment 86358 [details]
> Drop unused paths

I can confirm this fixes the crash and pulseaudio seems to work fine otherwise.

Thanks David!
Comment 13 Tanu Kaskinen 2014-01-10 11:19:48 UTC
The patch has been applied already a long time ago, marking bug as fixed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.