[alsa-devel] VT1708 clicks & pops
Hi,
I have two boards with a VT1708:
* VIA EPIA EX15000G * VIA VB8002
I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 sounds great, but the EX15000G has random pops and clicks in the output. Both machines are running exactly the same configuration (they are using the same pre-built OS image).
I've tested on the EX15000G using a few different driver versions. One is essentially the version from Ubuntu 10.04, but rebuilt due to unrelated kernel changes. The other is alsa-driver snapshot alsa-driver-1.0.24.72.g7c48f.1314.geb1d0.
You can find output from alsa-info.sh as follows:
EX15000G (using Ubuntu 10.04 driver): http://www.alsa-project.org/db/?f=ea56226a7917391d6adf9078650d3a9395f51b17
EX15000G (using driver from alsa-driver-1.0.24.72.g7c48f.1314.geb1d0): http://www.alsa-project.org/db/?f=d0265991ec3e975820dc439470aea1df925ca1db
VB8002 (using Ubuntu 10.04 driver): http://www.alsa-project.org/db/?f=611cc772a3fab7552bbda193b6ad7998f66a60fb
Any ideas what the problem might be?
Thanks, Forest
Hi,
On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote:
I have two boards with a VT1708:
- VIA EPIA EX15000G
- VIA VB8002
I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 sounds great, but the EX15000G has random pops and clicks in the output. Both machines are running exactly the same configuration (they are using the same pre-built OS image).
Maybe this issue would be more approachable if I could produce it without PulseAudio involved?
Incidentally, these boards both produce a crackling/static sound when PulseAudio is playing and the PCM mixer is turned all the way down. I have seen scattered reports of this in various bug trackers. The problem does not occur when playing via alsa directly. One thing I have noticed is that the crackling noise follows the rhythm of the music being played. It actually sounds like the music has been heavily distorted (i.e. via extreme digital clipping) and then attenuated significantly.
It seems likely that there are driver issues that PulseAudio is exposing. What can I do to track them down?
Thanks, Forest
At Mon, 19 Sep 2011 19:14:13 -0400, Forest Bond wrote:
Hi,
On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote:
I have two boards with a VT1708:
- VIA EPIA EX15000G
- VIA VB8002
I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 sounds great, but the EX15000G has random pops and clicks in the output. Both machines are running exactly the same configuration (they are using the same pre-built OS image).
Maybe this issue would be more approachable if I could produce it without PulseAudio involved?
Yes.
Incidentally, these boards both produce a crackling/static sound when PulseAudio is playing and the PCM mixer is turned all the way down. I have seen scattered reports of this in various bug trackers. The problem does not occur when playing via alsa directly. One thing I have noticed is that the crackling noise follows the rhythm of the music being played. It actually sounds like the music has been heavily distorted (i.e. via extreme digital clipping) and then attenuated significantly.
It seems likely that there are driver issues that PulseAudio is exposing. What can I do to track them down?
Is the problem related with the driver version? You mentioned the difference of drivers installed on your systems. If it's a regression of the driver, it'd be easier to figure out.
Other than that, I'd try to adjust PA, e.g. try tsched=0. Usually this kind of problem is because of inaccurate playback position reporting from the hardware. PA relies (too much) on the playback position as default.
Takashi
Hi Takashi,
Thanks for your response.
On Tue, Sep 20, 2011 at 09:22:23AM +0200, Takashi Iwai wrote:
At Mon, 19 Sep 2011 19:14:13 -0400, Forest Bond wrote:
On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote:
I have two boards with a VT1708:
- VIA EPIA EX15000G
- VIA VB8002
I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 sounds great, but the EX15000G has random pops and clicks in the output. Both machines are running exactly the same configuration (they are using the same pre-built OS image).
Maybe this issue would be more approachable if I could produce it without PulseAudio involved?
Yes.
Heh, I guess I'm probably not going to be able to do that very easily.
Incidentally, these boards both produce a crackling/static sound when PulseAudio is playing and the PCM mixer is turned all the way down. I have seen scattered reports of this in various bug trackers. The problem does not occur when playing via alsa directly. One thing I have noticed is that the crackling noise follows the rhythm of the music being played. It actually sounds like the music has been heavily distorted (i.e. via extreme digital clipping) and then attenuated significantly.
It seems likely that there are driver issues that PulseAudio is exposing. What can I do to track them down?
Is the problem related with the driver version? You mentioned the difference of drivers installed on your systems. If it's a regression of the driver, it'd be easier to figure out.
No, the issue occurs with both driver versions.
Other than that, I'd try to adjust PA, e.g. try tsched=0. Usually this kind of problem is because of inaccurate playback position reporting from the hardware. PA relies (too much) on the playback position as default.
Using tsched=0 fixes the pops and clicks on the EX15000G. Any idea why I might see problems on one board but not the other given how similar they are?
The crackling with PCM volume set to 0 persists with tsched=0. It seems unlikely that this isn't driver or hardware issue. But fixing the pops and clicks without using tsched=0 is more important to me. If you can provide suggestions as to where I might start looking, I would be happy to try and come up with a fix.
Thanks, Forest
At Tue, 20 Sep 2011 15:05:34 -0400, Forest Bond wrote:
Hi Takashi,
Thanks for your response.
On Tue, Sep 20, 2011 at 09:22:23AM +0200, Takashi Iwai wrote:
At Mon, 19 Sep 2011 19:14:13 -0400, Forest Bond wrote:
On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote:
I have two boards with a VT1708:
- VIA EPIA EX15000G
- VIA VB8002
I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 sounds great, but the EX15000G has random pops and clicks in the output. Both machines are running exactly the same configuration (they are using the same pre-built OS image).
Maybe this issue would be more approachable if I could produce it without PulseAudio involved?
Yes.
Heh, I guess I'm probably not going to be able to do that very easily.
Incidentally, these boards both produce a crackling/static sound when PulseAudio is playing and the PCM mixer is turned all the way down. I have seen scattered reports of this in various bug trackers. The problem does not occur when playing via alsa directly. One thing I have noticed is that the crackling noise follows the rhythm of the music being played. It actually sounds like the music has been heavily distorted (i.e. via extreme digital clipping) and then attenuated significantly.
It seems likely that there are driver issues that PulseAudio is exposing. What can I do to track them down?
Is the problem related with the driver version? You mentioned the difference of drivers installed on your systems. If it's a regression of the driver, it'd be easier to figure out.
No, the issue occurs with both driver versions.
Other than that, I'd try to adjust PA, e.g. try tsched=0. Usually this kind of problem is because of inaccurate playback position reporting from the hardware. PA relies (too much) on the playback position as default.
Using tsched=0 fixes the pops and clicks on the EX15000G. Any idea why I might see problems on one board but not the other given how similar they are?
Do they have the same HD-audio controller chip (VIA one)? Usually it's an issue of controller chip, not codec chips, so I wonder if they behave differently even with a same controller.
The crackling with PCM volume set to 0 persists with tsched=0.
Hrm, which PA version are you using? I remember vaguely a buggy PA SIMD operations in some old PA versions.
Also, when you mute the mixer (nor the PA's mixer), e.g. via "alsamixer -c0", the noise goes away, right?
It seems unlikely that this isn't driver or hardware issue. But fixing the pops and clicks without using tsched=0 is more important to me. If you can provide suggestions as to where I might start looking, I would be happy to try and come up with a fix.
As mentioned, the usual problem is the inaccurate DMA position reporting, especially when tsched=0 helped. It means a problem of HD-audio controller. We have already many workarounds in the driver code, but more investigations are needed in such a case...
Takashi
Hi Takashi,
On Wed, Sep 21, 2011 at 10:39:44AM +0200, Takashi Iwai wrote:
At Tue, 20 Sep 2011 15:05:34 -0400, Forest Bond wrote:
On Tue, Sep 20, 2011 at 09:22:23AM +0200, Takashi Iwai wrote:
At Mon, 19 Sep 2011 19:14:13 -0400, Forest Bond wrote:
On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote:
I have two boards with a VT1708:
- VIA EPIA EX15000G
- VIA VB8002
I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 sounds great, but the EX15000G has random pops and clicks in the output. Both machines are running exactly the same configuration (they are using the same pre-built OS image).
Maybe this issue would be more approachable if I could produce it without PulseAudio involved?
Yes.
Heh, I guess I'm probably not going to be able to do that very easily.
Incidentally, these boards both produce a crackling/static sound when PulseAudio is playing and the PCM mixer is turned all the way down. I have seen scattered reports of this in various bug trackers. The problem does not occur when playing via alsa directly. One thing I have noticed is that the crackling noise follows the rhythm of the music being played. It actually sounds like the music has been heavily distorted (i.e. via extreme digital clipping) and then attenuated significantly.
It seems likely that there are driver issues that PulseAudio is exposing. What can I do to track them down?
Is the problem related with the driver version? You mentioned the difference of drivers installed on your systems. If it's a regression of the driver, it'd be easier to figure out.
No, the issue occurs with both driver versions.
Other than that, I'd try to adjust PA, e.g. try tsched=0. Usually this kind of problem is because of inaccurate playback position reporting from the hardware. PA relies (too much) on the playback position as default.
Using tsched=0 fixes the pops and clicks on the EX15000G. Any idea why I might see problems on one board but not the other given how similar they are?
Do they have the same HD-audio controller chip (VIA one)? Usually it's an issue of controller chip, not codec chips, so I wonder if they behave differently even with a same controller.
I'm not really sure how to identify the controller chip. alsa-info.sh output is here:
EX15000G: http://www.alsa-project.org/db/?f=ea56226a7917391d6adf9078650d3a9395f51b17
VB8002: http://www.alsa-project.org/db/?f=611cc772a3fab7552bbda193b6ad7998f66a60fb
As I understand it the VT1708 is the codec chip. Is the audio controller part of the south bridge? Both report having a VT8237.
The crackling with PCM volume set to 0 persists with tsched=0.
Hrm, which PA version are you using? I remember vaguely a buggy PA SIMD operations in some old PA versions.
1:0.9.22+stable-queue-24-g67d18-0ubuntu3 from Ubuntu Lucid.
Also, when you mute the mixer (nor the PA's mixer), e.g. via "alsamixer -c0", the noise goes away, right?
I do not use the PA mixer. The noise is present with ALSA's PCM control set to zero (-51dB). If I move the PCM control up one tick (to -50.8dB) the noise goes away.
It seems unlikely that this isn't driver or hardware issue. But fixing the pops and clicks without using tsched=0 is more important to me. If you can provide suggestions as to where I might start looking, I would be happy to try and come up with a fix.
As mentioned, the usual problem is the inaccurate DMA position reporting, especially when tsched=0 helped. It means a problem of HD-audio controller. We have already many workarounds in the driver code, but more investigations are needed in such a case...
Again, I'm happy to spend the time needed to get this fixed. If you can provide hints on where to look, that would be great. Can you point me at some git commits that fixed similar issues? I checked the git log but did not find any such commits that changed patch_via.c.
Thanks, Forest
At Wed, 21 Sep 2011 10:35:10 -0400, Forest Bond wrote:
Hi Takashi,
On Wed, Sep 21, 2011 at 10:39:44AM +0200, Takashi Iwai wrote:
At Tue, 20 Sep 2011 15:05:34 -0400, Forest Bond wrote:
On Tue, Sep 20, 2011 at 09:22:23AM +0200, Takashi Iwai wrote:
At Mon, 19 Sep 2011 19:14:13 -0400, Forest Bond wrote:
On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote:
I have two boards with a VT1708:
- VIA EPIA EX15000G
- VIA VB8002
I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 sounds great, but the EX15000G has random pops and clicks in the output. Both machines are running exactly the same configuration (they are using the same pre-built OS image).
Maybe this issue would be more approachable if I could produce it without PulseAudio involved?
Yes.
Heh, I guess I'm probably not going to be able to do that very easily.
Incidentally, these boards both produce a crackling/static sound when PulseAudio is playing and the PCM mixer is turned all the way down. I have seen scattered reports of this in various bug trackers. The problem does not occur when playing via alsa directly. One thing I have noticed is that the crackling noise follows the rhythm of the music being played. It actually sounds like the music has been heavily distorted (i.e. via extreme digital clipping) and then attenuated significantly.
It seems likely that there are driver issues that PulseAudio is exposing. What can I do to track them down?
Is the problem related with the driver version? You mentioned the difference of drivers installed on your systems. If it's a regression of the driver, it'd be easier to figure out.
No, the issue occurs with both driver versions.
Other than that, I'd try to adjust PA, e.g. try tsched=0. Usually this kind of problem is because of inaccurate playback position reporting from the hardware. PA relies (too much) on the playback position as default.
Using tsched=0 fixes the pops and clicks on the EX15000G. Any idea why I might see problems on one board but not the other given how similar they are?
Do they have the same HD-audio controller chip (VIA one)? Usually it's an issue of controller chip, not codec chips, so I wonder if they behave differently even with a same controller.
I'm not really sure how to identify the controller chip. alsa-info.sh output is here:
EX15000G: http://www.alsa-project.org/db/?f=ea56226a7917391d6adf9078650d3a9395f51b17
VB8002: http://www.alsa-project.org/db/?f=611cc772a3fab7552bbda193b6ad7998f66a60fb
As I understand it the VT1708 is the codec chip. Is the audio controller part of the south bridge? Both report having a VT8237.
Yes, and it's VT1708 also meaning a controller chip, apparently. The controller chip is what PCI ID shows.
The crackling with PCM volume set to 0 persists with tsched=0.
Hrm, which PA version are you using? I remember vaguely a buggy PA SIMD operations in some old PA versions.
1:0.9.22+stable-queue-24-g67d18-0ubuntu3 from Ubuntu Lucid.
Also, when you mute the mixer (nor the PA's mixer), e.g. via "alsamixer -c0", the noise goes away, right?
I do not use the PA mixer. The noise is present with ALSA's PCM control set to zero (-51dB). If I move the PCM control up one tick (to -50.8dB) the noise goes away.
OK, then it's an issue in the sound driver. Could you give alsa-info.sh outputs both mute-with-noise and without noise for comparison?
It seems unlikely that this isn't driver or hardware issue. But fixing the pops and clicks without using tsched=0 is more important to me. If you can provide suggestions as to where I might start looking, I would be happy to try and come up with a fix.
As mentioned, the usual problem is the inaccurate DMA position reporting, especially when tsched=0 helped. It means a problem of HD-audio controller. We have already many workarounds in the driver code, but more investigations are needed in such a case...
Again, I'm happy to spend the time needed to get this fixed. If you can provide hints on where to look, that would be great. Can you point me at some git commits that fixed similar issues? I checked the git log but did not find any such commits that changed patch_via.c.
Well, there are a few possible causes. If it's something wrong in the codec side, it can be a PM code. The latest driver has a mixer enum "Dynamic Power-Control". Try to disable it.
OTOH, if it's in the controller side, where you need to take a look at is hda_intel.c, or sometimes hda_codec.c.
Takashi
Hi Takashi,
On Wed, Sep 21, 2011 at 04:43:15PM +0200, Takashi Iwai wrote:
At Wed, 21 Sep 2011 10:35:10 -0400, Forest Bond wrote:
Hi Takashi,
On Wed, Sep 21, 2011 at 10:39:44AM +0200, Takashi Iwai wrote:
At Tue, 20 Sep 2011 15:05:34 -0400, Forest Bond wrote:
On Tue, Sep 20, 2011 at 09:22:23AM +0200, Takashi Iwai wrote:
At Mon, 19 Sep 2011 19:14:13 -0400, Forest Bond wrote:
On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote: > I have two boards with a VT1708: > > * VIA EPIA EX15000G > * VIA VB8002 > > I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 > sounds great, but the EX15000G has random pops and clicks in the output. Both > machines are running exactly the same configuration (they are using the same > pre-built OS image).
Maybe this issue would be more approachable if I could produce it without PulseAudio involved?
Yes.
Heh, I guess I'm probably not going to be able to do that very easily.
Incidentally, these boards both produce a crackling/static sound when PulseAudio is playing and the PCM mixer is turned all the way down. I have seen scattered reports of this in various bug trackers. The problem does not occur when playing via alsa directly. One thing I have noticed is that the crackling noise follows the rhythm of the music being played. It actually sounds like the music has been heavily distorted (i.e. via extreme digital clipping) and then attenuated significantly.
It seems likely that there are driver issues that PulseAudio is exposing. What can I do to track them down?
Is the problem related with the driver version? You mentioned the difference of drivers installed on your systems. If it's a regression of the driver, it'd be easier to figure out.
No, the issue occurs with both driver versions.
Other than that, I'd try to adjust PA, e.g. try tsched=0. Usually this kind of problem is because of inaccurate playback position reporting from the hardware. PA relies (too much) on the playback position as default.
Using tsched=0 fixes the pops and clicks on the EX15000G. Any idea why I might see problems on one board but not the other given how similar they are?
Do they have the same HD-audio controller chip (VIA one)? Usually it's an issue of controller chip, not codec chips, so I wonder if they behave differently even with a same controller.
I'm not really sure how to identify the controller chip. alsa-info.sh output is here:
EX15000G: http://www.alsa-project.org/db/?f=ea56226a7917391d6adf9078650d3a9395f51b17
VB8002: http://www.alsa-project.org/db/?f=611cc772a3fab7552bbda193b6ad7998f66a60fb
As I understand it the VT1708 is the codec chip. Is the audio controller part of the south bridge? Both report having a VT8237.
Yes, and it's VT1708 also meaning a controller chip, apparently. The controller chip is what PCI ID shows.
The crackling with PCM volume set to 0 persists with tsched=0.
Hrm, which PA version are you using? I remember vaguely a buggy PA SIMD operations in some old PA versions.
1:0.9.22+stable-queue-24-g67d18-0ubuntu3 from Ubuntu Lucid.
Also, when you mute the mixer (nor the PA's mixer), e.g. via "alsamixer -c0", the noise goes away, right?
I do not use the PA mixer. The noise is present with ALSA's PCM control set to zero (-51dB). If I move the PCM control up one tick (to -50.8dB) the noise goes away.
OK, then it's an issue in the sound driver. Could you give alsa-info.sh outputs both mute-with-noise and without noise for comparison?
With noise:
http://www.alsa-project.org/db/?f=c8119c27951479731f1ba6d8ea62cd3ad91aec1a
Without noise:
http://www.alsa-project.org/db/?f=f40d02f0286a64946bec2ff4243c15ea86e5ea59
It seems unlikely that this isn't driver or hardware issue. But fixing the pops and clicks without using tsched=0 is more important to me. If you can provide suggestions as to where I might start looking, I would be happy to try and come up with a fix.
As mentioned, the usual problem is the inaccurate DMA position reporting, especially when tsched=0 helped. It means a problem of HD-audio controller. We have already many workarounds in the driver code, but more investigations are needed in such a case...
Again, I'm happy to spend the time needed to get this fixed. If you can provide hints on where to look, that would be great. Can you point me at some git commits that fixed similar issues? I checked the git log but did not find any such commits that changed patch_via.c.
Well, there are a few possible causes. If it's something wrong in the codec side, it can be a PM code. The latest driver has a mixer enum "Dynamic Power-Control". Try to disable it.
Okay, I'll give this a try.
OTOH, if it's in the controller side, where you need to take a look at is hda_intel.c, or sometimes hda_codec.c.
Thanks for the info.
-Forest
Hi Takashi,
On Wed, Sep 21, 2011 at 04:43:15PM +0200, Takashi Iwai wrote:
At Wed, 21 Sep 2011 10:35:10 -0400, Forest Bond wrote:
On Wed, Sep 21, 2011 at 10:39:44AM +0200, Takashi Iwai wrote:
At Tue, 20 Sep 2011 15:05:34 -0400, Forest Bond wrote:
On Tue, Sep 20, 2011 at 09:22:23AM +0200, Takashi Iwai wrote:
At Mon, 19 Sep 2011 19:14:13 -0400, Forest Bond wrote:
On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote: > I have two boards with a VT1708: > > * VIA EPIA EX15000G > * VIA VB8002 > > I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 > sounds great, but the EX15000G has random pops and clicks in the output. Both > machines are running exactly the same configuration (they are using the same > pre-built OS image).
[...]
As mentioned, the usual problem is the inaccurate DMA position reporting, especially when tsched=0 helped. It means a problem of HD-audio controller. We have already many workarounds in the driver code, but more investigations are needed in such a case...
Again, I'm happy to spend the time needed to get this fixed. If you can provide hints on where to look, that would be great. Can you point me at some git commits that fixed similar issues? I checked the git log but did not find any such commits that changed patch_via.c.
Well, there are a few possible causes. If it's something wrong in the codec side, it can be a PM code. The latest driver has a mixer enum "Dynamic Power-Control". Try to disable it.
This control is not enabled for the VT1708 codec because the set_widgets_power_state function pointer is not defined for this codec. I assume the hardware doesn't support the underlying feature? Or maybe it is just not implemented yet in the driver?
Thanks, Forest
Hi Takashi,
On Wed, Sep 21, 2011 at 04:43:15PM +0200, Takashi Iwai wrote:
At Wed, 21 Sep 2011 10:35:10 -0400, Forest Bond wrote:
On Wed, Sep 21, 2011 at 10:39:44AM +0200, Takashi Iwai wrote:
At Tue, 20 Sep 2011 15:05:34 -0400, Forest Bond wrote:
On Tue, Sep 20, 2011 at 09:22:23AM +0200, Takashi Iwai wrote:
At Mon, 19 Sep 2011 19:14:13 -0400, Forest Bond wrote:
On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote: > I have two boards with a VT1708: > > * VIA EPIA EX15000G > * VIA VB8002 > > I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 > sounds great, but the EX15000G has random pops and clicks in the output. Both > machines are running exactly the same configuration (they are using the same > pre-built OS image).
The crackling with PCM volume set to 0 persists with tsched=0.
[...]
Hrm, which PA version are you using? I remember vaguely a buggy PA SIMD operations in some old PA versions.
1:0.9.22+stable-queue-24-g67d18-0ubuntu3 from Ubuntu Lucid.
Also, when you mute the mixer (nor the PA's mixer), e.g. via "alsamixer -c0", the noise goes away, right?
I do not use the PA mixer. The noise is present with ALSA's PCM control set to zero (-51dB). If I move the PCM control up one tick (to -50.8dB) the noise goes away.
OK, then it's an issue in the sound driver. Could you give alsa-info.sh outputs both mute-with-noise and without noise for comparison?
I guess we can ignore this one for now. I do not have this problem using a recent alsa-driver snapshot. The PCM control does not go below -40.25dB with this version. It's possible the new driver simply doesn't allow the control to be set to a problematic value.
I will note, however, that the master control with the snapshot has a minimum value of 0dB and a maximum of 6.75dB, and that the audio is barely audible at 0dB. I have to crank the master control all the way up to get the same volume as the old driver set to 0dB. Maybe I can come up with a fix for this.
Thanks, Forest
At Wed, 21 Sep 2011 13:55:53 -0400, Forest Bond wrote:
Hi Takashi,
On Wed, Sep 21, 2011 at 04:43:15PM +0200, Takashi Iwai wrote:
At Wed, 21 Sep 2011 10:35:10 -0400, Forest Bond wrote:
On Wed, Sep 21, 2011 at 10:39:44AM +0200, Takashi Iwai wrote:
At Tue, 20 Sep 2011 15:05:34 -0400, Forest Bond wrote:
On Tue, Sep 20, 2011 at 09:22:23AM +0200, Takashi Iwai wrote:
At Mon, 19 Sep 2011 19:14:13 -0400, Forest Bond wrote: > On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote: > > I have two boards with a VT1708: > > > > * VIA EPIA EX15000G > > * VIA VB8002 > > > > I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 > > sounds great, but the EX15000G has random pops and clicks in the output. Both > > machines are running exactly the same configuration (they are using the same > > pre-built OS image).
The crackling with PCM volume set to 0 persists with tsched=0.
[...]
Hrm, which PA version are you using? I remember vaguely a buggy PA SIMD operations in some old PA versions.
1:0.9.22+stable-queue-24-g67d18-0ubuntu3 from Ubuntu Lucid.
Also, when you mute the mixer (nor the PA's mixer), e.g. via "alsamixer -c0", the noise goes away, right?
I do not use the PA mixer. The noise is present with ALSA's PCM control set to zero (-51dB). If I move the PCM control up one tick (to -50.8dB) the noise goes away.
OK, then it's an issue in the sound driver. Could you give alsa-info.sh outputs both mute-with-noise and without noise for comparison?
I guess we can ignore this one for now. I do not have this problem using a recent alsa-driver snapshot. The PCM control does not go below -40.25dB with this version. It's possible the new driver simply doesn't allow the control to be set to a problematic value.
I will note, however, that the master control with the snapshot has a minimum value of 0dB and a maximum of 6.75dB,
That's odd.
and that the audio is barely audible at 0dB. I have to crank the master control all the way up to get the same volume as the old driver set to 0dB. Maybe I can come up with a fix for this.
For debugging, I'd need anyway the alsa-info.sh output from the latest alsa-driver snapshot.
Also, I'm working now on non-snooping mode support, and this might help for fixing some problems like yours. Could you try the patch below (with the snapshot version)?
FYI, the snapshot tarballs are found in ftp://ftp.suse.com/pub/people/tiwai/snapshot/ while kernel.org is down.
thanks,
Takashi
--- diff --git a/include/sound/pcm.h b/include/sound/pcm.h index dc36f75..3e7fda6 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -1037,6 +1037,8 @@ static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) atomic_dec(&substream->mmap_count); }
+int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, + struct vm_area_struct *area); /* mmap for io-memory area */ #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 1c6be91..b4bf4a4 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -3156,8 +3156,8 @@ static const struct vm_operations_struct snd_pcm_vm_ops_data_fault = { /* * mmap the DMA buffer on RAM */ -static int snd_pcm_default_mmap(struct snd_pcm_substream *substream, - struct vm_area_struct *area) +int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, + struct vm_area_struct *area) { area->vm_flags |= VM_RESERVED; #ifdef ARCH_HAS_DMA_MMAP_COHERENT @@ -3177,6 +3177,7 @@ static int snd_pcm_default_mmap(struct snd_pcm_substream *substream, area->vm_ops = &snd_pcm_vm_ops_data_fault; return 0; } +EXPORT_SYMBOL_GPL(snd_pcm_lib_default_mmap);
/* * mmap the DMA buffer on I/O memory area @@ -3242,7 +3243,7 @@ int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, if (substream->ops->mmap) err = substream->ops->mmap(substream, area); else - err = snd_pcm_default_mmap(substream, area); + err = snd_pcm_lib_default_mmap(substream, area); if (!err) atomic_inc(&substream->mmap_count); return err; diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 2a8bed9..bfec401 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -34,7 +34,6 @@ * */
-#include <asm/io.h> #include <linux/delay.h> #include <linux/interrupt.h> #include <linux/kernel.h> @@ -46,6 +45,12 @@ #include <linux/pci.h> #include <linux/mutex.h> #include <linux/reboot.h> +#include <linux/io.h> +#ifdef CONFIG_X86 +/* for snoop control */ +#include <asm/pgtable.h> +#include <asm/cacheflush.h> +#endif #include <sound/core.h> #include <sound/initval.h> #include "hda_codec.h" @@ -121,6 +126,15 @@ module_param(align_buffer_size, bool, 0644); MODULE_PARM_DESC(align_buffer_size, "Force buffer and period sizes to be multiple of 128 bytes.");
+#ifdef CONFIG_X86 +static bool hda_snoop; +module_param_named(snoop, hda_snoop, bool, 0444); +MODULE_PARM_DESC(snoop, "Enable/disable snooping"); +#else +#define hda_snoop true +#endif + + MODULE_LICENSE("GPL"); MODULE_SUPPORTED_DEVICE("{{Intel, ICH6}," "{Intel, ICH6M}," @@ -376,6 +390,7 @@ struct azx_dev { * when link position is not greater than FIFO size */ unsigned int insufficient :1; + unsigned int wc_marked:1; };
/* CORB/RIRB */ @@ -548,6 +563,45 @@ static char *driver_short_names[] __devinitdata = { /* for pcm support */ #define get_azx_dev(substream) (substream->runtime->private_data)
+#ifdef CONFIG_X86 +static void __mark_pages_wc(struct azx *chip, void *addr, size_t size, bool on) +{ + if (hda_snoop) + return; + if (addr && size) { + int pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; + if (on) + set_memory_wc((unsigned long)addr, pages); + else + set_memory_wb((unsigned long)addr, pages); + } +} + +static inline void mark_pages_wc(struct azx *chip, struct snd_dma_buffer *buf, + bool on) +{ + __mark_pages_wc(chip, buf->area, buf->bytes, on); +} +static inline void mark_runtime_wc(struct azx *chip, struct azx_dev *azx_dev, + struct snd_pcm_runtime *runtime, bool on) +{ + if (azx_dev->wc_marked != on) { + __mark_pages_wc(chip, runtime->dma_area, runtime->dma_bytes, on); + azx_dev->wc_marked = on; + } +} +#else +/* NOP for other archs */ +static inline void mark_pages_wc(struct azx *chip, struct snd_dma_buffer *buf, + bool on) +{ +} +static inline void mark_runtime_wc(struct azx *chip, struct azx_dev *azx_dev, + struct snd_pcm_runtime *runtime, bool on) +{ +} +#endif + static int azx_acquire_irq(struct azx *chip, int do_disconnect); static int azx_send_cmd(struct hda_bus *bus, unsigned int val); /* @@ -569,6 +623,7 @@ static int azx_alloc_cmd_io(struct azx *chip) snd_printk(KERN_ERR SFX "cannot allocate CORB/RIRB\n"); return err; } + mark_pages_wc(chip, &chip->rb, true); return 0; }
@@ -1104,8 +1159,8 @@ static void azx_init_pci(struct azx *chip) if (chip->driver_caps & AZX_DCAPS_ATI_SNOOP) { snd_printdd(SFX "Enabling ATI snoop\n"); update_pci_byte(chip->pci, - ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR, - 0x07, ATI_SB450_HDAUDIO_ENABLE_SNOOP); + ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR, 0x07, + hda_snoop ? ATI_SB450_HDAUDIO_ENABLE_SNOOP : 0); }
/* For NVIDIA HDA, enable snoop */ @@ -1125,15 +1180,18 @@ static void azx_init_pci(struct azx *chip) /* Enable SCH/PCH snoop if needed */ if (chip->driver_caps & AZX_DCAPS_SCH_SNOOP) { pci_read_config_word(chip->pci, INTEL_SCH_HDA_DEVC, &snoop); - if (snoop & INTEL_SCH_HDA_DEVC_NOSNOOP) { - pci_write_config_word(chip->pci, INTEL_SCH_HDA_DEVC, - snoop & (~INTEL_SCH_HDA_DEVC_NOSNOOP)); + if ((!hda_snoop && !(snoop & INTEL_SCH_HDA_DEVC_NOSNOOP)) || + (hda_snoop && (snoop & INTEL_SCH_HDA_DEVC_NOSNOOP))) { + snoop &= ~INTEL_SCH_HDA_DEVC_NOSNOOP; + if (!hda_snoop) + snoop |= INTEL_SCH_HDA_DEVC_NOSNOOP; + pci_write_config_word(chip->pci, INTEL_SCH_HDA_DEVC, snoop); pci_read_config_word(chip->pci, INTEL_SCH_HDA_DEVC, &snoop); - snd_printdd(SFX "HDA snoop disabled, enabling ... %s\n", - (snoop & INTEL_SCH_HDA_DEVC_NOSNOOP) - ? "Failed" : "OK"); } + snd_printdd(SFX "HDA snoop %s\n", + (snoop & INTEL_SCH_HDA_DEVC_NOSNOOP) + ? "Disabled" : "Enabled"); } }
@@ -1340,12 +1398,16 @@ static void azx_stream_reset(struct azx *chip, struct azx_dev *azx_dev) */ static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev) { + unsigned int val; /* make sure the run bit is zero for SD */ azx_stream_clear(chip, azx_dev); /* program the stream_tag */ - azx_sd_writel(azx_dev, SD_CTL, - (azx_sd_readl(azx_dev, SD_CTL) & ~SD_CTL_STREAM_TAG_MASK)| - (azx_dev->stream_tag << SD_CTL_STREAM_TAG_SHIFT)); + val = azx_sd_readl(azx_dev, SD_CTL); + val = (val & ~SD_CTL_STREAM_TAG_MASK) | + (azx_dev->stream_tag << SD_CTL_STREAM_TAG_SHIFT); + if (!hda_snoop) + val |= SD_CTL_TRAFFIC_PRIO; + azx_sd_writel(azx_dev, SD_CTL, val);
/* program the length of samples in cyclic buffer */ azx_sd_writel(azx_dev, SD_CBL, azx_dev->bufsize); @@ -1693,19 +1755,30 @@ static int azx_pcm_close(struct snd_pcm_substream *substream) static int azx_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) { + struct azx_pcm *apcm = snd_pcm_substream_chip(substream); + struct azx *chip = apcm->chip; + struct snd_pcm_runtime *runtime = substream->runtime; struct azx_dev *azx_dev = get_azx_dev(substream); + int ret;
+ mark_runtime_wc(chip, azx_dev, runtime, false); azx_dev->bufsize = 0; azx_dev->period_bytes = 0; azx_dev->format_val = 0; - return snd_pcm_lib_malloc_pages(substream, + ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); + if (ret < 0) + return ret; + mark_runtime_wc(chip, azx_dev, runtime, true); + return ret; }
static int azx_pcm_hw_free(struct snd_pcm_substream *substream) { struct azx_pcm *apcm = snd_pcm_substream_chip(substream); struct azx_dev *azx_dev = get_azx_dev(substream); + struct azx *chip = apcm->chip; + struct snd_pcm_runtime *runtime = substream->runtime; struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream];
/* reset BDL address */ @@ -1718,6 +1791,7 @@ static int azx_pcm_hw_free(struct snd_pcm_substream *substream)
snd_hda_codec_cleanup(apcm->codec, hinfo, substream);
+ mark_runtime_wc(chip, azx_dev, runtime, false); return snd_pcm_lib_free_pages(substream); }
@@ -2076,6 +2150,18 @@ static void azx_clear_irq_pending(struct azx *chip) spin_unlock_irq(&chip->reg_lock); }
+#ifdef CONFIG_X86 +static int azx_pcm_mmap(struct snd_pcm_substream *substream, + struct vm_area_struct *area) +{ + if (!hda_snoop) + area->vm_page_prot = pgprot_writecombine(area->vm_page_prot); + return snd_pcm_lib_default_mmap(substream, area); +} +#else +#define azx_pcm_mmap NULL +#endif + static struct snd_pcm_ops azx_pcm_ops = { .open = azx_pcm_open, .close = azx_pcm_close, @@ -2085,6 +2171,7 @@ static struct snd_pcm_ops azx_pcm_ops = { .prepare = azx_pcm_prepare, .trigger = azx_pcm_trigger, .pointer = azx_pcm_pointer, + .mmap = azx_pcm_mmap, .page = snd_pcm_sgbuf_ops_page, };
@@ -2365,13 +2452,19 @@ static int azx_free(struct azx *chip)
if (chip->azx_dev) { for (i = 0; i < chip->num_streams; i++) - if (chip->azx_dev[i].bdl.area) + if (chip->azx_dev[i].bdl.area) { + mark_pages_wc(chip, &chip->azx_dev[i].bdl, false); snd_dma_free_pages(&chip->azx_dev[i].bdl); + } } - if (chip->rb.area) + if (chip->rb.area) { + mark_pages_wc(chip, &chip->rb, false); snd_dma_free_pages(&chip->rb); - if (chip->posbuf.area) + } + if (chip->posbuf.area) { + mark_pages_wc(chip, &chip->posbuf, false); snd_dma_free_pages(&chip->posbuf); + } pci_release_regions(chip->pci); pci_disable_device(chip->pci); kfree(chip->azx_dev); @@ -2693,6 +2786,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, snd_printk(KERN_ERR SFX "cannot allocate BDL\n"); goto errout; } + mark_pages_wc(chip, &chip->azx_dev[i].bdl, true); } /* allocate memory for the position buffer */ err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, @@ -2702,6 +2796,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, snd_printk(KERN_ERR SFX "cannot allocate posbuf\n"); goto errout; } + mark_pages_wc(chip, &chip->posbuf, true); /* allocate CORB/RIRB */ err = azx_alloc_cmd_io(chip); if (err < 0)
Hi Takashi,
On Tue, Sep 27, 2011 at 02:57:16PM +0200, Takashi Iwai wrote:
At Wed, 21 Sep 2011 13:55:53 -0400, Forest Bond wrote:
On Wed, Sep 21, 2011 at 04:43:15PM +0200, Takashi Iwai wrote:
At Wed, 21 Sep 2011 10:35:10 -0400, Forest Bond wrote:
On Wed, Sep 21, 2011 at 10:39:44AM +0200, Takashi Iwai wrote:
At Tue, 20 Sep 2011 15:05:34 -0400, Forest Bond wrote:
On Tue, Sep 20, 2011 at 09:22:23AM +0200, Takashi Iwai wrote: > At Mon, 19 Sep 2011 19:14:13 -0400, Forest Bond wrote: > > On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote: > > > I have two boards with a VT1708: > > > > > > * VIA EPIA EX15000G > > > * VIA VB8002 > > > > > > I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 > > > sounds great, but the EX15000G has random pops and clicks in the output. Both > > > machines are running exactly the same configuration (they are using the same > > > pre-built OS image). The crackling with PCM volume set to 0 persists with tsched=0.
[...]
Hrm, which PA version are you using? I remember vaguely a buggy PA SIMD operations in some old PA versions.
1:0.9.22+stable-queue-24-g67d18-0ubuntu3 from Ubuntu Lucid.
Also, when you mute the mixer (nor the PA's mixer), e.g. via "alsamixer -c0", the noise goes away, right?
I do not use the PA mixer. The noise is present with ALSA's PCM control set to zero (-51dB). If I move the PCM control up one tick (to -50.8dB) the noise goes away.
OK, then it's an issue in the sound driver. Could you give alsa-info.sh outputs both mute-with-noise and without noise for comparison?
I guess we can ignore this one for now. I do not have this problem using a recent alsa-driver snapshot. The PCM control does not go below -40.25dB with this version. It's possible the new driver simply doesn't allow the control to be set to a problematic value.
I will note, however, that the master control with the snapshot has a minimum value of 0dB and a maximum of 6.75dB,
That's odd.
and that the audio is barely audible at 0dB. I have to crank the master control all the way up to get the same volume as the old driver set to 0dB. Maybe I can come up with a fix for this.
For debugging, I'd need anyway the alsa-info.sh output from the latest alsa-driver snapshot.
Okay, here you go:
http://www.alsa-project.org/db/?f=8f3da35bd1b615d199f8e71df8b012fbdf5ff690
Also, I'm working now on non-snooping mode support, and this might help for fixing some problems like yours. Could you try the patch below (with the snapshot version)?
Unfortunately, this doesn't seem to help.
Given the similarities between the working and non-working boards, I was wondering if the BIOS is setting up the chips differently and that is the immediate cause of the problems. In particular:
* There is no set_widgets_power_state function for this chip. If the BIOS enables some power management function on one board but not the other and the driver has no way to disable it, could that cause an issue like this one?
* I see that the VB8002 has "N/A" listed for "Pin Default" for several "Pin Complex" nodes where the EX15000G has "Jack". Is it possible the EX15000G has some nodes configured as AC_JACK_PORT_COMPLEX that should be configured as AC_JACK_PORT_NONE?
It should be clear that I do not have a very good understanding of the HDA spec. I'm assuming the BIOS is responsible for configuring the chip as I've described above. Do any of those problems sound possible to you? If so, are there ways to work around them in the driver?
Thanks, Forest
At Tue, 27 Sep 2011 17:45:32 -0400, Forest Bond wrote:
Hi Takashi,
On Tue, Sep 27, 2011 at 02:57:16PM +0200, Takashi Iwai wrote:
At Wed, 21 Sep 2011 13:55:53 -0400, Forest Bond wrote:
On Wed, Sep 21, 2011 at 04:43:15PM +0200, Takashi Iwai wrote:
At Wed, 21 Sep 2011 10:35:10 -0400, Forest Bond wrote:
On Wed, Sep 21, 2011 at 10:39:44AM +0200, Takashi Iwai wrote:
At Tue, 20 Sep 2011 15:05:34 -0400, Forest Bond wrote: > On Tue, Sep 20, 2011 at 09:22:23AM +0200, Takashi Iwai wrote: > > At Mon, 19 Sep 2011 19:14:13 -0400, Forest Bond wrote: > > > On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote: > > > > I have two boards with a VT1708: > > > > > > > > * VIA EPIA EX15000G > > > > * VIA VB8002 > > > > > > > > I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 > > > > sounds great, but the EX15000G has random pops and clicks in the output. Both > > > > machines are running exactly the same configuration (they are using the same > > > > pre-built OS image). > The crackling with PCM volume set to 0 persists with tsched=0.
[...]
Hrm, which PA version are you using? I remember vaguely a buggy PA SIMD operations in some old PA versions.
1:0.9.22+stable-queue-24-g67d18-0ubuntu3 from Ubuntu Lucid.
Also, when you mute the mixer (nor the PA's mixer), e.g. via "alsamixer -c0", the noise goes away, right?
I do not use the PA mixer. The noise is present with ALSA's PCM control set to zero (-51dB). If I move the PCM control up one tick (to -50.8dB) the noise goes away.
OK, then it's an issue in the sound driver. Could you give alsa-info.sh outputs both mute-with-noise and without noise for comparison?
I guess we can ignore this one for now. I do not have this problem using a recent alsa-driver snapshot. The PCM control does not go below -40.25dB with this version. It's possible the new driver simply doesn't allow the control to be set to a problematic value.
I will note, however, that the master control with the snapshot has a minimum value of 0dB and a maximum of 6.75dB,
That's odd.
and that the audio is barely audible at 0dB. I have to crank the master control all the way up to get the same volume as the old driver set to 0dB. Maybe I can come up with a fix for this.
For debugging, I'd need anyway the alsa-info.sh output from the latest alsa-driver snapshot.
Okay, here you go:
http://www.alsa-project.org/db/?f=8f3da35bd1b615d199f8e71df8b012fbdf5ff690
This is the working device, right?
Also, I'm working now on non-snooping mode support, and this might help for fixing some problems like yours. Could you try the patch below (with the snapshot version)?
Unfortunately, this doesn't seem to help.
Given the similarities between the working and non-working boards, I was wondering if the BIOS is setting up the chips differently and that is the immediate cause of the problems. In particular:
- There is no set_widgets_power_state function for this chip. If the BIOS enables some power management function on one board but not the other and the driver has no way to disable it, could that cause an issue like this one?
No, as default the driver powers up all widgets and power down all again at power-saving. The VIA codec driver has an advanced implementation to turn off a few unused widgets even in power-up. And this feature is missing in VT1708. So, it doesn't mean that the driver has no power control. It has.
- I see that the VB8002 has "N/A" listed for "Pin Default" for several "Pin Complex" nodes where the EX15000G has "Jack". Is it possible the EX15000G has some nodes configured as AC_JACK_PORT_COMPLEX that should be configured as AC_JACK_PORT_NONE?
I don't know. You need to check whether the pins are really correctly set up. For example, most of jacks have the detection capability. Then plug/unplug each jack and check the pin-detection e.g. with hda-verb program.
It should be clear that I do not have a very good understanding of the HDA spec. I'm assuming the BIOS is responsible for configuring the chip as I've described above. Do any of those problems sound possible to you? If so, are there ways to work around them in the driver?
Yes, pins can be easily overridden via sysfs or patch option. See Documentation/sound/alsa/HD-Audio.txt.
Takashi
Hi Takashi,
On Wed, Sep 28, 2011 at 07:33:49AM +0200, Takashi Iwai wrote:
At Tue, 27 Sep 2011 17:45:32 -0400, Forest Bond wrote:
On Tue, Sep 27, 2011 at 02:57:16PM +0200, Takashi Iwai wrote:
At Wed, 21 Sep 2011 13:55:53 -0400, Forest Bond wrote:
On Wed, Sep 21, 2011 at 04:43:15PM +0200, Takashi Iwai wrote:
At Wed, 21 Sep 2011 10:35:10 -0400, Forest Bond wrote:
On Wed, Sep 21, 2011 at 10:39:44AM +0200, Takashi Iwai wrote: > At Tue, 20 Sep 2011 15:05:34 -0400, Forest Bond wrote: > > On Tue, Sep 20, 2011 at 09:22:23AM +0200, Takashi Iwai wrote: > > > At Mon, 19 Sep 2011 19:14:13 -0400, Forest Bond wrote: > > > > On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote: > > > > > I have two boards with a VT1708: > > > > > > > > > > * VIA EPIA EX15000G > > > > > * VIA VB8002 > > > > > > > > > > I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 > > > > > sounds great, but the EX15000G has random pops and clicks in the output. Both > > > > > machines are running exactly the same configuration (they are using the same > > > > > pre-built OS image). > > The crackling with PCM volume set to 0 persists with tsched=0.
[...]
> Hrm, which PA version are you using? I remember vaguely a buggy PA > SIMD operations in some old PA versions.
1:0.9.22+stable-queue-24-g67d18-0ubuntu3 from Ubuntu Lucid.
> Also, when you mute the mixer (nor the PA's mixer), e.g. via > "alsamixer -c0", the noise goes away, right?
I do not use the PA mixer. The noise is present with ALSA's PCM control set to zero (-51dB). If I move the PCM control up one tick (to -50.8dB) the noise goes away.
OK, then it's an issue in the sound driver. Could you give alsa-info.sh outputs both mute-with-noise and without noise for comparison?
I guess we can ignore this one for now. I do not have this problem using a recent alsa-driver snapshot. The PCM control does not go below -40.25dB with this version. It's possible the new driver simply doesn't allow the control to be set to a problematic value.
I will note, however, that the master control with the snapshot has a minimum value of 0dB and a maximum of 6.75dB,
That's odd.
and that the audio is barely audible at 0dB. I have to crank the master control all the way up to get the same volume as the old driver set to 0dB. Maybe I can come up with a fix for this.
For debugging, I'd need anyway the alsa-info.sh output from the latest alsa-driver snapshot.
Okay, here you go:
http://www.alsa-project.org/db/?f=8f3da35bd1b615d199f8e71df8b012fbdf5ff690
This is the working device, right?
No, this is the one with PA issues and the mixer levels issue I mentioned above. I haven't tested the snapshot driver on the working board, so I don't know if it is also effected by the mixer levels issue.
Also, I'm working now on non-snooping mode support, and this might help for fixing some problems like yours. Could you try the patch below (with the snapshot version)?
Unfortunately, this doesn't seem to help.
Given the similarities between the working and non-working boards, I was wondering if the BIOS is setting up the chips differently and that is the immediate cause of the problems. In particular:
- There is no set_widgets_power_state function for this chip. If the BIOS enables some power management function on one board but not the other and the driver has no way to disable it, could that cause an issue like this one?
No, as default the driver powers up all widgets and power down all again at power-saving. The VIA codec driver has an advanced implementation to turn off a few unused widgets even in power-up. And this feature is missing in VT1708. So, it doesn't mean that the driver has no power control. It has.
I see.
- I see that the VB8002 has "N/A" listed for "Pin Default" for several "Pin Complex" nodes where the EX15000G has "Jack". Is it possible the EX15000G has some nodes configured as AC_JACK_PORT_COMPLEX that should be configured as AC_JACK_PORT_NONE?
I don't know. You need to check whether the pins are really correctly set up. For example, most of jacks have the detection capability. Then plug/unplug each jack and check the pin-detection e.g. with hda-verb program.
I probably should have said so earlier, but this board has RCA connectors for most outputs. I'm not sure that pin detection works for these? In any case, the EX15000G and the VB8002 have the exact same the same physical connectors.
The only 1/8" connector is the front panel headphone jack. I checked this pin with hda-verb, and it appears to be setup correctly.
It should be clear that I do not have a very good understanding of the HDA spec. I'm assuming the BIOS is responsible for configuring the chip as I've described above. Do any of those problems sound possible to you? If so, are there ways to work around them in the driver?
Yes, pins can be easily overridden via sysfs or patch option. See Documentation/sound/alsa/HD-Audio.txt.
Okay, thanks for the info.
I experimented more and have some additional information that might be interesting:
1. The clicks and pops sound like they are actually brief snippets of audio that are being played at the wrong time and mixed in with the correct audio.
2. With the old driver, when I mute some of the mixer controls the audio stream becomes silent as expected but I still hear the snippets/clicks and pops for a few seconds. This happens with the Master Front, Headphone, Front, Surround, Center, LFE, and Side elements, although it only seems to happen with the Headphone element when I'm using the rear panel line out (RCA) jacks. I do not see this with the snapshot driver.
#2 in particular is puzzling to me, but maybe that is due to not understanding the hardware well enough.
Thanks, Forest
Hi Takashi,
On Wed, Sep 28, 2011 at 05:12:24PM -0400, Forest Bond wrote:
On Wed, Sep 28, 2011 at 07:33:49AM +0200, Takashi Iwai wrote:
At Tue, 27 Sep 2011 17:45:32 -0400, Forest Bond wrote:
On Tue, Sep 27, 2011 at 02:57:16PM +0200, Takashi Iwai wrote:
At Wed, 21 Sep 2011 13:55:53 -0400, Forest Bond wrote:
On Wed, Sep 21, 2011 at 04:43:15PM +0200, Takashi Iwai wrote:
At Wed, 21 Sep 2011 10:35:10 -0400, Forest Bond wrote: > On Wed, Sep 21, 2011 at 10:39:44AM +0200, Takashi Iwai wrote: > > At Tue, 20 Sep 2011 15:05:34 -0400, Forest Bond wrote: > > > On Tue, Sep 20, 2011 at 09:22:23AM +0200, Takashi Iwai wrote: > > > > At Mon, 19 Sep 2011 19:14:13 -0400, Forest Bond wrote: > > > > > On Fri, Sep 16, 2011 at 04:36:01PM -0400, Forest Bond wrote: > > > > > > I have two boards with a VT1708: > > > > > > > > > > > > * VIA EPIA EX15000G > > > > > > * VIA VB8002 > > > > > > > > > > > > I'm using VLC to play audio via PulseAudio to the analog outputs. The VB8002 > > > > > > sounds great, but the EX15000G has random pops and clicks in the output. Both > > > > > > machines are running exactly the same configuration (they are using the same > > > > > > pre-built OS image). > > > The crackling with PCM volume set to 0 persists with tsched=0.
[...]
> > Hrm, which PA version are you using? I remember vaguely a buggy PA > > SIMD operations in some old PA versions. > > 1:0.9.22+stable-queue-24-g67d18-0ubuntu3 from Ubuntu Lucid. > > > Also, when you mute the mixer (nor the PA's mixer), e.g. via > > "alsamixer -c0", the noise goes away, right? > > I do not use the PA mixer. The noise is present with ALSA's PCM control set to > zero (-51dB). If I move the PCM control up one tick (to -50.8dB) the noise goes > away.
OK, then it's an issue in the sound driver. Could you give alsa-info.sh outputs both mute-with-noise and without noise for comparison?
I guess we can ignore this one for now. I do not have this problem using a recent alsa-driver snapshot. The PCM control does not go below -40.25dB with this version. It's possible the new driver simply doesn't allow the control to be set to a problematic value.
I will note, however, that the master control with the snapshot has a minimum value of 0dB and a maximum of 6.75dB,
That's odd.
and that the audio is barely audible at 0dB. I have to crank the master control all the way up to get the same volume as the old driver set to 0dB. Maybe I can come up with a fix for this.
For debugging, I'd need anyway the alsa-info.sh output from the latest alsa-driver snapshot.
Okay, here you go:
http://www.alsa-project.org/db/?f=8f3da35bd1b615d199f8e71df8b012fbdf5ff690
This is the working device, right?
No, this is the one with PA issues and the mixer levels issue I mentioned above. I haven't tested the snapshot driver on the working board, so I don't know if it is also effected by the mixer levels issue.
Also, I'm working now on non-snooping mode support, and this might help for fixing some problems like yours. Could you try the patch below (with the snapshot version)?
Unfortunately, this doesn't seem to help.
Given the similarities between the working and non-working boards, I was wondering if the BIOS is setting up the chips differently and that is the immediate cause of the problems. In particular:
- There is no set_widgets_power_state function for this chip. If the BIOS enables some power management function on one board but not the other and the driver has no way to disable it, could that cause an issue like this one?
No, as default the driver powers up all widgets and power down all again at power-saving. The VIA codec driver has an advanced implementation to turn off a few unused widgets even in power-up. And this feature is missing in VT1708. So, it doesn't mean that the driver has no power control. It has.
I see.
- I see that the VB8002 has "N/A" listed for "Pin Default" for several "Pin Complex" nodes where the EX15000G has "Jack". Is it possible the EX15000G has some nodes configured as AC_JACK_PORT_COMPLEX that should be configured as AC_JACK_PORT_NONE?
I don't know. You need to check whether the pins are really correctly set up. For example, most of jacks have the detection capability. Then plug/unplug each jack and check the pin-detection e.g. with hda-verb program.
I probably should have said so earlier, but this board has RCA connectors for most outputs. I'm not sure that pin detection works for these? In any case, the EX15000G and the VB8002 have the exact same the same physical connectors.
The only 1/8" connector is the front panel headphone jack. I checked this pin with hda-verb, and it appears to be setup correctly.
It should be clear that I do not have a very good understanding of the HDA spec. I'm assuming the BIOS is responsible for configuring the chip as I've described above. Do any of those problems sound possible to you? If so, are there ways to work around them in the driver?
Yes, pins can be easily overridden via sysfs or patch option. See Documentation/sound/alsa/HD-Audio.txt.
Okay, thanks for the info.
I experimented more and have some additional information that might be interesting:
The clicks and pops sound like they are actually brief snippets of audio that are being played at the wrong time and mixed in with the correct audio.
With the old driver, when I mute some of the mixer controls the audio stream becomes silent as expected but I still hear the snippets/clicks and pops for a few seconds. This happens with the Master Front, Headphone, Front, Surround, Center, LFE, and Side elements, although it only seems to happen with the Headphone element when I'm using the rear panel line out (RCA) jacks. I do not see this with the snapshot driver.
#2 in particular is puzzling to me, but maybe that is due to not understanding the hardware well enough.
FYI, I tracked down the root cause of the clicks and pops and it's a PulseAudio issue. I'll follow up with the PA devs. It's a pretty interesting problem, so I'll probably Cc you if that's okay.
Please note that the mixer issue affecting the snapshot driver is still outstanding. I'm happy to test a fix if that's helpful. It is not an urgent matter for me, though, as the older driver version works fine.
Thanks for all of your help!
-Forest
participants (2)
-
Forest Bond
-
Takashi Iwai