Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Eric Toombs <eric@toombs.earth>
To: linux-sound@vger.kernel.org
Subject: BUG: On output devices, snd_pcm_open() makes a nasty loud tick.
Date: Wed, 16 Apr 2025 11:03:12 +0300	[thread overview]
Message-ID: <Z_9kQHrT_Pt3U7WS@robert> (raw)

Minimal reproduction:

#include <alsa/asoundlib.h>
#include <stdbool.h>
int main(int argc, const char **argv)
{
    snd_pcm_t *out;
    assert(snd_pcm_open(&out,
                "default",
                SND_PCM_STREAM_PLAYBACK,
                false         // iff nonblocking stream
                ) == 0);
}

(Compile with gcc -o test test.c -lasound.)

Relevant lspci:

00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)

uname:

Linux robert 6.13.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 23 Mar 2025 17:17:30 +0000 x86_64 GNU/Linux

alsa-lib version: 1.2.13-1 (archlinux)

I've heard similar artefacts on many different sound cards, though, across many different architectures, always on linux.
One must wait about five minutes in between trials, or the artefact does not occur.

This isn't a minor detail.
The tick is very loud and very awful.
It might even damage speakers in a worst case scenario.

This started as [a bug in alsa-lib](https://github.com/alsa-project/alsa-lib/issues/451).
They say it's a kernel issue, though.
So, here I am.

                 reply	other threads:[~2025-04-16  8:12 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=Z_9kQHrT_Pt3U7WS@robert \
    --to=eric@toombs.earth \
    --cc=linux-sound@vger.kernel.org \
    /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