Skip to contentSkip to conversation

No sound and systemd journal filling when inserting headphones when power-saving is enabled

DISCUSSION Dang Sananikone 2 participants 6 messages Feb 23, 2015 – Feb 26, 2015 2 messages not in the archive Sound

lore
Share & tools
lore
#0 lore raw

Hi,

I previously posted in alsa user mailing list about a problem I was facing with having no sound and the systemd journal filling when using headphones:

    http://article.gmane.org/gmane.linux.alsa.user/38948

I subsequently realised that I had enabled power-saving a few weeks ago and it was this power-saving that was causing the problem. My response to myself is here:

    http://article.gmane.org/gmane.linux.alsa.user/38953

I am now satisfied that disabling power-saving has resolved my issue, but there has been a suggestion that I report this issue, so here it is. Apologies if this is the wrong place (this is my first time on the alsa mailing list).

Let me know if you want me to create a bug ticket and where it should be created (the bug tracker URL link in the alsa project page is not working).

#1 lore raw

At Mon, 23 Feb 2015 20:00:35 +0000 (UTC),

Quoted 12 lines · Dang Sananikone

Hi,

I previously posted in alsa user mailing list about a problem I was facing with having no sound and the systemd journal filling when using headphones:

    http://article.gmane.org/gmane.linux.alsa.user/38948

I subsequently realised that I had enabled power-saving a few weeks ago and it was this power-saving that was causing the problem. My response to myself is here:

Quoted 6 lines
    http://article.gmane.org/gmane.linux.alsa.user/38953

I am now satisfied that disabling power-saving has resolved my issue, but there has been a suggestion that I report this issue, so here it is. Apologies if this is the wrong place (this is my first time on the alsa mailing list).

Don't worry, here is the right place for such a bug report.

Quoted 3 lines

Let me know if you want me to create a bug ticket and where it should be created (the bug tracker URL link in the alsa project page is not working).

You can open a bug report on bugzilla.kernel.org, but also keep debugging in alsa-devel ML, too.

In general, get alsa-info.sh output (run it with --no-upload option) at both working and non-working states for comparison. This will give us a bit clearer light. Attach the generated files to bugzilla or post to ML.

thanks,

Takashi

#3 lore raw
In reply to a message not in the archive

At Tue, 24 Feb 2015 20:11:58 +0000,

Quoted 20 lines · Dang Sananikone

Thanks, in that case I'll simply attach the files to this post. There are two files:

* alsa-info-notworking.txt: This is the alsa info generated when
power-saving is enabled and after "speaker-test" has been invoked.
* alsa-info-working.txt: This is the alsa info generated when power-saving
is disabled and after "speaker-test" has been invoked.

To reproduce the problem:

Prerequisite:
Set "options snd_hda_intel power_save=1"

Instructions:
1. Boot up laptop.
2. Insert headphone socket into jack.
3. In terminal, type "speaker-test -c 2".

Quoted 4 lines

Expected Result:
The speaker-test program hangs, and the systemd journal starts filling up with "sound hdaudioC0D0: hda-codec: out of range cmd 0:1:716:ffffffff" messages.

OK, then try to pass power_save_controller=0 option to snd-hda-intel module. It might be that the controller gets screwed up by some reason by power-saving.

If this still doesn't help, we need more logs. Build the kernel with tracing support, and get the HD-audio verb traces as Documentation/sound/alsa/HD-Audio.txt, section Tracepoints.

Takashi

#5 lore raw
In reply to a message not in the archive

At Tue, 24 Feb 2015 22:26:32 +0000,

Quoted 36 lines · Dang Sananikone
Quoted 23 lines · Takashi Iwai

At Tue, 24 Feb 2015 20:11:58 +0000,

Quoted 7 lines · Dang Sananikone

Thanks, in that case I'll simply attach the files to this post. There are two files:

* alsa-info-notworking.txt: This is the alsa info generated when
power-saving is enabled and after "speaker-test" has been invoked.
* alsa-info-working.txt: This is the alsa info generated when

power-saving

