From: Takashi Iwai <tiwai@suse.de>
To: Chakravarthi Pradeep <doubleq7@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Fwd: ALSA queries
Date: Thu, 09 Aug 2018 16:40:11 +0200 [thread overview]
Message-ID: <s5hr2j7vc1g.wl-tiwai@suse.de> (raw)
In-Reply-To: <CALW20Z0wy_=J0sXx3erh7hg8iRGgMaJ+PfoDDFdMDSsS1EY+Gg@mail.gmail.com>
On Thu, 09 Aug 2018 13:19:53 +0200,
Chakravarthi Pradeep wrote:
>
> Hi Takashi,
>
> How to enable log from ALSA lib core or ALSA core , so that I will
> come to know why trigger stop call back is getting called back by
> itself.
Do printk, tracing, whatever you can see.
We have the standard tracepoints, too, but maybe it's not what you
need.
> ring bufffer size is 57600 and minimum bytes device generates per
> period is 3200(bytes). I have read one frame is 4 bytes from below
> link.
> https://www.alsa-project.org/main/index.php/FramesPeriods
> So is it correct to give below values to snd_pcm_hardware
> .period_bytes_min = 3200 /* per interrupt device provides minimum 3200
> bytes of data*/
> .periods_min = 72 /* 3200/4 /* 4 is because of (2 (channel )* (16 bits/2)) */
period_bytes_min is 3200 bytes, so it looks correct.
But periods_min is the minimal number of periods in a ring buffer.
It can be calculated as (min buffer size) / (max period size).
Takashi
>
> Regards,
> Chakravarthi
> On Tue, Aug 7, 2018 at 7:13 PM Takashi Iwai <tiwai@suse.de> wrote:
> >
> > On Tue, 07 Aug 2018 15:36:22 +0200,
> > Chakravarthi Pradeep wrote:
> > >
> > > >In the case above it's in frames. But it can be defined in bytes
> > > >depending on the hardware spec. Some hardware defines in the time
> > > >unit (like msec), too.
> > >
> > > Can you please tell me how to define in bytes ?
> >
> > Read the source before asking like this. If not found, read the
> > source again. If still it's not fulfilled, ask more specific
> > questions.
> >
> > The driver doesn't define it. Rather the driver lets ALSA PCM core
> > choose the parameters given from user-space. But some parameters
> > might not fit with the requirement of your hardware. For satisfying
> > it, the driver may give hw constraints to PCM core beforehand,
> > typically set in the open callback.
> >
> > > >Now you know it. And remember that PA is often die-hard.
> > > So it means that I can not do rmmod until pulseaudio is removed , is
> > > it correct ?
> >
> > Yes. You cannot rmmod during any program is accessing to the sound
> > device, not only PA.
> >
> >
> > Takashi
> >
> > > Regards,
> > > Chakravarthi
> > > On Tue, Aug 7, 2018 at 6:45 PM Takashi Iwai <tiwai@suse.de> wrote:
> > > >
> > > > On Tue, 07 Aug 2018 15:12:08 +0200,
> > > > Chakravarthi Pradeep wrote:
> > > > >
> > > > > Dear Takashi,
> > > > >
> > > > > Thanks for your reply.
> > > > >
> > > > > > The "period" in ALSA PCM definition represents the interval time (or
> > > > > > frames) of the periodical interrupts on the ring buffer. If the irq
> > > > > > is issued for each 256 frames while the ring buffer size is 1024
> > > > > > frames, periods = 1024/256 = 4. The periods_min defines the minimal
> > > > > > number of periods the hardware may accept.
> > > > >
> > > > > Is it 256 frames or 256 bytes ?
> > > >
> > > > In the case above it's in frames. But it can be defined in bytes
> > > > depending on the hardware spec. Some hardware defines in the time
> > > > unit (like msec), too.
> > > >
> > > > > fuser -v /dev/snd/* output is
> > > > > USER
> > > > > PID ACCESS COMMAND
> > > > > /dev/snd/controlC0 Dell 1815
> > > > > F..... pulseaudio
> > > >
> > > > Now you know it. And remember that PA is often die-hard.
> > > >
> > > >
> > > > Takashi
> > >
> > >
> > >
> > > --
> > > Thanks and Regards
> > > Chakravarthi Pradeep.K
> > > Ph: 91 9980434900
> > >
>
>
>
> --
> Thanks and Regards
> Chakravarthi Pradeep.K
> Ph: 91 9980434900
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
prev parent reply other threads:[~2018-08-09 14:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 14:31 ALSA queries Chakravarthi Pradeep
2018-08-03 3:16 ` Chakravarthi Pradeep
2018-08-03 7:35 ` Takashi Iwai
[not found] ` <CALW20Z1YFqnbUE51Wbm38VaNL2Yr4osyMeGJmHrabfQvAY_1VQ@mail.gmail.com>
2018-08-05 18:07 ` Chakravarthi Pradeep
2018-08-05 18:09 ` Fwd: " Chakravarthi Pradeep
2018-08-05 18:24 ` Takashi Iwai
2018-08-06 12:29 ` Chakravarthi Pradeep
2018-08-06 12:51 ` Takashi Iwai
2018-08-06 13:23 ` Chakravarthi Pradeep
2018-08-06 13:32 ` Takashi Iwai
2018-08-06 15:24 ` Chakravarthi Pradeep
2018-08-06 15:30 ` Takashi Iwai
2018-08-07 11:59 ` Chakravarthi Pradeep
2018-08-07 12:03 ` Takashi Iwai
2018-08-07 12:08 ` Chakravarthi Pradeep
2018-08-07 12:11 ` Takashi Iwai
2018-08-07 12:14 ` Chakravarthi Pradeep
2018-08-07 12:18 ` Takashi Iwai
2018-08-07 13:12 ` Chakravarthi Pradeep
2018-08-07 13:15 ` Takashi Iwai
2018-08-07 13:36 ` Chakravarthi Pradeep
2018-08-07 13:43 ` Takashi Iwai
2018-08-09 11:19 ` Chakravarthi Pradeep
2018-08-09 14:40 ` 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=s5hr2j7vc1g.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=doubleq7@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox