Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Giuliano Pochini <pochini@shiny.it>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel <alsa-devel@lists.sourceforge.net>
Subject: Re: period crossing page boundary
Date: 19 Mar 2003 21:06:20 +0000	[thread overview]
Message-ID: <1048107985.985.58.camel@Jay> (raw)
In-Reply-To: <s5hel53s2ud.wl@alsa2.suse.de>

> > I'm facing another *£%@ problem. When period size is a multiple or
> > submultiple of PAGE_SIZE, it works fine, but when it isn't, sound
> > clicks, pops, repeapeapeats, skps :(( And since the period never crosses
> > physically the page boundary because I split it when it happens, I can't
> > imagine what's wrong. Perhaps some of you had the same problem.
> > 
> > .period callback does this:
> 
> do you mean pointer callback?

Yes, sorry. 

> > bufsize=substream->runtime->periods*substream->runtime->period_size;
>
> you already have substream->runtime->buffer_size for this.
They are different:

[aplay <no options> track.wav]
Mar 19 19:21:23 localhost kernel: pcm_hw_params (bufsize=88200 periods=3
persize=22052) 

bufsize==88200 != 3*22052 == 66156 

> > //addr==number of bytes transferred.
> > pos=bytes_to_frames(substream->runtime, addr);
> > return(pos%bufsize);
>
> i suppose addr is updated in the interrupt handler, right?

No, I read it from the hardware every time. I tried to store the value
in the irq handler and it's the same.

>
> > Here is a log of sg list construction:
> > [...]
>
> the logs seem fine.
>
> did you set up page callback, too?

Yes I did.

> were the irqs issued correctly with the 1.5 page periods?
> i mean, at the proper timing?

Yes, I believe. When period size is 2048 or 1024 it works fine. I put a
printk in the pointer callback to monitor the frame position and it always
seems correct despite the bad output. "irq" is a command I insert in the
sg list, because the hw don't generate it automatically at the and of each
block. IMO the bug is around the .pointer callback function.

> maybe it would be easier to debug if you show the actual code and the
> hardware spec...

I'm writing my driver around the open source generic driver released by
the manufacturer (in C++ argh!). I'm trying to keep the generic code
as-is to make upgrades to future releases easier. I don't have hw specs
but the sources are full of comments. As far as I can see there are no
hw limits about the size of the sg list and its entries.

You can get my (very-ugly-pre-alpha) sources here:
http://space.virgilio.it/g_pochini@virgilio.it/ea.tgz
and the generic driver here:
http://www.echoaudio.com/Downloads/Developer/EchoGenericDriverA0.zip


Bye.




-------------------------------------------------------
This SF.net email is sponsored by: Does your code think in ink?
You could win a Tablet PC. Get a free Tablet PC hat just for playing.
What are you waiting for?
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en

  reply	other threads:[~2003-03-19 21:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-19 12:24 period crossing page boundary Giuliano Pochini
2003-03-19 17:06 ` Takashi Iwai
2003-03-19 21:06   ` Giuliano Pochini [this message]
2003-03-19 20:16     ` Jaroslav Kysela
2003-03-20  9:04       ` Giuliano Pochini
2003-03-20 10:37         ` Takashi Iwai
2003-03-20 14:13           ` Giuliano Pochini
2003-03-20 14:24             ` Jaroslav Kysela
2003-03-20 14:45               ` Takashi Iwai

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=1048107985.985.58.camel@Jay \
    --to=pochini@shiny.it \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox