intel8x0 ACPI suspend/resume bug
Hi,
On my IBM X40, the sound outputs become crappy after a suspend/resume cycle. I am convinced that it's a gain value that goes wrong (but I could be wrong) as most of the time one side is not outputing sound anymore (only statics) but I can sometimes get this channel back by lowering its volume (so I think it's a kind of hardware protection that cuts the channel off if the gain is too high).
Anyway I wrote every details in my bug report:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=917
and I would really appreciate if someone could help me hunt this bug. I tried everything that came to my mind and don't know what to try now.
NOTE: The most recent alsa driver I tried is
alsa-driver-1.0.9rc4a.tar.bz2.
Thanks,
Christophe
Signature · 10 lines
Christophe Barb� <[email protected]> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
At Tue, 28 Jun 2005 11:06:39 -0400,
Quoted 11 lines · christophe barbe
Hi,
On my IBM X40, the sound outputs become crappy after a suspend/resume cycle. I am convinced that it's a gain value that goes wrong (but I could be wrong) as most of the time one side is not outputing sound anymore (only statics) but I can sometimes get this channel back by lowering its volume (so I think it's a kind of hardware protection that cuts the channel off if the gain is too high).
Quoted 7 lines
Anyway I wrote every details in my bug report:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=917and I would really appreciate if someone could help me hunt this bug. I tried everything that came to my mind and don't know what to try now.
NOTE: The most recent alsa driver I tried is
alsa-driver-1.0.9rc4a.tar.bz2.
First of all, use alsa-1.0.9b, just to be sure.
Then get the dump of /proc/asound/card0/codec97#*/* files before and after the suspend, and compare them.
Takashi
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Quoted 1 line · Takashi Iwai
First of all, use alsa-1.0.9b, just to be sure.
I will try it asap.
Quoted 2 lines
Then get the dump of /proc/asound/card0/codec97#*/* files before and after the suspend, and compare them.
I did this and the result is in the bug report. Let me quote myself:
I saved all proc files before and after a suspend/resume cycle and look at the diff:
In /proc/asound/card0/intel8x0
I have the following diff:
before: Global control : 0xc0000002
after: Global control : 0x00000002
/proc/asound/card0/pcm0p/sub0/[status,sw_params,hw_params] contains "closed" after while they have more content before but I suspect it's normal.
And the file /proc/asound/card0/pcm0p/sub0/info contains the same in both case except the value of subdevices_avail which is 0 before and 1 before.
Finally I have the following change in the registers:
before:
0:10 = 8989
0:12 = 9f9f
0:14 = 0000
0:16 = 9f9f
0:18 = 1010
0:1a = 0000
0:1c = 8080
...
0:76 = 2010
after:
0:10 = 8909
0:12 = 9f1f
0:14 = 0000
0:16 = 9f1f
0:18 = 1010
0:1a = 0000
0:1c = 8000
...
0:76 = 0010
I will try to figure out the meaning of the global control and the registers. The sound output was perfect before and crappy after (symmetric for once, but the more I increase the pcm volume the crappier it becomes until a certain point where I get only sound from the left channel).
For the control word, the meaning of the most significant c seems to be related to the s/dif output which is strange especially since I don't have a digital output AFAIK.
#define ICH_REG_GLOB_CNT 0x2c /* dword - global control */ #define ICH_PCM_SPDIF_MASK 0xc0000000 /* s/pdif pcm slot mask (ICH4) */
...
#define ICH_PCM_SPDIF_78 0x40000000 /* s/pdif pcm on slots 7&8 */ #define ICH_PCM_SPDIF_69 0x80000000 /* s/pdif pcm on slots 6&9 */
Thanks,
Christophe
Quoted 2 lines
Takashi
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
Quoted 4 lines · christophe barbe
Le mercredi 29 juin 2005 ?? 11:31 +0200, Takashi Iwai a ??crit :
Quoted 1 line
First of all, use alsa-1.0.9b, just to be sure.
I will try it asap.
Done with same results.
Quoted 8 lines
I saved all proc files before and after a suspend/resume cycle and look at the diff:
In
/proc/asound/card0/intel8x0
I have the following diff:
before: Global control :0xc0000002
after: Global control :0x00000002
Quoted 8 lines
/proc/asound/card0/pcm0p/sub0/[status,sw_params,hw_params] contains "closed" after while they have more content before but I suspect it's normal.
And the file/proc/asound/card0/pcm0p/sub0/infocontains the same in both case except the value ofsubdevices_availwhich is 0 before and 1 before.Finally I have the following change in the registers:
I downloaded the datasheet for Intel 82801DB which I think is what I have and found what I believe to be the registers of the file codec97#0/ac97#0-0+regs and found the following
Quoted 11 lines
before:
0:10 = 8989
0:12 = 9f9f
0:14 = 0000
0:16 = 9f9f
0:18 = 1010
0:1a = 0000
0:1c = 8080
...
0:76 = 2010
Quoted 2 lines
after:
0:10 = 8909
Line in volume
Quoted 1 line
0:12 = 9f1f
CD volume
Quoted 2 lines
0:14 = 0000
0:16 = 9f1f
Aux in volume
Quoted 3 lines
0:18 = 1010
0:1a = 0000
0:1c = 8000
Record gain
Quoted 2 lines
...
0:76 = 0010
This one seems to be undocumented.
I have not yet find how the volume is encoded but I suspect it's two 8-bit words one for the left and one for the right which seems to match the fact that I usually loose the sound on one side. But all registers seems to be unrelated to mp3-to-pcm output.
Any idea for the register 76 ?
Christophe
Signature · 10 lines
Christophe Barbe <[email protected]> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Quoted 1 line · christophe barbe
I have not yet find how the volume is encoded but I suspect it's two 8-bit words one for the left and one for the right which seems to match the fact that I usually loose the sound on one side. But all registers seems to be unrelated to mp3-to-pcm output.
I found the description of the registers in the AC'97 spec and it says that the bit7 of the registers 10,12,16 and 1c should read 0 (as they are marked X in the table).
Is this correct?
Interestingly this bits read 1 before a suspend/resume cycle but 0 after. This is really strange.
Christophe
Signature · 10 lines
Christophe Barb� <[email protected]> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Quoted 7 lines · christophe barbe
I saved all proc files before and after a suspend/resume cycle and look at the diff:
In
/proc/asound/card0/intel8x0
I have the following diff:
before: Global control :0xc0000002
after: Global control :0x00000002
I think that the real problem is here as the intel datasheet says for the bits 31:30 :
"S/PDIF Slot Map (SSM) -- R/W. If the run/pause bus master bit (bit 0 of offset 2Bh) is set, then the value in these bits indicate which slots S/PDIF data is transmitted on. Software must ensure that the programming here does not conflict with the PCM channels being used. If there is a conflict, unpredictable behavior will result - the hardware will not check for a conflict.
00 = Reserved
01 = Slots 7 and 8
10 = Slots 6 and 9
11 = Slots 10 and 11"And after a suspend/resume cycle, I have 11 which does not make sense since I don't have a S/PDIF output.
Is there an easy way to set this bits to 00?
Christophe
Signature · 10 lines
Christophe Barb� <[email protected]> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Quoted 23 lines · christophe barbe
Quoted 7 lines · christophe barbe
I saved all proc files before and after a suspend/resume cycle and look at the diff:
In
/proc/asound/card0/intel8x0
I have the following diff:
before: Global control :0xc0000002
after: Global control :0x00000002I think that the real problem is here as the intel datasheet says for the bits 31:30 :
"S/PDIF Slot Map (SSM) -- R/W. If the run/pause bus master bit (bit 0 of offset 2Bh) is set, then the value in these bits indicate which slots S/PDIF data is transmitted on. Software must ensure that the programming here does not conflict with the PCM channels being used. If there is a conflict, unpredictable behavior will result - the hardware will not check for a conflict.
00 = Reserved 01 = Slots 7 and 8 10 = Slots 6 and 9 11 = Slots 10 and 11"
Quoted 4 lines
And after a suspend/resume cycle, I have 11 which does not make sense since I don't have a S/PDIF output.
Is there an easy way to set this bits to 00?
Obviously I confused myself, the bits should be 11 and after the suspend/resume cycle are 00 which is not good.
Christophe
Signature · 10 lines
Christophe Barbe <[email protected]> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click