All of lore.kernel.org
 help / color / mirror / Atom feed
* sound/pci/au88x0/au88x0_core.c:2464 vortex_interrupt() warn: if();
       [not found] <508695b0.hStka2PI8YeAmkAt%fengguang.wu@intel.com>
@ 2012-10-23 14:16 ` Fengguang Wu
  2012-10-23 14:35   ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Fengguang Wu @ 2012-10-23 14:16 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Raymond Yau, yuanhan.liu

Hi,

smatch warns about a weird "if();" in sound/pci/au88x0/au88x0_core.c 
Any ideas to fix it?

        2461 #ifndef CHIP_AU8810
        2462                 for (i = 0; i < NR_WT; i++) {
        2463                         if (vortex->dma_wt[i].fifo_status == FIFO_START) {
==>     2464                                 if (vortex_wtdma_bufshift(vortex, i)) ;
        2465                                 spin_unlock(&vortex->lock);
        2466                                 snd_pcm_period_elapsed(vortex->dma_wt[i].
        2467                                                        substream);
        2468                                 spin_lock(&vortex->lock);
        2469                         }
        2470                 }
        2471 #endif     

Thanks,
Fengguang

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

* Re: sound/pci/au88x0/au88x0_core.c:2464 vortex_interrupt() warn: if();
  2012-10-23 14:16 ` sound/pci/au88x0/au88x0_core.c:2464 vortex_interrupt() warn: if(); Fengguang Wu
@ 2012-10-23 14:35   ` Takashi Iwai
       [not found]     ` <CAN8cciZH6+rxuVpp5QtenFMs1PHaPnyusF2mVRMWEDhnWuCR8Q@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2012-10-23 14:35 UTC (permalink / raw)
  To: Fengguang Wu; +Cc: Raymond Yau, alsa-devel, yuanhan.liu

At Tue, 23 Oct 2012 22:16:42 +0800,
Fengguang Wu wrote:
> 
> Hi,
> 
> smatch warns about a weird "if();" in sound/pci/au88x0/au88x0_core.c 
> Any ideas to fix it?
> 
>         2461 #ifndef CHIP_AU8810
>         2462                 for (i = 0; i < NR_WT; i++) {
>         2463                         if (vortex->dma_wt[i].fifo_status == FIFO_START) {
> ==>     2464                                 if (vortex_wtdma_bufshift(vortex, i)) ;
>         2465                                 spin_unlock(&vortex->lock);
>         2466                                 snd_pcm_period_elapsed(vortex->dma_wt[i].
>         2467                                                        substream);
>         2468                                 spin_lock(&vortex->lock);
>         2469                         }
>         2470                 }
>         2471 #endif     

A quick fix is below, but I'm not 100% sure about it yet.
Let's see.


thanks,

Takashi

