<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 23, 2018 at 4:41 PM,  <span dir="ltr"><<a href="mailto:o@goosey.org" target="_blank">o@goosey.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><br>
<br>
23.06.2018, 14:52, "Subhashini Rao Beerisetty" <<a href="mailto:subhashbeerisetty@gmail.com">subhashbeerisetty@gmail.com</a>>:<br>
> Hello All,<br>
<br>
Hello,<br>
<span><br>
<br>
> I’m trying to understand how audio samples transferred between user mode to kernel mode during playback and capture. I’m using aplay & arecord alsa utilities for playback and capture.<br>
><br>
> Let us take a PCM wav file of sample rate 48000 and it has a total number of samples 480000 (Approx.Duration in seconds=10). Size of each sample is 8 bytes(two channels). After invocation of aplay from user mode, how does these audio samples gets copied to kernel mode? Can someone explain me on this?<br>
><br>
> Is it possible to capture the timestamps for the first and last audio samples that arrive at the driver level?<br>
><br>
> Can I consider the .trigger(for playback & capture) callback in SNDRV_PCM_TRIGGER_START  case is timestamp for the first audio sample?<br>
><br>
> Similarly does .trigger callbacks SNDRV_PCM_TRIGGER_STOP gives the last audio sample timestamp?<br>
<br>
</span>I think no, because the SNDRV_PCM_TRIGGER_START and SNDRV_PCM_TRIGGER_STOP functions only system call to the PCM transmitted.<br>
So, will want two different functions as playback / capture and the method depends on you use alsa or pulse.<br>
<br>
I think you want to:<br>
<br>
snd_mychip_playback_open<br>
snd_mychip_playback_close<br>
<br>
snd_mychip_capture_open<br>
snd_mychip_capture_close<br></blockquote><div>Are these part of "struct snd_pcm_ops" .open & .close?<span><span>  If so timestamps captured at these API's gives the first and last audio sample timestamps?</span></span></div><div><span><span>
<br>
Trigger funcs times are not real playback or capture time-stamps.<br>
<br>
Regards<br>
<br>
Ozgur<br>
<br>
> Thanks,<br></span></span></div>
</div><br></div></div>