1.7 KiB
← Back to Twitter thread index
title: "Settings I'm using for snd_pcm_sw_params for ALSA, don't have docs for all of th" author: "NOTimothyLottes" handle: "@NOTimothyLottes" post_url: "https://x.com/NOTimothyLottes/status/2072506103401754653" post_id: "2072506103401754653" timestamp: "2026-07-02 02:22:15" post_count: 4 reply_count: 1 repost_count: 0 like_count: 4 view_count: 773
@NOTimothyLottes — Settings I'm using for snd_pcm_sw_params for ALSA, don't have docs for all of th
Post 1 (2026-07-02 02:22:15)
Settings I'm using for snd_pcm_sw_params for ALSA, don't have docs for all of this, seems to work. I'm doing 64 frame period size on a double buffer right now without any thread priority, and not getting xruns, so not yet sure of bad behavior
Post 2 (2026-07-02 02:28:27) — reply to Post 1
I put in a forced thread sleep between writes to force a xrun, and SNDRV_PCM_IOCTL_WRITEI_FRAMES kernel call then returns -32, in which case I run a SNDRV_PCM_IOCTL_PREPARE and then just get back to the write loop, seems to restore normal playback just fine.
Post 3 (2026-07-02 02:42:11) — reply to Post 2
I reduced asound.h to this basically, the most minimal thing I found I needed. Now I also rename a few things (like structure names), and my IOCTL macros are slightly different in composition than standard.
Post 4 (2026-07-02 02:45:11) — reply to Post 3
After getting this far, it actually looks quite easy, but the route to this was filled with garbage sifting because I couldn't easily find someone else who did this kind of minimalization. I'm only supporting 48KHz stereo 16-bit signed, with double buffering = keep it simple.