---
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
index 525f881..3fe3dbe 100644
--- a/sound/pci/au88x0/au88x0_core.c
+++ b/sound/pci/au88x0/au88x0_core.c
@@ -2461,7 +2461,8 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
 #ifndef CHIP_AU8810
 		for (i = 0; i < NR_WT; i++) {
 			if (vortex->dma_wt[i].fifo_status == FIFO_START) {
-				if (vortex_wtdma_bufshift(vortex, i)) ;
+				if (!vortex_wtdma_bufshift(vortex, i))
+					continue;
 				spin_unlock(&vortex->lock);
 				snd_pcm_period_elapsed(vortex->dma_wt[i].
 						       substream);

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

* Re: sound/pci/au88x0/au88x0_core.c:2464 vortex_interrupt() warn: if();
       [not found]     ` <CAN8cciZH6+rxuVpp5QtenFMs1PHaPnyusF2mVRMWEDhnWuCR8Q@mail.gmail.com>
@ 2012-10-25  4:05       ` Raymond Yau
  2012-10-25 11:41         ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Raymond Yau @ 2012-10-25  4:05 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: manuel.jander, yuanhan.liu, Fengguang Wu, alsa-devel

2012-10-23 下午10:35 於 "Takashi Iwai" <tiwai@suse.de> 寫道:
>
> At Tue, 23 Oct 2012 22:16:42 +0800,
> Fengguang Wu wrote:
> >
> > Hi,
> >
> > smatch warns about a weird "if();" in sound/pci/au88x0/au88x0_core.c
> > Any ideas to fix it?
> >
> >         2461 #ifndef CHIP_AU8810
> >         2462                 for (i = 0; i < NR_WT; i++) {
> >         2463                         if (vortex->dma_wt[i].fifo_status
== FIFO_START) {
> > ==>     2464                                 if
(vortex_wtdma_bufshift(vortex, i)) ;
> >         2465                                 spin_unlock(&vortex->lock);
> >         2466
snd_pcm_period_elapsed(vortex->dma_wt[i].
> >         2467
 substream);
> >         2468                                 spin_lock(&vortex->lock);
> >         2469                         }
> >         2470                 }
> >         2471 #endif
>
> A quick fix is below, but I'm not 100% sure about it yet.
> Let's see.

using aplay with  VORTEX_PCM_WT , only a very low high frequency signal is
heard  and after 10 seconds

aplay: pcm_write:1702: write error: Input/output error

refer to the patent 6167465 the wavetable DMA channels operate slightly
different from the non-wavetable DMA channels

it seem that the driver still cannot send the increment wavetable pointer
signal and the increment count signal , thus fifo controller does not reach
the trigger level to request for a dma transfer

may need some code to use the sound card's timer interrupt to send
increment wavetable pointer signal to provide pitching by perform sample
rate conversion on the data through interpolation and looping

BTW au88x0 still missing channel map

/* pre-allocation of Scatter-Gather buffers */

snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
      snd_dma_pci_data(chip->pci_dev),
      0x10000, 0x10000);

+if (VORTEX_PCM_TYPE(pcm) == VORTEX_PCM_ADB) {
+       err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
+                                    snd_pcm_std_chmaps, 4, 0, NULL);
+       if (err < 0)
+               return err;
+  }
if (VORTEX_PCM_TYPE(pcm) == VORTEX_PCM_SPDIF) {

http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=3fc13d6f5b08edee49b106cd711d51bf3aef6ab7;hp=662f79d4ec6b52bbaab28d5a9b60cc8bcdf042f9

how about capture stream since test/chmap can open capture stream ?

case 's':
                       if (*optarg == 'c' || *optarg == 'C')
                               stream = SND_PCM_STREAM_CAPTURE;
                       else
                               stream = SND_PCM_STREAM_PLAYBACK;
                       break;

do VORTEX_PCM_A3D need a mono channel map since device 2 only support mono
playback with spatalization to stereo output ?

how about the mono channel map of emu10k1 and trident ?
>
>
> thanks,
>
> Takashi
>
> ---
> diff --git a/sound/pci/au88x0/au88x0_core.c
b/sound/pci/au88x0/au88x0_core.c
> index 525f881..3fe3dbe 100644
> --- a/sound/pci/au88x0/au88x0_core.c
> +++ b/sound/pci/au88x0/au88x0_core.c
> @@ -2461,7 +2461,8 @@ static irqreturn_t vortex_interrupt(int irq, void
*dev_id)
>  #ifndef CHIP_AU8810
>                 for (i = 0; i < NR_WT; i++) {
>                         if (vortex->dma_wt[i].fifo_status == FIFO_START) {
> -                               if (vortex_wtdma_bufshift(vortex, i)) ;
> +                               if (!vortex_wtdma_bufshift(vortex, i))
> +                                       continue;
>                                 spin_unlock(&vortex->lock);
>                                 snd_pcm_period_elapsed(vortex->dma_wt[i].
>                                                        substream);
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: sound/pci/au88x0/au88x0_core.c:2464 vortex_interrupt() warn: if();
  2012-10-25  4:05       ` Raymond Yau
@ 2012-10-25 11:41         ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2012-10-25 11:41 UTC (permalink / raw)
  To: Raymond Yau; +Cc: manuel.jander, yuanhan.liu, Fengguang Wu, alsa-devel

At Thu, 25 Oct 2012 12:05:03 +0800,
Raymond Yau wrote:
> 
> 2012-10-23 下午10:35 於 "Takashi Iwai" <tiwai@suse.de> 寫道:
> >
> > At Tue, 23 Oct 2012 22:16:42 +0800,
> > Fengguang Wu wrote:
> > >
> > > Hi,
> > >
> > > smatch warns about a weird "if();" in sound/pci/au88x0/au88x0_core.c
> > > Any ideas to fix it?
> > >
> > >         2461 #ifndef CHIP_AU8810
> > >         2462                 for (i = 0; i < NR_WT; i++) {
> > >         2463                         if (vortex->dma_wt[i].fifo_status
> == FIFO_START) {
> > > ==>     2464                                 if
> (vortex_wtdma_bufshift(vortex, i)) ;
> > >         2465                                 spin_unlock(&vortex->lock);
> > >         2466
> snd_pcm_period_elapsed(vortex->dma_wt[i].
> > >         2467
>  substream);
> > >         2468                                 spin_lock(&vortex->lock);
> > >         2469                         }
> > >         2470                 }
> > >         2471 #endif
> >
> > A quick fix is below, but I'm not 100% sure about it yet.
> > Let's see.
> 
> using aplay with  VORTEX_PCM_WT , only a very low high frequency signal is
> heard  and after 10 seconds
> 
> aplay: pcm_write:1702: write error: Input/output error
> 
> refer to the patent 6167465 the wavetable DMA channels operate slightly
> different from the non-wavetable DMA channels

OK, so the return value isn't reliable in this case, so we should keep
the code as is but better with some comment.

> it seem that the driver still cannot send the increment wavetable pointer
> signal and the increment count signal , thus fifo controller does not reach
> the trigger level to request for a dma transfer
> 
> may need some code to use the sound card's timer interrupt to send
> increment wavetable pointer signal to provide pitching by perform sample
> rate conversion on the data through interpolation and looping
> 
> BTW au88x0 still missing channel map

All below are irrelevant with this issue.  Please start separate mail
threads if needed.

In short: give a patch for au88x0 chmap support if you'd like to
have :)  For emu10k1 and trident, chmap is supported rather in
alsa-lib configuration.  It's not 100% perfect but it's good enough to
cover 99% use cases.


Takashi


> 
> /* pre-allocation of Scatter-Gather buffers */
> 
> snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
>       snd_dma_pci_data(chip->pci_dev),
>       0x10000, 0x10000);
> 
> +if (VORTEX_PCM_TYPE(pcm) == VORTEX_PCM_ADB) {
> +       err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
> +                                    snd_pcm_std_chmaps, 4, 0, NULL);
> +       if (err < 0)
> +               return err;
> +  }
> if (VORTEX_PCM_TYPE(pcm) == VORTEX_PCM_SPDIF) {
> 
> http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=3fc13d6f5b08edee49b106cd711d51bf3aef6ab7;hp=662f79d4ec6b52bbaab28d5a9b60cc8bcdf042f9
> 
> how about capture stream since test/chmap can open capture stream ?
> 
> case 's':
>                        if (*optarg == 'c' || *optarg == 'C')
>                                stream = SND_PCM_STREAM_CAPTURE;
>                        else
>                                stream = SND_PCM_STREAM_PLAYBACK;
>                        break;
> 
> do VORTEX_PCM_A3D need a mono channel map since device 2 only support mono
> playback with spatalization to stereo output ?
> 
> how about the mono channel map of emu10k1 and trident ?
> >
> >
> > thanks,
> >
> > Takashi
> >
> > ---
> > diff --git a/sound/pci/au88x0/au88x0_core.c
> b/sound/pci/au88x0/au88x0_core.c
> > index 525f881..3fe3dbe 100644
> > --- a/sound/pci/au88x0/au88x0_core.c
> > +++ b/sound/pci/au88x0/au88x0_core.c
> > @@ -2461,7 +2461,8 @@ static irqreturn_t vortex_interrupt(int irq, void
> *dev_id)
> >  #ifndef CHIP_AU8810
> >                 for (i = 0; i < NR_WT; i++) {
> >                         if (vortex->dma_wt[i].fifo_status == FIFO_START) {
> > -                               if (vortex_wtdma_bufshift(vortex, i)) ;
> > +                               if (!vortex_wtdma_bufshift(vortex, i))
> > +                                       continue;
> >                                 spin_unlock(&vortex->lock);
> >                                 snd_pcm_period_elapsed(vortex->dma_wt[i].
> >                                                        substream);
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2012-10-25 11:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <508695b0.hStka2PI8YeAmkAt%fengguang.wu@intel.com>
2012-10-23 14:16 ` sound/pci/au88x0/au88x0_core.c:2464 vortex_interrupt() warn: if(); Fengguang Wu
2012-10-23 14:35   ` Takashi Iwai
     [not found]     ` <CAN8cciZH6+rxuVpp5QtenFMs1PHaPnyusF2mVRMWEDhnWuCR8Q@mail.gmail.com>
2012-10-25  4:05       ` Raymond Yau
2012-10-25 11:41         ` Takashi Iwai

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.