Re: [alsa-devel] [PATCH 0/4] More aggressive PM for HD-audio
At Thu, 26 Mar 2015 20:24:43 +0800, Hui Wang wrote:
[1 <text/plain; utf-8 (8bit)>] On 03/21/2015 02:38 PM, Hui Wang wrote:
On 03/21/2015 12:20 AM, David Henningsson wrote:
On 2015-03-18 09:50, Takashi Iwai wrote:
Hi,
here is a patchset for supporting more aggressive PM for HD-audio. This allows to change the power state of each widget more dynamically with jack and stream states. It's activated only when the codec driver (or via sysfs or f/w patch) sets codec->power_mgmt flag.
In theory, this should work for the recent Realtek codecs, but currently I have no machine for test.
David, could you or your team check whether this works for ALC282 or such? Just add like:
--- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -5415,6 +5415,7 @@ static int patch_alc269(struct hda_codec *codec)
spec = codec->spec; spec->gen.shared_mic_vref_pin = 0x18;
codec->power_mgmt = 1;
snd_hda_pick_fixup(codec, alc269_fixup_models, alc269_fixup_tbl, alc269_fixups);
The patchset is for for-next branch of sound git tree, but they might be applicable to 4.0-rc (or even older), too. The current patches are found in topic/hda-power branch.
So I hoped to be able to look at this today, but it turns out the machine I was thinking of using for testing has an ALC262 codec, which hardly counts as "new".
Hui, is this something you feel like taking on? Otherwise I'll try to talk to someone in Taipei.
OK, I will look for the machine to do the test next week.
Regards, Hui.
Sorry for late response, today is my first day in the office back from vacation, I checked all machines in the Beijing office, none of them has the ALC282 codec, I will continue to look for the machine from other office.
And I did the test on the machines with the alc283, alc255, alc292 and alc269, the testing result were same, there were no sound output from internal speaker or headphone, and the internal mic or external mic can't record any sound. The test steps as below:
- power_save_node = 0
checkout the hda-power branch, build the kernel based on this branch. Install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, works very well, plug a headset, test headphone and external mic, works very well. run pm_suspend, wait 5 seconds, wakeup the system, redo the above test, everything works very well.
OK, this is expected. The patch shouldn't touch this case.
- power_save_node = 1
enable the power_save_node as below: @@ -5426,6 +5426,8 @@ static int patch_alc269(struct hda_codec *codec)
alc_auto_parse_customize_define(codec);
codec->power_save_node = 1;
if (has_cdefine_beep(codec)) spec->gen.beep_nid = 0x01;
rebuild the kernel, install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, we can play sound to internal speaker without any errors, but I can't hear any sound from the speaker; I can use the internal mic to record without errors, but recorded file did not include any sound pcm (maybe all 0x00 or 0xff) I plug a headset into the headset jack, the detection works very well, but I can't hear sound from headphone when play a sound, and I can't use headset mic to record any sound as well.
And I attached 2 alsa-info.txt, one is the power_save_node=0, the other is the power_save_node=1
Thanks. The alsa-info.sh outputs show no difference but the power state, so the widget attributes seem kept with the power state change, as it seems.
Could you give alsa-info.sh output *during* playing with power_save_node=1?
Takashi
At Thu, 26 Mar 2015 14:10:17 +0100, Takashi Iwai wrote:
At Thu, 26 Mar 2015 20:24:43 +0800, Hui Wang wrote:
On 03/21/2015 02:38 PM, Hui Wang wrote:
On 03/21/2015 12:20 AM, David Henningsson wrote:
On 2015-03-18 09:50, Takashi Iwai wrote:
Hi,
here is a patchset for supporting more aggressive PM for HD-audio. This allows to change the power state of each widget more dynamically with jack and stream states. It's activated only when the codec driver (or via sysfs or f/w patch) sets codec->power_mgmt flag.
In theory, this should work for the recent Realtek codecs, but currently I have no machine for test.
David, could you or your team check whether this works for ALC282 or such? Just add like:
--- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -5415,6 +5415,7 @@ static int patch_alc269(struct hda_codec *codec)
spec = codec->spec; spec->gen.shared_mic_vref_pin = 0x18;
codec->power_mgmt = 1;
snd_hda_pick_fixup(codec, alc269_fixup_models, alc269_fixup_tbl, alc269_fixups);
The patchset is for for-next branch of sound git tree, but they might be applicable to 4.0-rc (or even older), too. The current patches are found in topic/hda-power branch.
So I hoped to be able to look at this today, but it turns out the machine I was thinking of using for testing has an ALC262 codec, which hardly counts as "new".
Hui, is this something you feel like taking on? Otherwise I'll try to talk to someone in Taipei.
OK, I will look for the machine to do the test next week.
Regards, Hui.
Sorry for late response, today is my first day in the office back from vacation, I checked all machines in the Beijing office, none of them has the ALC282 codec, I will continue to look for the machine from other office.
And I did the test on the machines with the alc283, alc255, alc292 and alc269, the testing result were same, there were no sound output from internal speaker or headphone, and the internal mic or external mic can't record any sound. The test steps as below:
- power_save_node = 0
checkout the hda-power branch, build the kernel based on this branch. Install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, works very well, plug a headset, test headphone and external mic, works very well. run pm_suspend, wait 5 seconds, wakeup the system, redo the above test, everything works very well.
OK, this is expected. The patch shouldn't touch this case.
- power_save_node = 1
enable the power_save_node as below: @@ -5426,6 +5426,8 @@ static int patch_alc269(struct hda_codec *codec)
alc_auto_parse_customize_define(codec);
codec->power_save_node = 1;
if (has_cdefine_beep(codec)) spec->gen.beep_nid = 0x01;
rebuild the kernel, install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, we can play sound to internal speaker without any errors, but I can't hear any sound from the speaker; I can use the internal mic to record without errors, but recorded file did not include any sound pcm (maybe all 0x00 or 0xff) I plug a headset into the headset jack, the detection works very well, but I can't hear sound from headphone when play a sound, and I can't use headset mic to record any sound as well.
And I attached 2 alsa-info.txt, one is the power_save_node=0, the other is the power_save_node=1
Thanks. The alsa-info.sh outputs show no difference but the power state, so the widget attributes seem kept with the power state change, as it seems.
Could you give alsa-info.sh output *during* playing with power_save_node=1?
Also, try to pull topic/hda-regmap branch in addition, and apply the patch below. This implements the partial sync for the widget path. Note that the patch is totally untested.
thanks,
Takashi
diff --git a/include/sound/hda_regmap.h b/include/sound/hda_regmap.h index 76648ccfbbf8..727a5801e298 100644 --- a/include/sound/hda_regmap.h +++ b/include/sound/hda_regmap.h @@ -202,4 +202,16 @@ snd_hdac_regmap_update_amp_stereo(struct hdac_device *codec, hda_nid_t nid, return snd_hdac_regmap_update_raw(codec, cmd, mask, val); }
+/** + * snd_hdac_regmap_sync_node - sync the widget node attributes + * @codec: HD-audio codec + * @nid: NID to sync + */ +static inline void +snd_hdac_regmap_sync_node(struct hdac_device *codec, hda_nid_t nid) +{ + regcache_mark_dirty(codec->regmap); + regcache_sync_region(codec->regmap, nid << 20, ((nid + 1) << 20) -1); +} + #endif /* __SOUND_HDA_REGMAP_H */ diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index f7ccef5559de..1f2ca7be1468 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -842,10 +842,8 @@ static hda_nid_t path_power_update(struct hda_codec *codec, snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_POWER_STATE, state); changed = nid; - /* here we assume that widget attributes (e.g. amp, - * pinctl connection) don't change with local power - * state change. If not, need to sync the cache. - */ + if (state == AC_PWRST_D0) + snd_hdac_regmap_sync_node(&codec->core, nid); } } return changed;
On 03/26/2015 09:52 PM, Takashi Iwai wrote:
At Thu, 26 Mar 2015 14:10:17 +0100, Takashi Iwai wrote:
At Thu, 26 Mar 2015 20:24:43 +0800, Hui Wang wrote:
On 03/21/2015 02:38 PM, Hui Wang wrote:
On 03/21/2015 12:20 AM, David Henningsson wrote:
On 2015-03-18 09:50, Takashi Iwai wrote:
Hi,
here is a patchset for supporting more aggressive PM for HD-audio. This allows to change the power state of each widget more dynamically with jack and stream states. It's activated only when the codec driver (or via sysfs or f/w patch) sets codec->power_mgmt flag.
In theory, this should work for the recent Realtek codecs, but currently I have no machine for test.
David, could you or your team check whether this works for ALC282 or such? Just add like:
--- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -5415,6 +5415,7 @@ static int patch_alc269(struct hda_codec *codec)
spec = codec->spec; spec->gen.shared_mic_vref_pin = 0x18;
codec->power_mgmt = 1;
snd_hda_pick_fixup(codec, alc269_fixup_models, alc269_fixup_tbl, alc269_fixups);
The patchset is for for-next branch of sound git tree, but they might be applicable to 4.0-rc (or even older), too. The current patches are found in topic/hda-power branch.
So I hoped to be able to look at this today, but it turns out the machine I was thinking of using for testing has an ALC262 codec, which hardly counts as "new".
Hui, is this something you feel like taking on? Otherwise I'll try to talk to someone in Taipei.
OK, I will look for the machine to do the test next week.
Regards, Hui.
Sorry for late response, today is my first day in the office back from vacation, I checked all machines in the Beijing office, none of them has the ALC282 codec, I will continue to look for the machine from other office.
And I did the test on the machines with the alc283, alc255, alc292 and alc269, the testing result were same, there were no sound output from internal speaker or headphone, and the internal mic or external mic can't record any sound. The test steps as below:
- power_save_node = 0
checkout the hda-power branch, build the kernel based on this branch. Install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, works very well, plug a headset, test headphone and external mic, works very well. run pm_suspend, wait 5 seconds, wakeup the system, redo the above test, everything works very well.
OK, this is expected. The patch shouldn't touch this case.
- power_save_node = 1
enable the power_save_node as below: @@ -5426,6 +5426,8 @@ static int patch_alc269(struct hda_codec *codec)
alc_auto_parse_customize_define(codec);
codec->power_save_node = 1;
if (has_cdefine_beep(codec)) spec->gen.beep_nid = 0x01;
rebuild the kernel, install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, we can play sound to internal speaker without any errors, but I can't hear any sound from the speaker; I can use the internal mic to record without errors, but recorded file did not include any sound pcm (maybe all 0x00 or 0xff) I plug a headset into the headset jack, the detection works very well, but I can't hear sound from headphone when play a sound, and I can't use headset mic to record any sound as well.
And I attached 2 alsa-info.txt, one is the power_save_node=0, the other is the power_save_node=1
Thanks. The alsa-info.sh outputs show no difference but the power state, so the widget attributes seem kept with the power state change, as it seems.
Could you give alsa-info.sh output *during* playing with power_save_node=1?
Also, try to pull topic/hda-regmap branch in addition, and apply the patch below. This implements the partial sync for the widget path. Note that the patch is totally untested.
Got it, I will do the test next Monday, since I can't access those machines until next Monday.
Regards, Hui.
thanks,
Takashi
diff --git a/include/sound/hda_regmap.h b/include/sound/hda_regmap.h index 76648ccfbbf8..727a5801e298 100644 --- a/include/sound/hda_regmap.h +++ b/include/sound/hda_regmap.h @@ -202,4 +202,16 @@ snd_hdac_regmap_update_amp_stereo(struct hdac_device *codec, hda_nid_t nid, return snd_hdac_regmap_update_raw(codec, cmd, mask, val); }
+/**
- snd_hdac_regmap_sync_node - sync the widget node attributes
- @codec: HD-audio codec
- @nid: NID to sync
- */
+static inline void +snd_hdac_regmap_sync_node(struct hdac_device *codec, hda_nid_t nid) +{
- regcache_mark_dirty(codec->regmap);
- regcache_sync_region(codec->regmap, nid << 20, ((nid + 1) << 20) -1);
+}
- #endif /* __SOUND_HDA_REGMAP_H */
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index f7ccef5559de..1f2ca7be1468 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -842,10 +842,8 @@ static hda_nid_t path_power_update(struct hda_codec *codec, snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_POWER_STATE, state); changed = nid;
/* here we assume that widget attributes (e.g. amp,
* pinctl connection) don't change with local power
* state change. If not, need to sync the cache.
*/
if (state == AC_PWRST_D0)
} } return changed;snd_hdac_regmap_sync_node(&codec->core, nid);
On 2015年03月27日 08:11, Hui Wang wrote:
On 03/26/2015 09:52 PM, Takashi Iwai wrote:
At Thu, 26 Mar 2015 14:10:17 +0100, Takashi Iwai wrote:
At Thu, 26 Mar 2015 20:24:43 +0800, Hui Wang wrote:
On 03/21/2015 02:38 PM, Hui Wang wrote:
On 03/21/2015 12:20 AM, David Henningsson wrote:
On 2015-03-18 09:50, Takashi Iwai wrote: > Hi, > > here is a patchset for supporting more aggressive PM for HD-audio. > This allows to change the power state of each widget more > dynamically > with jack and stream states. It's activated only when the codec > driver (or via sysfs or f/w patch) sets codec->power_mgmt flag. > > In theory, this should work for the recent Realtek codecs, but > currently I have no machine for test. > > David, could you or your team check whether this works for > ALC282 or > such? Just add like: > > --- a/sound/pci/hda/patch_realtek.c > +++ b/sound/pci/hda/patch_realtek.c > @@ -5415,6 +5415,7 @@ static int patch_alc269(struct hda_codec > *codec) > > spec = codec->spec; > spec->gen.shared_mic_vref_pin = 0x18; > + codec->power_mgmt = 1; > > snd_hda_pick_fixup(codec, alc269_fixup_models, > alc269_fixup_tbl, alc269_fixups); > > > The patchset is for for-next branch of sound git tree, but they > might > be applicable to 4.0-rc (or even older), too. The current > patches are > found in topic/hda-power branch. So I hoped to be able to look at this today, but it turns out the machine I was thinking of using for testing has an ALC262 codec, which hardly counts as "new".
Hui, is this something you feel like taking on? Otherwise I'll try to talk to someone in Taipei.
OK, I will look for the machine to do the test next week.
Regards, Hui.
Sorry for late response, today is my first day in the office back from vacation, I checked all machines in the Beijing office, none of them has the ALC282 codec, I will continue to look for the machine from other office.
And I did the test on the machines with the alc283, alc255, alc292 and alc269, the testing result were same, there were no sound output from internal speaker or headphone, and the internal mic or external mic can't record any sound. The test steps as below:
- power_save_node = 0
checkout the hda-power branch, build the kernel based on this branch. Install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, works very well, plug a headset, test headphone and external mic, works very well. run pm_suspend, wait 5 seconds, wakeup the system, redo the above test, everything works very well.
OK, this is expected. The patch shouldn't touch this case.
- power_save_node = 1
enable the power_save_node as below: @@ -5426,6 +5426,8 @@ static int patch_alc269(struct hda_codec *codec)
alc_auto_parse_customize_define(codec);
codec->power_save_node = 1;
if (has_cdefine_beep(codec)) spec->gen.beep_nid = 0x01;
rebuild the kernel, install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, we can play sound to internal speaker without any errors, but I can't hear any sound from the speaker; I can use the internal mic to record without errors, but recorded file did not include any sound pcm (maybe all 0x00 or 0xff) I plug a headset into the headset jack, the detection works very well, but I can't hear sound from headphone when play a sound, and I can't use headset mic to record any sound as well.
And I attached 2 alsa-info.txt, one is the power_save_node=0, the other is the power_save_node=1
Thanks. The alsa-info.sh outputs show no difference but the power state, so the widget attributes seem kept with the power state change, as it seems.
Could you give alsa-info.sh output *during* playing with power_save_node=1?
Also, try to pull topic/hda-regmap branch in addition, and apply the patch below. This implements the partial sync for the widget path. Note that the patch is totally untested.
Got it, I will do the test next Monday, since I can't access those machines until next Monday.
Regards, Hui.
The attached alsa-info.txt was generated when the aplay was playing a song, it seems the widget power state did not change even the output device was working.
And I also checkout the hda-regmap branch and applied the patch below, rebuilt the kernel and used the kernel to do the test of playing and recording, both internal devices and external devices worked very well, I didn't see any obvious problems when using hda-regmap branch doing the test.
Regards, Hui.
thanks,
Takashi
diff --git a/include/sound/hda_regmap.h b/include/sound/hda_regmap.h index 76648ccfbbf8..727a5801e298 100644 --- a/include/sound/hda_regmap.h +++ b/include/sound/hda_regmap.h @@ -202,4 +202,16 @@ snd_hdac_regmap_update_amp_stereo(struct hdac_device *codec, hda_nid_t nid, return snd_hdac_regmap_update_raw(codec, cmd, mask, val); } +/**
- snd_hdac_regmap_sync_node - sync the widget node attributes
- @codec: HD-audio codec
- @nid: NID to sync
- */
+static inline void +snd_hdac_regmap_sync_node(struct hdac_device *codec, hda_nid_t nid) +{
- regcache_mark_dirty(codec->regmap);
- regcache_sync_region(codec->regmap, nid << 20, ((nid + 1) << 20)
-1); +}
- #endif /* __SOUND_HDA_REGMAP_H */
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index f7ccef5559de..1f2ca7be1468 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -842,10 +842,8 @@ static hda_nid_t path_power_update(struct hda_codec *codec, snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_POWER_STATE, state); changed = nid;
/* here we assume that widget attributes (e.g. amp,
* pinctl connection) don't change with local power
* state change. If not, need to sync the cache.
*/
if (state == AC_PWRST_D0)
snd_hdac_regmap_sync_node(&codec->core, nid); } } return changed;
Hi,
sorry for the late reply, now I'm back from vacation.
At Mon, 30 Mar 2015 14:53:37 +0800, hwang4 wrote:
On 2015年03月27日 08:11, Hui Wang wrote:
On 03/26/2015 09:52 PM, Takashi Iwai wrote:
At Thu, 26 Mar 2015 14:10:17 +0100, Takashi Iwai wrote:
At Thu, 26 Mar 2015 20:24:43 +0800, Hui Wang wrote:
On 03/21/2015 02:38 PM, Hui Wang wrote:
On 03/21/2015 12:20 AM, David Henningsson wrote: > On 2015-03-18 09:50, Takashi Iwai wrote: >> Hi, >> >> here is a patchset for supporting more aggressive PM for HD-audio. >> This allows to change the power state of each widget more >> dynamically >> with jack and stream states. It's activated only when the codec >> driver (or via sysfs or f/w patch) sets codec->power_mgmt flag. >> >> In theory, this should work for the recent Realtek codecs, but >> currently I have no machine for test. >> >> David, could you or your team check whether this works for >> ALC282 or >> such? Just add like: >> >> --- a/sound/pci/hda/patch_realtek.c >> +++ b/sound/pci/hda/patch_realtek.c >> @@ -5415,6 +5415,7 @@ static int patch_alc269(struct hda_codec >> *codec) >> >> spec = codec->spec; >> spec->gen.shared_mic_vref_pin = 0x18; >> + codec->power_mgmt = 1; >> >> snd_hda_pick_fixup(codec, alc269_fixup_models, >> alc269_fixup_tbl, alc269_fixups); >> >> >> The patchset is for for-next branch of sound git tree, but they >> might >> be applicable to 4.0-rc (or even older), too. The current >> patches are >> found in topic/hda-power branch. > So I hoped to be able to look at this today, but it turns out the > machine I was thinking of using for testing has an ALC262 codec, > which hardly counts as "new". > > Hui, is this something you feel like taking on? Otherwise I'll > try to > talk to someone in Taipei. > OK, I will look for the machine to do the test next week.
Regards, Hui.
Sorry for late response, today is my first day in the office back from vacation, I checked all machines in the Beijing office, none of them has the ALC282 codec, I will continue to look for the machine from other office.
And I did the test on the machines with the alc283, alc255, alc292 and alc269, the testing result were same, there were no sound output from internal speaker or headphone, and the internal mic or external mic can't record any sound. The test steps as below:
- power_save_node = 0
checkout the hda-power branch, build the kernel based on this branch. Install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, works very well, plug a headset, test headphone and external mic, works very well. run pm_suspend, wait 5 seconds, wakeup the system, redo the above test, everything works very well.
OK, this is expected. The patch shouldn't touch this case.
- power_save_node = 1
enable the power_save_node as below: @@ -5426,6 +5426,8 @@ static int patch_alc269(struct hda_codec *codec)
alc_auto_parse_customize_define(codec);
codec->power_save_node = 1;
if (has_cdefine_beep(codec)) spec->gen.beep_nid = 0x01;
rebuild the kernel, install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, we can play sound to internal speaker without any errors, but I can't hear any sound from the speaker; I can use the internal mic to record without errors, but recorded file did not include any sound pcm (maybe all 0x00 or 0xff) I plug a headset into the headset jack, the detection works very well, but I can't hear sound from headphone when play a sound, and I can't use headset mic to record any sound as well.
And I attached 2 alsa-info.txt, one is the power_save_node=0, the other is the power_save_node=1
Thanks. The alsa-info.sh outputs show no difference but the power state, so the widget attributes seem kept with the power state change, as it seems.
Could you give alsa-info.sh output *during* playing with power_save_node=1?
Also, try to pull topic/hda-regmap branch in addition, and apply the patch below. This implements the partial sync for the widget path. Note that the patch is totally untested.
Got it, I will do the test next Monday, since I can't access those machines until next Monday.
Regards, Hui.
The attached alsa-info.txt was generated when the aplay was playing a song, it seems the widget power state did not change even the output device was working.
And I also checkout the hda-regmap branch and applied the patch below, rebuilt the kernel and used the kernel to do the test of playing and recording, both internal devices and external devices worked very well, I didn't see any obvious problems when using hda-regmap branch doing the test.
Great! I merged the branch now and enabled the widget power saving for Realtek codecs.
Takashi
On 2015年03月30日 14:53, hwang4 wrote:
On 2015年03月27日 08:11, Hui Wang wrote:
On 03/26/2015 09:52 PM, Takashi Iwai wrote:
At Thu, 26 Mar 2015 14:10:17 +0100, Takashi Iwai wrote:
At Thu, 26 Mar 2015 20:24:43 +0800, Hui Wang wrote:
On 03/21/2015 02:38 PM, Hui Wang wrote:
On 03/21/2015 12:20 AM, David Henningsson wrote: > On 2015-03-18 09:50, Takashi Iwai wrote: >> Hi, >> >> here is a patchset for supporting more aggressive PM for HD-audio. >> This allows to change the power state of each widget more >> dynamically >> with jack and stream states. It's activated only when the codec >> driver (or via sysfs or f/w patch) sets codec->power_mgmt flag. >> >> In theory, this should work for the recent Realtek codecs, but >> currently I have no machine for test. >> >> David, could you or your team check whether this works for >> ALC282 or >> such? Just add like: >> >> --- a/sound/pci/hda/patch_realtek.c >> +++ b/sound/pci/hda/patch_realtek.c >> @@ -5415,6 +5415,7 @@ static int patch_alc269(struct hda_codec >> *codec) >> >> spec = codec->spec; >> spec->gen.shared_mic_vref_pin = 0x18; >> + codec->power_mgmt = 1; >> >> snd_hda_pick_fixup(codec, alc269_fixup_models, >> alc269_fixup_tbl, alc269_fixups); >> >> >> The patchset is for for-next branch of sound git tree, but they >> might >> be applicable to 4.0-rc (or even older), too. The current >> patches are >> found in topic/hda-power branch. > So I hoped to be able to look at this today, but it turns out the > machine I was thinking of using for testing has an ALC262 codec, > which hardly counts as "new". > > Hui, is this something you feel like taking on? Otherwise I'll > try to > talk to someone in Taipei. > OK, I will look for the machine to do the test next week.
Regards, Hui.
Sorry for late response, today is my first day in the office back from vacation, I checked all machines in the Beijing office, none of them has the ALC282 codec, I will continue to look for the machine from other office.
And I did the test on the machines with the alc283, alc255, alc292 and alc269, the testing result were same, there were no sound output from internal speaker or headphone, and the internal mic or external mic can't record any sound. The test steps as below:
- power_save_node = 0
checkout the hda-power branch, build the kernel based on this branch. Install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, works very well, plug a headset, test headphone and external mic, works very well. run pm_suspend, wait 5 seconds, wakeup the system, redo the above test, everything works very well.
OK, this is expected. The patch shouldn't touch this case.
- power_save_node = 1
enable the power_save_node as below: @@ -5426,6 +5426,8 @@ static int patch_alc269(struct hda_codec *codec)
alc_auto_parse_customize_define(codec);
codec->power_save_node = 1;
if (has_cdefine_beep(codec)) spec->gen.beep_nid = 0x01;
rebuild the kernel, install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, we can play sound to internal speaker without any errors, but I can't hear any sound from the speaker; I can use the internal mic to record without errors, but recorded file did not include any sound pcm (maybe all 0x00 or 0xff) I plug a headset into the headset jack, the detection works very well, but I can't hear sound from headphone when play a sound, and I can't use headset mic to record any sound as well.
And I attached 2 alsa-info.txt, one is the power_save_node=0, the other is the power_save_node=1
Thanks. The alsa-info.sh outputs show no difference but the power state, so the widget attributes seem kept with the power state change, as it seems.
Could you give alsa-info.sh output *during* playing with power_save_node=1?
Also, try to pull topic/hda-regmap branch in addition, and apply the patch below. This implements the partial sync for the widget path. Note that the patch is totally untested.
Got it, I will do the test next Monday, since I can't access those machines until next Monday.
Regards, Hui.
The attached alsa-info.txt was generated when the aplay was playing a song, it seems the widget power state did not change even the output device was working.
And I also checkout the hda-regmap branch and applied the patch below, rebuilt the kernel and used the kernel to do the test of playing and recording, both internal devices and external devices worked very well, I didn't see any obvious problems when using hda-regmap branch doing the test.
Regards, Hui.
Hi Takashi,
Probably I didn't express correctly, sorry to make you mis-understand. I wanted to express that I tested hda-power and hda-regmap two branches respectively, the hda-regmap branch with your patch worked very well, but the hda-power branch didn't work on the machines with realtek codec, the nodes kept in the D3 power state no matter playing or not.
It seems you enabled the power_save_node for realtek codec several days ago, it makes the HDA drivers fail to work on all machines with realtek codec.
Regards, Hui.
At Thu, 09 Apr 2015 14:54:17 +0800, hwang4 wrote:
On 2015年03月30日 14:53, hwang4 wrote:
On 2015年03月27日 08:11, Hui Wang wrote:
On 03/26/2015 09:52 PM, Takashi Iwai wrote:
At Thu, 26 Mar 2015 14:10:17 +0100, Takashi Iwai wrote:
At Thu, 26 Mar 2015 20:24:43 +0800, Hui Wang wrote:
On 03/21/2015 02:38 PM, Hui Wang wrote: > On 03/21/2015 12:20 AM, David Henningsson wrote: >> On 2015-03-18 09:50, Takashi Iwai wrote: >>> Hi, >>> >>> here is a patchset for supporting more aggressive PM for HD-audio. >>> This allows to change the power state of each widget more >>> dynamically >>> with jack and stream states. It's activated only when the codec >>> driver (or via sysfs or f/w patch) sets codec->power_mgmt flag. >>> >>> In theory, this should work for the recent Realtek codecs, but >>> currently I have no machine for test. >>> >>> David, could you or your team check whether this works for >>> ALC282 or >>> such? Just add like: >>> >>> --- a/sound/pci/hda/patch_realtek.c >>> +++ b/sound/pci/hda/patch_realtek.c >>> @@ -5415,6 +5415,7 @@ static int patch_alc269(struct hda_codec >>> *codec) >>> >>> spec = codec->spec; >>> spec->gen.shared_mic_vref_pin = 0x18; >>> + codec->power_mgmt = 1; >>> >>> snd_hda_pick_fixup(codec, alc269_fixup_models, >>> alc269_fixup_tbl, alc269_fixups); >>> >>> >>> The patchset is for for-next branch of sound git tree, but they >>> might >>> be applicable to 4.0-rc (or even older), too. The current >>> patches are >>> found in topic/hda-power branch. >> So I hoped to be able to look at this today, but it turns out the >> machine I was thinking of using for testing has an ALC262 codec, >> which hardly counts as "new". >> >> Hui, is this something you feel like taking on? Otherwise I'll >> try to >> talk to someone in Taipei. >> > OK, I will look for the machine to do the test next week. > > Regards, > Hui. > Sorry for late response, today is my first day in the office back from vacation, I checked all machines in the Beijing office, none of them has the ALC282 codec, I will continue to look for the machine from other office.
And I did the test on the machines with the alc283, alc255, alc292 and alc269, the testing result were same, there were no sound output from internal speaker or headphone, and the internal mic or external mic can't record any sound. The test steps as below:
- power_save_node = 0
checkout the hda-power branch, build the kernel based on this branch. Install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, works very well, plug a headset, test headphone and external mic, works very well. run pm_suspend, wait 5 seconds, wakeup the system, redo the above test, everything works very well.
OK, this is expected. The patch shouldn't touch this case.
- power_save_node = 1
enable the power_save_node as below: @@ -5426,6 +5426,8 @@ static int patch_alc269(struct hda_codec *codec)
alc_auto_parse_customize_define(codec);
codec->power_save_node = 1;
if (has_cdefine_beep(codec)) spec->gen.beep_nid = 0x01;
rebuild the kernel, install the kernel to the above machines and boot into the desktop test internal speaker and internal mic, we can play sound to internal speaker without any errors, but I can't hear any sound from the speaker; I can use the internal mic to record without errors, but recorded file did not include any sound pcm (maybe all 0x00 or 0xff) I plug a headset into the headset jack, the detection works very well, but I can't hear sound from headphone when play a sound, and I can't use headset mic to record any sound as well.
And I attached 2 alsa-info.txt, one is the power_save_node=0, the other is the power_save_node=1
Thanks. The alsa-info.sh outputs show no difference but the power state, so the widget attributes seem kept with the power state change, as it seems.
Could you give alsa-info.sh output *during* playing with power_save_node=1?
Also, try to pull topic/hda-regmap branch in addition, and apply the patch below. This implements the partial sync for the widget path. Note that the patch is totally untested.
Got it, I will do the test next Monday, since I can't access those machines until next Monday.
Regards, Hui.
The attached alsa-info.txt was generated when the aplay was playing a song, it seems the widget power state did not change even the output device was working.
And I also checkout the hda-regmap branch and applied the patch below, rebuilt the kernel and used the kernel to do the test of playing and recording, both internal devices and external devices worked very well, I didn't see any obvious problems when using hda-regmap branch doing the test.
Regards, Hui.
Hi Takashi,
Probably I didn't express correctly, sorry to make you mis-understand. I wanted to express that I tested hda-power and hda-regmap two branches respectively, the hda-regmap branch with your patch worked very well, but the hda-power branch didn't work on the machines with realtek codec, the nodes kept in the D3 power state no matter playing or not.
It seems you enabled the power_save_node for realtek codec several days ago, it makes the HDA drivers fail to work on all machines with realtek codec.
Ah, OK. Then we should revert the commit later.
But let's continue debugging a bit. Could you give alsa-info.sh outputs on both working and non-working states?
Takashi
On 2015-04-09 08:56, Takashi Iwai wrote:
Ah, OK. Then we should revert the commit later.
But let's continue debugging a bit. Could you give alsa-info.sh outputs on both working and non-working states?
Just running hda-emu with a realtek codec, e g codecs/canonical/alc292-dell-latitude-e5440-ccert-201307-13941 turns all nodes, including the internal speaker, into D3. And running a playback test does not switch things into D0 - even the DAC node remains in D3 even though you try to stream to it, which seems a bit strange.
Could you explain how this is supposed to work?
At Thu, 09 Apr 2015 08:59:17 +0200, David Henningsson wrote:
On 2015-04-09 08:56, Takashi Iwai wrote:
Ah, OK. Then we should revert the commit later.
But let's continue debugging a bit. Could you give alsa-info.sh outputs on both working and non-working states?
Just running hda-emu with a realtek codec, e g codecs/canonical/alc292-dell-latitude-e5440-ccert-201307-13941 turns all nodes, including the internal speaker, into D3. And running a playback test does not switch things into D0 - even the DAC node remains in D3 even though you try to stream to it, which seems a bit strange.
Could you explain how this is supposed to work?
Doh, it was the missing stream_pm ops setup. Also I found a few other minor issues. I'm going to submit a fix patch series now.
thanks
Takashi
participants (4)
-
David Henningsson
-
Hui Wang
-
hwang4
-
Takashi Iwai