orklev2-alsa

orklev2-alsa is a skill for Claude Code, Codex from tweakoz/orkid. It costs 70 tokens per session (802 once invoked), scanned A, original, MIT.

A reference guide to orkid's Linux ALSA audio backend, which sends synthesized sound to the operating system's audio devices.

In plain words
What is it for?
Use it to answer questions about ALSA device setup, PCM output, audio buffer queues, float-to-int16 conversion, and XRUN recovery.
Why use it?
It explains the separate synthesizer and audio threads, their shared buffers, and recovery from playback interruptions.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/tweakoz/orkid/orklev2-alsa
Any agent
npx skills add tweakoz/orkid --skill orklev2-alsa
Clone the repo
git clone --depth 1 https://github.com/tweakoz/orkid

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for orklev2-alsa

README.md
[![agentmods](https://agentmods.dev/badge/skills/tweakoz/orkid/orklev2-alsa.svg)](https://agentmods.dev/skills/tweakoz/orkid/orklev2-alsa)
Your own site
<a href="https://agentmods.dev/skills/tweakoz/orkid/orklev2-alsa"><img src="https://agentmods.dev/badge/skills/tweakoz/orkid/orklev2-alsa.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 802 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00070 $0.00802
Opus 5 $0.00035 $0.00401
Sonnet 5 $0.00014 $0.00160
Haiku 4.5 $0.00007 $0.00080

Measured 3d ago against content hash a5500db4e66c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

orklev2-alsa scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/orklev2-alsa/SKILL.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Orkid ALSA Backend Reference

When answering questions about the ALSA audio backend in orkid, consult the files below. All under ork.lev2/.

Key Files

Component File
AudioDevice Base inc/ork/lev2/aud/audiodevice.h
AudioDeviceAlsa src/aud/alsa/audiodevice_alsa.h
Implementation src/aud/alsa/audiodevice_alsa.cpp
Config Flags inc/ork/lev2/config.h (ENABLE_ALSA, Linux only)

Architecture

Dual-thread design with producer/consumer buffer queues:

Synth Thread                          ALSA Thread
───────────                           ───────────
pop empty buf ← _multibufProducer     pop filled buf ← _multibufConsumer
synth->compute()                      snd_pcm_writei(buf)
float→int16 convert                   handle XRUN (snd_pcm_prepare)
push filled buf → _multibufConsumer   push empty buf → _multibufProducer

PrivateImplementation

Member Description
_synth Singularity synth instance
_alsaThread Thread writing to PCM device
_synthThread Thread running synth compute
_float_buf DSP buffer (float) for synth output
_numframes Buffer size (256 frames)
_multibufProducer Queue of empty int16 buffers
_multibufConsumer Queue of filled int16 buffers
_execstate Atomic: 0=init, 1=running, 2=shutting_down, 3=stopped

Buffer pool: 4 buffers (KBUFFERCOUNT) of 256 frames x 2 channels x int16.

PCM Configuration

  • Device: "default"
  • Format: SND_PCM_FORMAT_S16_LE (signed 16-bit little-endian)
  • Channels: 2 (stereo)
  • Sample Rate: 48000 Hz
  • Access: SND_PCM_ACCESS_RW_INTERLEAVED
  • Buffer Frames: 256 (DESIRED_NUMFRAMES)

Synth Thread

  1. Pop empty buffer from producer queue
  2. synth->compute(numframes, float_buf)
  3. Read synth->_obuf._leftBuffer / _rightBuffer
  4. Convert float → int16 with gain 16384.0
  5. Interleave L/R into buffer
  6. Push filled buffer to consumer queue

Read the full file on GitHub · 84 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 84 lines · 70 tokens per session scan A a5500db4e66c

Subscribe to this mod's changes

orklev2-alsa is a skill published in the GitHub repository tweakoz/orkid (35 stars, last pushed 22d ago), licensed MIT. It adds 70 tokens to every session and 802 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.

Related

Other skills, from other repositories

musicbox

Use when the user wants to play/pause/skip music, control volume, seek, search songs/playlists, query NetEase Music data, or operate NetEase MusicBox. Drives MusicBox through the musicbox CLI + daemon; never simulates terminal keypresses to the curses TUI.

darknessomi/musicbox · 65 tokens

seedance-audio

This skill should be used when the user asks for Seedance 2.0 audio, dialogue, lip-sync, music, sound effects, ambience, beat-sync, audio-reference mapping, desync troubleshooting, or sound-driven visual timing.

Emily2040/seedance-2.0 · 52 tokens

seedance-vfx

This skill should be used when the user asks for VFX, particles, energy, destruction, transformation, weather effects, magical effects, explosions, smoke, fire, water, or physically plausible effects in Seedance 2.0.

Emily2040/seedance-2.0 · 52 tokens

metasounds

Create and modify MetaSound Source assets — add/connect nodes, wire pins, set input defaults, and play procedurally (MetaSoundService). Use when the user asks to create a MetaSound, build or edit a MetaSound graph, add operator/input/output nodes, or generate procedural audio.

kevinpbuckley/VibeUE · 63 tokens

image-gen

Generate images from text prompts via DashScope/Qwen. Use when creating, drawing, or illustrating images.

alibaba/anolisa · 24 tokens

videoagent-audio-studio

Tired of juggling multiple audio APIs? This skill gives you one-command access to TTS, music generation, sound effects, and voice cloning. Use when you want to generate any audio without managing multiple API keys.

pexoai/pexo-skills · 50 tokens