All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wischer, Timo (ADITG/ESB)" <twischer@de.adit-jv.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: [PATCH - JACK PCM plugin] jack: Use boundary as hw_ptr wrap around
Date: Thu, 15 Feb 2018 10:36:21 +0000	[thread overview]
Message-ID: <B0FB33DC1499054591F62C0EF1E013D7684F9297@HI2EXCH01.adit-jv.com> (raw)
In-Reply-To: <s5hd1183jq3.wl-tiwai@suse.de>

Hello Takashi,

> This happens only when the application uses periods=1,

It can also happen with 2 periods per buffer e.g. when the user application is too late.
I will try to illustrate the use case with the following time line:

Time line: 0--R1-W1-R2--R3-W2-W3-...

0 buffer is full (2 periods)
R1 JACK daemon reads 1 period (1 period left in the buffer)
W1 User application writes 1 period (2 periods in the buffer)
R2 JACK daemon reads 1 period (1 period left in the buffer)
R3 JACK daemon reads 1 period (buffer empty)
But it is not yet an under run because JACK has not yet read invalid data.
Due to the blocked user application (e.g low scheduling priority) the pointer() callback was not called before the second read.
In this case the next pointer() call has to result in a delta of 2 periods.
But this is not possible if pointer() is not allowed to return >=buffer_size.

W2 User application writes 1 period (1 periods in the buffer)
W3 User application writes 1 period (2 periods in the buffer)
Continue with 0

> It notifies the period elapse via file-descriptor
But this notification will be processed later if the user application is blocked at the moment (e.g. by higher priority tasks).

Do you also see my problem, now?

Best regards

Timo Wischer

Advanced Driver Information Technology GmbH
Engineering Software Base (ADITG/ESB)
Robert-Bosch-Str. 200
31139 Hildesheim
Germany

Tel. +49 5121 49 6938
Fax +49 5121 49 6999
twischer@de.adit-jv.com

ADIT is a joint venture company of Robert Bosch GmbH/Robert Bosch Car Multimedia GmbH and DENSO Corporation
Sitz: Hildesheim, Registergericht: Amtsgericht Hildesheim HRB 3438
Geschäftsführung: Wilhelm Grabow, Ken Yaguchi

  reply	other threads:[~2018-02-15 10:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 11:49 [PATCH - JACK PCM plugin] jack: Use boundary as hw_ptr wrap around twischer
2018-02-09 13:11 ` Wischer, Timo (ADITG/ESB)
2018-02-13  5:40 ` Takashi Iwai
2018-02-13 14:56   ` Wischer, Timo (ADITG/ESB)
2018-02-13 17:03     ` Takashi Iwai
2018-02-15 10:36       ` Wischer, Timo (ADITG/ESB) [this message]
2018-02-15 11:32         ` Takashi Iwai
2018-02-23  9:28           ` [PATCH IO plug API 1/1] ioplug: Use boundary for " twischer
2018-02-23 10:40             ` Takashi Iwai
2018-02-23 13:52               ` Takashi Iwai
2018-02-23 14:18                 ` [PATCH - JACK PCM plugin] jack: Use boundary as hw_ptr " twischer
2018-02-24 10:43                   ` 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=B0FB33DC1499054591F62C0EF1E013D7684F9297@HI2EXCH01.adit-jv.com \
    --to=twischer@de.adit-jv.com \
    --cc=alsa-devel@alsa-project.org \
    --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 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.