All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Patch for au88x0 driver. Fix audacious issue and add auto reset in case of hardware ADB ctrl failure.
@ 2009-09-07  1:47 Raymond Yau
       [not found] ` <21ed1c370909070232v42f31fa9y303def4cc4002b19@mail.gmail.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Raymond Yau @ 2009-09-07  1:47 UTC (permalink / raw)
  To: alsa-devel

On Thursday 03 September 2009 21:10, Manuel Jander wrote:
> does anybody still have a AU88x0 card ? I know they are quite ancient
> now, but if anyone could give the attached patch a try ? Would be
> nice.
> I made the patch against linux-2.6.30.4
> http://micro.homelinux.net/~mjander/au88x0.diff.gz <http://micro.homelinux.net/%7Emjander/au88x0.diff.gz>
>
> Best Regards,
> Manuel

Which version of audaicous (1.5.x or 2.1) are you testing ?
(alsa-gapless or alsa-ng plugin)

au88x0 most likely cannot support 1 sample per period because of the
FIFO as described in patent 6167465.

if you look at the source code of alsa-ng and alsa-gapless plugin
both of them use the own way to calculate the buffer size instead of
using snd_pcm_hw_params_get_buffer_size()


http://hg.atheme.org/audacious-plugins/file/2c0a9bba77d7/src/alsa-ng/alsa-core.c#l1

CHECK_FAIL (snd_pcm_hw_params_set_access (pcm_handle, hwparams,
SND_PCM_ACCESS_RW_INTERLEAVED), "snd_pcm_hw_params_set_access");
CHECK_FAIL (snd_pcm_hw_params_set_format (pcm_handle, hwparams, afmt),
"snd_pcm_hw_params_set_format");
CHECK_FAIL (snd_pcm_hw_params_set_channels (pcm_handle, hwparams, nch),
"snd_pcm_hw_params_set_channels");
CHECK_FAIL (snd_pcm_hw_params_set_rate (pcm_handle, hwparams, rate, 0),
"snd_pcm_hw_params_set_rate");
CHECK_FAIL (snd_pcm_hw_params (pcm_handle, hwparams), "snd_pcm_hw_params");
bitwidth = snd_pcm_format_physical_width(afmt);
bps = (rate * bitwidth * nch) >> 3;
buf_size = MAX(aud_cfg->output_buffer_size, 100);
ringbuf_size = buf_size * bps / 1000;


How do you get the "ADB Ctrl failure" error ?

There are two main problem of the au88x0 driver
1) alsa is unable to calculate the correct value for the three
functions snd_pcm_hw_params_set_buffer_time_near() ,
snd_pcm_hw_params_set_period_time_near() and snd_pcm_set_params()

https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1724

Test case :

alsa-lib/test/pcm_min.c ( change default to hw:0,0 )

Real world case:

gstreamer and winealsa.drv

2) unable to recover when the number of available src is not enough
(FATAL: ResManager: resource type 1 exhaust)

https://bugtrack.alsa-project.org/alsa-bug/view.php?id=2228

test case :

running application to use 15 src ( 7 stereo and one mono stream ) and
open another stereo stream

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Patch for au88x0 driver. Fix audacious issue and add auto reset in case of hardware ADB ctrl failure.
       [not found] ` <21ed1c370909070232v42f31fa9y303def4cc4002b19@mail.gmail.com>