Quoted 13 lines

is disabled and after "speaker-test" has been invoked.

To reproduce the problem:

Prerequisite:
Set "options snd_hda_intel power_save=1"

Instructions:
1. Boot up laptop.
2. Insert headphone socket into jack.
3. In terminal, type "speaker-test -c 2".

Quoted 9 lines
Quoted 4 lines

Expected Result:
The speaker-test program hangs, and the systemd journal starts filling up with "sound hdaudioC0D0: hda-codec: out of range cmd 0:1:716:ffffffff" messages.

OK, then try to pass power_save_controller=0 option to snd-hda-intel module. It might be that the controller gets screwed up by some reason by power-saving.

Quoted 5 lines

If I've understood you correctly I've set the following options: "options snd_hda_intel power_save=1 power_save_controller=0".

Then I've plugged in my headphones before invoking speaker-test. With no audio playing I hear a blip sound every second.

Every second? Is this equal with the length you specified to power_save option? i.e. if you pass power_save=10, the frequency of blip noise changes, too?

Quoted 3 lines

Then I invoke "speaker-test -c 2" and I hear the speaker test audio I expect to hear. The program does not hang. After killing the program and with no audio playing I hear the blip sound every second.

So, the problem was basically the HD-audio controller screwed up by the power-saving. BTW, didn't you see the same problem with the explicit suspend/resume (S3 and S4)? For testing it, try a bigger value in power_save so that you go to S3/S4 before the power save is triggered.

Quoted 8 lines
Quoted 7 lines

If this still doesn't help, we need more logs. Build the kernel with tracing support, and get the HD-audio verb traces as Documentation/sound/alsa/HD-Audio.txt, section Tracepoints.

Takashi

Quoted 6 lines

Going back to this setting I set out to get the HD-audio verbs to provide more information: "options snd_hda_intel power_save=1".

I've attached the trace file which was generated after following your instructions (I think the kernel already had tracing support enabled judging by the /proc/config.gz config parameters).

The trace already shows the bad read from the controller, so it's likely an issue in the HDA controller and/or communication.

In anyway, below is a patch to disable runtime PM of the controller again. It's equivalent as passing power_save_controller=1. Could you give it a test?

thanks,

Takashi

-- 8< --
From: Takashi Iwai <[email protected]>
Subject: [PATCH] ALSA: hda - Disable runtime PM for Panther Point again

This is essentially a partial revert of the commit [b1920c21102a:
'ALSA: hda - Enable runtime PM on Panther Point']. There was a bug report showing the HD-audio bus hang during runtime PM on HP Spectre XT.

---
 sound/pci/hda/hda_intel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_intel.c +1 -1
