Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Raphaël Dingé" <raphael.dinge@ohmforce.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Can't detect "XRUNs"
Date: Wed, 04 Jul 2018 17:14:42 +0200	[thread overview]
Message-ID: <s5hy3eruj6l.wl-tiwai@suse.de> (raw)
In-Reply-To: <CAL-i0qEuJda-YRFUn6EMg2eiBMRq4+nnju4r=T1dnUEZBuFA8Q@mail.gmail.com>

On Wed, 04 Jul 2018 17:11:17 +0200,
Raphaël Dingé wrote:
> 
> > I'm going back to the program to see if there is anything suspect.
> 
> So I got back to the program and put a bit more logging. I have new
> results, but they are even more confusing.
> 
> Here is the part that writes to the buffer :
> 
>     snd_pcm_wait(pcm, 1000 /* milliseconds */);
>     snd_pcm_sframes_t avail = snd_pcm_avail_update(pcm);
>     if (avail < 0)
>     {
>       std::cout << "snd_pcm_avail_update failed\n";
>       snd_pcm_recover (pcm, avail, 1);
>    }
> 
>     snd_pcm_sframes_t nb_written = snd_pcm_writei(pcm, &buffer[0],
> frames_per_buffer);
>     if (nb_written < 0) {
>       std::cout << "snd_pcm_writei failed\n";
>       snd_pcm_recover(pcm, nb_written, 1 /* silent */);
>       xrun_count++;
>     }
> 
> Not sure if this is the proper way, didn't write it myself, but looks
> more or less legit.
> 
> When I launch the program, nothing is output to the console.
> 
> But! If I echo 1 > xrun_injection, then I have "snd_pcm_avail_update
> failed" systematically.
> 
> However at the same time, no events are traces in
> /sys/kernel/debug/tracing/trace

You applied my patch, right?  Otherwise the xrun injection won't
trigger the xrun tracing event by itself, just calling
snd_pcm_stop().


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2018-07-04 15:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04 10:26 Can't detect "XRUNs" Raphaël Dingé
2018-07-04 10:33 ` Takashi Iwai
2018-07-04 10:38   ` Raphaël Dingé
2018-07-04 12:11     ` Raphaël Dingé
2018-07-04 13:16       ` Takashi Iwai
2018-07-04 13:49         ` Raphaël Dingé
2018-07-04 14:02           ` Takashi Iwai
2018-07-04 14:16             ` Raphaël Dingé
2018-07-04 15:11               ` Raphaël Dingé
2018-07-04 15:14                 ` Takashi Iwai [this message]
2018-07-04 15:16                   ` Raphaël Dingé
2018-07-04 15:49                     ` Raphaël Dingé
2018-07-04 15:56                       ` Takashi Iwai
2018-07-04 16:06                         ` Raphaël Dingé
2018-07-05  9:10                           ` Raphaël Dingé
2018-07-05 10:05                             ` Takashi Iwai
2018-07-05 10:59                               ` Raphaël Dingé
2018-07-05 12:34                                 ` Raphaël Dingé
2018-07-05 15:02                                   ` 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=s5hy3eruj6l.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=raphael.dinge@ohmforce.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