@ 2009-09-08  3:41   ` Raymond Yau
  0 siblings, 0 replies; 8+ messages in thread
From: Raymond Yau @ 2009-09-08  3:41 UTC (permalink / raw)
  To: alsa-devel

2009/9/7 Manuel Jander <manuel.jander@gmail.com>

> Hi Raymond,
>
> On Mon, Sep 7, 2009 at 3:47 AM, Raymond Yau<superquad.vortex2@gmail.com>
> wrote:
> > On Thursday 03 September 2009 21:10, Manuel Jander wrote:
> >> does anybody still have a AU88x0 card ? I know they are quite ancient
> >> now, but if anyone could give the attached patch a try ? Would be
> >> nice.
> >> I made the patch against linux-2.6.30.4
> >> http://micro.homelinux.net/~mjander/au88x0.diff.gz<http://micro.homelinux.net/%7Emjander/au88x0.diff.gz><
> http://micro.homelinux.net/%7Emjander/au88x0.diff.gz>
> >>
> >> Best Regards,
> >> Manuel
> >
> > Which version of audaicous (1.5.x or 2.1) are you testing ?
> > (alsa-gapless or alsa-ng plugin)
> >
> > au88x0 most likely cannot support 1 sample per period because of the
> > FIFO as described in patent 6167465.
>
> Well, that is clear to me now. Using a DMA transfer that is smaller
> than one audio sample is not really a good idea.
> I would be better off using PIO instead of DMA.
>
> > if you look at the source code of alsa-ng and alsa-gapless plugin
> > both of them use the own way to calculate the buffer size instead of
> > using snd_pcm_hw_params_get_buffer_size()
> >
> >
> >
> http://hg.atheme.org/audacious-plugins/file/2c0a9bba77d7/src/alsa-ng/alsa-core.c#l1
> >
> > CHECK_FAIL (snd_pcm_hw_params_set_access (pcm_handle, hwparams,
> > SND_PCM_ACCESS_RW_INTERLEAVED), "snd_pcm_hw_params_set_access");
> > CHECK_FAIL (snd_pcm_hw_params_set_format (pcm_handle, hwparams, afmt),
> > "snd_pcm_hw_params_set_format");
> > CHECK_FAIL (snd_pcm_hw_params_set_channels (pcm_handle, hwparams, nch),
> > "snd_pcm_hw_params_set_channels");
> > CHECK_FAIL (snd_pcm_hw_params_set_rate (pcm_handle, hwparams, rate, 0),
> > "snd_pcm_hw_params_set_rate");
> > CHECK_FAIL (snd_pcm_hw_params (pcm_handle, hwparams),
> "snd_pcm_hw_params");
> > bitwidth = snd_pcm_format_physical_width(afmt);
> > bps = (rate * bitwidth * nch) >> 3;
> > buf_size = MAX(aud_cfg->output_buffer_size, 100);
> > ringbuf_size = buf_size * bps / 1000;
>
> I increased the minimum period bytes value to 256 in that patch.
> Audacious version 2 (Debian SID)
> works for me.
>

well,  audacious.i386    1.5.1-9.fc10   cannot play any music (alsa plugin)
on my au8830 with your patch, it only play music with (oss plugin)

Use xmms instead of audacious since they have similar UI


256 seem much bigger than the figures mentioned in the patent , may be it is
the practical limit on your VIA ITX


In one embodiment of the present invention, the FIFO buffer is 32 samples or
words in depth, which would withstand a maximum bus latency of about 4
microseconds. By way of example, if 48 DMA channels trigger simultaneously,
with a trigger level set at half the buffer size (16 samples), each DMA
channel can wait 16 samples (20 microseconds per sample), or approximately
320 microseconds before running out of data.


By way of example, CPU 210 may update-sub-buffer tables 380(0)-380(x)
routinely every 10 milliseconds. The periodic checks may be initiated by
audio processing peripheral 230 by way of interrupts, or may be scheduled
independently by the driver




> > How do you get the "ADB Ctrl failure" error ?
>
> I do not know how to reproduce that. Sometimes it happens, and its not
> possible
> to recover without a hardware reset (unload and load module). Somehow
> it semes to
> happen when my computer gets really hot (watching an MPEG-4 video, or
> compiling the kernel...).
> Its a old VIA ITX board, with a 1.3GHz processor (on demand cpufreq).
>
> The patch tries to reset the audio card if all PCM streams are
> released once such a
> condition was detected. This is the situation were the windows driver
> used to crash the
> whole machine.
>


it work quite well on my two motherbroad using intel chipset


> > There are two main problem of the au88x0 driver
> > 1) alsa is unable to calculate the correct value for the three
> > functions snd_pcm_hw_params_set_buffer_time_near() ,
> > snd_pcm_hw_params_set_period_time_near() and snd_pcm_set_params()
> >
> > https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1724
> >
> > Test case :
> >
> > alsa-lib/test/pcm_min.c ( change default to hw:0,0 )
> >
> > Real world case:
> >
> > gstreamer and winealsa.drv
>
> I will try that. I had no idea about that bugs.
>

A simple workaround is add another constraint

snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4096
);

however winealsa.drv will be using a larger period bytes than  wineoss.drv



>
> > 2) unable to recover when the number of available src is not enough
> > (FATAL: ResManager: resource type 1 exhaust)
> >
> > https://bugtrack.alsa-project.org/alsa-bug/view.php?id=2228
> >
> > test case :
> >
> > running application to use 15 src ( 7 stereo and one mono stream ) and
> > open another stereo stream
>
> Hmm, the good ol' resource manager :) OK, I will try to find a
> solution. I have not much
> time these days, but maybe it rains again, and I get bored, who knows :D
>
> Best Regards,
> Manuel
>


simple fix may be adding counts of the resource and check that all resources
are enough before allocating them

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Patch for au88x0 driver. Fix audacious issue and add auto reset in case of hardware ADB ctrl failure.
  2009-09-04  9:27 ` Daniel Glöckner
  2009-09-04  9:35   ` Takashi Iwai
@ 2009-09-04 18:26   ` Manuel Jander
  1 sibling, 0 replies; 8+ messages in thread