index 36d2f20db7a4..4ca3d5d02436 100644
@@ -1966,7 +1966,7 @@ static const struct pci_device_id azx_ids[] = {
 	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
 	/* Panther Point */
 	{ PCI_DEVICE(0x8086, 0x1e20),
-	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
+	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
 	/* Lynx Point */
 	{ PCI_DEVICE(0x8086, 0x8c20),
 	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
Signature · 1 line
2.3.0
#6 lore raw
Quoted 44 lines · Takashi Iwai

At Tue, 24 Feb 2015 22:26:32 +0000,

Quoted 7 lines · Dang Sananikone
Quoted 4 lines · Takashi Iwai

At Tue, 24 Feb 2015 20:11:58 +0000,

Quoted 2 lines · Dang Sananikone

Thanks, in that case I'll simply attach the files to this post.

There are

Quoted 14 lines
Quoted 14 lines
Quoted 5 lines

two files:

* alsa-info-notworking.txt: This is the alsa info generated when
power-saving is enabled and after "speaker-test" has been invoked.
* alsa-info-working.txt: This is the alsa info generated when

power-saving

Quoted 8 lines

is disabled and after "speaker-test" has been invoked.

To reproduce the problem:

Prerequisite:
Set "options snd_hda_intel power_save=1"

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Instructions:
1. Boot up laptop.
2. Insert headphone socket into jack.
3. In terminal, type "speaker-test -c 2".

Expected Result:
The speaker-test program hangs, and the systemd journal starts

filling up

Quoted 1 line
Quoted 1 line
Quoted 1 line

with "sound hdaudioC0D0: hda-codec: out of range cmd

0:1:716:ffffffff"

Quoted 10 lines
Quoted 6 lines
Quoted 1 line

messages.

OK, then try to pass power_save_controller=0 option to snd-hda-intel module. It might be that the controller gets screwed up by some reason by power-saving.

If I've understood you correctly I've set the following options: "options snd_hda_intel power_save=1 power_save_controller=0".

Quoted 7 lines
Quoted 2 lines

Then I've plugged in my headphones before invoking speaker-test. With no audio playing I hear a blip sound every second.

Every second? Is this equal with the length you specified to power_save option? i.e. if you pass power_save=10, the frequency of blip noise changes, too?

Yes, it is equal to the value specified in the power_save option. I changed power_save to 10 and the frequency changed to 10 seconds.

Quoted 5 lines
Quoted 4 lines

Then I invoke "speaker-test -c 2" and I hear the speaker test audio I expect to hear. The program does not hang. After killing the program and with no audio playing I hear the blip sound every second.

Quoted 7 lines

So, the problem was basically the HD-audio controller screwed up by the power-saving. BTW, didn't you see the same problem with the explicit suspend/resume (S3 and S4)? For testing it, try a bigger value in power_save so that you go to S3/S4 before the power save is triggered.

I set "options snd_hda_intel power_save=600", then performed the following actions:

* Reboot laptop.
* Invoke "speaker-test -c 2", and wait for audio to play.
* Enter suspend mode by calling "systemctl suspend" in another terminal
---> audio stops playing.
* Exit suspend mode ---> audio restarts playing.

So, the same problem does not exist when entering/exiting suspend state.

Quoted 15 lines
Quoted 8 lines
Quoted 7 lines

If this still doesn't help, we need more logs. Build the kernel with tracing support, and get the HD-audio verb traces as Documentation/sound/alsa/HD-Audio.txt, section Tracepoints.

Takashi

Quoted 6 lines

Going back to this setting I set out to get the HD-audio verbs to provide more information: "options snd_hda_intel power_save=1".

I've attached the trace file which was generated after following your instructions (I think the kernel already had tracing support enabled judging by the /proc/config.gz config parameters).

Quoted 9 lines

The trace already shows the bad read from the controller, so it's likely an issue in the HDA controller and/or communication.

In anyway, below is a patch to disable runtime PM of the controller again. It's equivalent as passing power_save_controller=1. Could you give it a test?

I set "options snd_hda_intel power_save=1", then built and installed the kernel with the patched file. Invoking "speaker-test -c 2" caused no program hang and the audio was what I expected. Upon stopping the program I could hear the periodic blip. Upon repeated test, sometimes there was a periodic blip, sometimes there wasn't.

Quoted 37 lines

thanks,

Takashi

-- 8< --
From: Takashi Iwai <[email protected]>
Subject: [PATCH] ALSA: hda - Disable runtime PM for Panther Point again

This is essentially a partial revert of the commit [b1920c21102a:
'ALSA: hda - Enable runtime PM on Panther Point']. There was a bug report showing the HD-audio bus hang during runtime PM on HP Spectre XT.

---
 sound/pci/hda/hda_intel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_intel.c +1 -2
index 36d2f20db7a4..4ca3d5d02436 100644
@@ -1966,7 +1966,7 @@ static const struct pci_device_id azx_ids[] = {
          .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
        /* Panther Point */
        { PCI_DEVICE(0x8086, 0x1e20),
-         .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
+         .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
        /* Lynx Point */
        { PCI_DEVICE(0x8086, 0x8c20),
          .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
--

2.3.0

#7 lore raw

At Wed, 25 Feb 2015 22:15:32 +0000,

Quoted 50 lines · Dang Sananikone
Quoted 47 lines · Takashi Iwai

At Tue, 24 Feb 2015 22:26:32 +0000,

Quoted 7 lines · Dang Sananikone
Quoted 4 lines · Takashi Iwai

At Tue, 24 Feb 2015 20:11:58 +0000,

Quoted 2 lines · Dang Sananikone

Thanks, in that case I'll simply attach the files to this post.

There are

Quoted 14 lines
Quoted 14 lines
Quoted 5 lines

two files:

* alsa-info-notworking.txt: This is the alsa info generated when
power-saving is enabled and after "speaker-test" has been invoked.
* alsa-info-working.txt: This is the alsa info generated when

power-saving

Quoted 8 lines

is disabled and after "speaker-test" has been invoked.

To reproduce the problem:

Prerequisite:
Set "options snd_hda_intel power_save=1"

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Instructions:
1. Boot up laptop.
2. Insert headphone socket into jack.
3. In terminal, type "speaker-test -c 2".

Expected Result:
The speaker-test program hangs, and the systemd journal starts

filling up

Quoted 1 line
Quoted 1 line
Quoted 1 line

with "sound hdaudioC0D0: hda-codec: out of range cmd

0:1:716:ffffffff"

Quoted 12 lines
Quoted 6 lines
Quoted 1 line

messages.

OK, then try to pass power_save_controller=0 option to snd-hda-intel module. It might be that the controller gets screwed up by some reason by power-saving.

If I've understood you correctly I've set the following options: "options snd_hda_intel power_save=1 power_save_controller=0".

Then I've plugged in my headphones before invoking speaker-test. With no audio playing I hear a blip sound every second.

Quoted 7 lines
Quoted 4 lines

Every second? Is this equal with the length you specified to power_save option? i.e. if you pass power_save=10, the frequency of blip noise changes, too?

Yes, it is equal to the value specified in the power_save option. I changed power_save to 10 and the frequency changed to 10 seconds.

OK, then this is some artifact by the codec power down. Maybe we can reduce it by tweaking something, e.g. skipping the pin shutdown or putting some longer delay at EAPD flip. But it's basically a different issue from the hang you reported.

Quoted 47 lines
Quoted 11 lines
Quoted 3 lines

Then I invoke "speaker-test -c 2" and I hear the speaker test audio I expect to hear. The program does not hang. After killing the program and with no audio playing I hear the blip sound every second.

So, the problem was basically the HD-audio controller screwed up by the power-saving. BTW, didn't you see the same problem with the explicit suspend/resume (S3 and S4)? For testing it, try a bigger value in power_save so that you go to S3/S4 before the power save is triggered.

I set "options snd_hda_intel power_save=600", then performed the following actions:

* Reboot laptop.
* Invoke "speaker-test -c 2", and wait for audio to play.
* Enter suspend mode by calling "systemctl suspend" in another terminal
---> audio stops playing.
* Exit suspend mode ---> audio restarts playing.

So, the same problem does not exist when entering/exiting suspend state.

Quoted 15 lines
Quoted 8 lines
Quoted 7 lines

If this still doesn't help, we need more logs. Build the kernel with tracing support, and get the HD-audio verb traces as Documentation/sound/alsa/HD-Audio.txt, section Tracepoints.

Takashi

Quoted 6 lines

Going back to this setting I set out to get the HD-audio verbs to provide more information: "options snd_hda_intel power_save=1".

I've attached the trace file which was generated after following your instructions (I think the kernel already had tracing support enabled judging by the /proc/config.gz config parameters).

Quoted 9 lines

The trace already shows the bad read from the controller, so it's likely an issue in the HDA controller and/or communication.

In anyway, below is a patch to disable runtime PM of the controller again. It's equivalent as passing power_save_controller=1. Could you give it a test?

Quoted 5 lines

I set "options snd_hda_intel power_save=1", then built and installed the kernel with the patched file. Invoking "speaker-test -c 2" caused no program hang and the audio was what I expected. Upon stopping the program I could hear the periodic blip. Upon repeated test, sometimes there was a periodic blip, sometimes there wasn't.

OK, I'll queue the patch.

Takashi