All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Hills <mark@xwax.org>
To: alsa-devel@alsa-project.org
Cc: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Subject: Can't get snd-aloop in sync with another device
Date: Thu, 8 Jul 2021 17:24:39 +0100 (BST)	[thread overview]
Message-ID: <2107081637250.26064@stax.localdomain> (raw)

I use dmix+snd-aloop for all local applications; then forwarded to the 
dmix+Layla3G using a custom C program.

Despite asking for clock sync, they slowly drift. Am I doing something 
wrong?

  $ echo hw:Layla3G,0,0 > /proc/asound/Loopback/timer_source

The forwarder drains its buffer and eventually underruns. Loopback is not 
providing enough audio to feed Layla3G -- drifts by about 9 samples/second 
at 48kHz.

This _feels_ like a regression; I'm pretty sure this was perfectly in time 
before. I'd need to bisect kernel and alsa-lib changes.

Below shows the status during playback/capture.

The timer is definitely connected in some way. It's listed below, and 
aloop ticking corresponds to whether Layla3G is open by any application 
(not just the forwarder)

-- 
Mark



$ cat /proc/asound/Loopback/cable#0
Cable 0 substream 0:
  inactive
Cable 0 substream 1:
  inactive
Cable 0 substream 2:
  inactive
Cable 0 substream 3:
  valid: 3
  running: 3
  pause: 0
  Playback
    buffer_size:        65536
    buffer_pos:         12800
    silent_size:        0
    period_size:        512
    bytes_per_sec:      384000
    sample_align:       8
    rate_shift:         0
    sound timer:        hw:0,0,0
    timer open:         playback
  Capture
    buffer_size:        65536
    buffer_pos:         53760
    silent_size:        0
    period_size:        512
    bytes_per_sec:      384000
    sample_align:       8
    rate_shift:         0
    sound timer:        hw:0,0,0
    timer open:         playback
Cable 0 substream 4:
  inactive
Cable 0 substream 5:
  inactive
Cable 0 substream 6:
  inactive
Cable 0 substream 7:
  inactive


                 reply	other threads:[~2021-07-08 16:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=2107081637250.26064@stax.localdomain \
    --to=mark@xwax.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=andrew_gabbasov@mentor.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 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.