From: Manuel Jander @ 2009-09-04 18:26 UTC (permalink / raw)
  To: Daniel Glöckner; +Cc: alsa-devel

Hi there,

about that hunk, damn it ! I think I deleted that at least a dozen
times, and it still sneaked into the final patch :(
It should not be there.

Best Regards,
Manuel

On Fri, Sep 4, 2009 at 11:27 AM, Daniel Glöckner<dg@emlix.com> wrote:
> On 09/03/2009 10:10 PM, Manuel Jander wrote:
>> does anybody still have a AU88x0 card ? I know they are quite ancient
>> now, but if anyone could give the attached patch a try ? Would be
>> nice.
>
> I can test an AU8820 on 2.4.37 and, if you wait >9 days, an AU8810 on a recent
> kernel, but what is this hunk supposed to do?:
>
> --- linux-2.6.30.4_orig/sound/pci/au88x0/au88x0_core.c  2009-07-31 00:34:47.0000
> 00000 +0200
> +++ linux-2.6.30.4/sound/pci/au88x0/au88x0_core.c       2009-09-02 00:13:59.4671
> 19172 +0200
> @@ -2800,7 +2804,7 @@
>  {
>        int a, this_194;
>
> -       if ((bits != 8) && (bits != 16))
> +       if ((bits != 8) || (bits != 16))
>                return -1;
>
>        switch (encod) {
>
> Any special tests you want me to do? I don't think I have encountered a "Vortex:
> vortex_fifo_set*ctrl fail" message before.
>
>  Daniel
>
>
> --
> Dipl.-Math. Daniel Glöckner, emlix GmbH, http://www.emlix.com
> Fon +49 551 30664-0, Fax -11, Bahnhofsallee 1b, 37081 Göttingen, Germany
> Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
> Geschäftsführer: Dr. Uwe Kracke, Ust-IdNr.: DE 205 198 055
>
> emlix - your embedded linux partner
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Patch for au88x0 driver. Fix audacious issue and add auto reset in case of hardware ADB ctrl failure.
  2009-09-04  9:27 ` Daniel Glöckner
@ 2009-09-04  9:35   ` Takashi Iwai
  2009-09-04 18:26   ` Manuel Jander
  1 sibling, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2009-09-04  9:35 UTC (permalink / raw)
  To: Daniel Glöckner; +Cc: Manuel Jander, alsa-devel

At Fri, 04 Sep 2009 11:27:51 +0200,
Daniel Glöckner wrote:
> 
> On 09/03/2009 10:10 PM, Manuel Jander wrote:
> > does anybody still have a AU88x0 card ? I know they are quite ancient
> > now, but if anyone could give the attached patch a try ? Would be
> > nice.
> 
> I can test an AU8820 on 2.4.37 and, if you wait >9 days, an AU8810 on a recent
> kernel, but what is this hunk supposed to do?:
> 
> --- linux-2.6.30.4_orig/sound/pci/au88x0/au88x0_core.c  2009-07-31 00:34:47.0000
> 00000 +0200
> +++ linux-2.6.30.4/sound/pci/au88x0/au88x0_core.c       2009-09-02 00:13:59.4671
> 19172 +0200
> @@ -2800,7 +2804,7 @@
>  {
>  	int a, this_194;
> 
> -	if ((bits != 8) && (bits != 16))
> +	if ((bits != 8) || (bits != 16))
>  		return -1;
> 
>  	switch (encod) {

This reverts the upstream fix in commit
83807400794a1d680a4fb70a610c5f486e734f45.
I guess Manuel just overlooked this upstream fix.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Patch for au88x0 driver. Fix audacious issue and add auto reset in case of hardware ADB ctrl failure.
  2009-09-03 20:10 Manuel Jander
  2009-09-04  8:49 ` Alan Horstmann
@ 2009-09-04  9:27 ` Daniel Glöckner
  2009-09-04  9:35   ` Takashi Iwai
  2009-09-04 18:26   ` Manuel Jander
  1 sibling, 2 replies; 8+ messages in thread
From: Daniel Glöckner @ 2009-09-04  9:27 UTC (permalink / raw)
  To: Manuel Jander; +Cc: alsa-devel

On 09/03/2009 10:10 PM, Manuel Jander wrote:
> does anybody still have a AU88x0 card ? I know they are quite ancient
> now, but if anyone could give the attached patch a try ? Would be
> nice.

I can test an AU8820 on 2.4.37 and, if you wait >9 days, an AU8810 on a recent
kernel, but what is this hunk supposed to do?:

--- linux-2.6.30.4_orig/sound/pci/au88x0/au88x0_core.c  2009-07-31 00:34:47.0000
00000 +0200
+++ linux-2.6.30.4/sound/pci/au88x0/au88x0_core.c       2009-09-02 00:13:59.4671
19172 +0200
@@ -2800,7 +2804,7 @@
 {
 	int a, this_194;

-	if ((bits != 8) && (bits != 16))
+	if ((bits != 8) || (bits != 16))
 		return -1;

 	switch (encod) {

Any special tests you want me to do? I don't think I have encountered a "Vortex:
vortex_fifo_set*ctrl fail" message before.

  Daniel


-- 
Dipl.-Math. Daniel Glöckner, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax -11, Bahnhofsallee 1b, 37081 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführer: Dr. Uwe Kracke, Ust-IdNr.: DE 205 198 055

emlix - your embedded linux partner

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Patch for au88x0 driver. Fix audacious issue and add auto reset in case of hardware ADB ctrl failure.
  2009-09-03 20:10 Manuel Jander
@ 2009-09-04  8:49 ` Alan Horstmann
  2009-09-04  9:27 ` Daniel Glöckner
  1 sibling, 0 replies; 8+ messages in thread
From: Alan Horstmann @ 2009-09-04  8:49 UTC (permalink / raw)
  To: Manuel Jander; +Cc: ALSA devel

On Thursday 03 September 2009 21:10, Manuel Jander wrote:
> does anybody still have a AU88x0 card ? I know they are quite ancient
> now, but if anyone could give the attached patch a try ? Would be
> nice.
> I made the patch against linux-2.6.30.4
> http://micro.homelinux.net/~mjander/au88x0.diff.gz
>
> Best Regards,
> Manuel

Well, I do have one of these in the PC to provide general-purpose sound 
alongside ice1712 for quality stuff, so in principle could try your patch.  
What is it intended to achieve?  My Alsa is not very up-to-date, but that 
possibly won't matter anyway?

I'll try and get a chance in the next week or so if that is any help.

Alan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Patch for au88x0 driver. Fix audacious issue and add auto reset in case of hardware ADB ctrl failure.
@ 2009-09-03 20:10 Manuel Jander
  2009-09-04  8:49 ` Alan Horstmann
  2009-09-04  9:27 ` Daniel Glöckner
  0 siblings, 2 replies; 8+ messages in thread
From: Manuel Jander @ 2009-09-03 20:10 UTC (permalink / raw)
  To: alsa-devel

Hi,

does anybody still have a AU88x0 card ? I know they are quite ancient
now, but if anyone could give the attached patch a try ? Would be
nice.
I made the patch against linux-2.6.30.4
http://micro.homelinux.net/~mjander/au88x0.diff.gz

Best Regards,
Manuel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Patch for au88x0 driver. Fix audacious issue and add auto reset in case of hardware ADB ctrl failure.
@ 2009-09-01 22:31 Manuel Jander
  0 siblings, 0 replies; 8+ messages in thread
From: Manuel Jander @ 2009-09-01 22:31 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

Hi,

does anybody still have a AU88x0 card ? I know they are quite ancient
now, but if anyone could give the attached patch a try ? Would be
nice.
I made the patch against linux-2.6.30.4

Best Regards,
Manuel

[-- Attachment #2: au88x0.diff.gz --]
[-- Type: application/x-gzip, Size: 2272 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-09-08  3:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-07  1:47 Patch for au88x0 driver. Fix audacious issue and add auto reset in case of hardware ADB ctrl failure Raymond Yau
     [not found] ` <21ed1c370909070232v42f31fa9y303def4cc4002b19@mail.gmail.com>
2009-09-08  3:41   ` Raymond Yau
  -- strict thread matches above, loose matches on Subject: below --
2009-09-03 20:10 Manuel Jander
2009-09-04  8:49 ` Alan Horstmann
2009-09-04  9:27 ` Daniel Glöckner
2009-09-04  9:35   ` Takashi Iwai
2009-09-04 18:26   ` Manuel Jander
2009-09-01 22:31 Manuel Jander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.