From: Takashi Iwai <tiwai@suse.de>
To: Raymond Yau <superquad.vortex2@gmail.com>
Cc: manuel.jander@gmail.com, yuanhan.liu@linux.intel.com,
Fengguang Wu <fengguang.wu@intel.com>,
alsa-devel@alsa-project.org
Subject: Re: sound/pci/au88x0/au88x0_core.c:2464 vortex_interrupt() warn: if();
Date: Thu, 25 Oct 2012 13:41:44 +0200 [thread overview]
Message-ID: <s5htxtisrrb.wl%tiwai@suse.de> (raw)
In-Reply-To: <CAN8cciacCY_Bft5pz7jF+TqtH6jzz7b1MWcNB--4y7S6sZ6oqQ@mail.gmail.com>
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
prev parent reply other threads:[~2012-10-25 11:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5htxtisrrb.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=fengguang.wu@intel.com \
--cc=manuel.jander@gmail.com \
--cc=superquad.vortex2@gmail.com \
--cc=yuanhan.liu@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.