{"id":15718396,"url":"https://github.com/yxdunc/salsa","last_synced_at":"2026-04-30T00:07:12.576Z","repository":{"id":81365578,"uuid":"209301205","full_name":"yxdunc/salsa","owner":"yxdunc","description":"Simple ALSA. This repository is a set of tools and notes that ease the configuration of ALSA","archived":false,"fork":false,"pushed_at":"2019-10-23T13:25:33.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T22:29:03.536Z","etag":null,"topics":["alsa","audio-config","cli","linux","posix","salsa","tool"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yxdunc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-18T12:19:26.000Z","updated_at":"2023-07-08T08:06:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd4a9496-b37b-4e60-9812-b7a400209d34","html_url":"https://github.com/yxdunc/salsa","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yxdunc/salsa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yxdunc%2Fsalsa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yxdunc%2Fsalsa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yxdunc%2Fsalsa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yxdunc%2Fsalsa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yxdunc","download_url":"https://codeload.github.com/yxdunc/salsa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yxdunc%2Fsalsa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32448891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alsa","audio-config","cli","linux","posix","salsa","tool"],"created_at":"2024-10-03T21:52:55.993Z","updated_at":"2026-04-30T00:07:12.557Z","avatar_url":"https://github.com/yxdunc.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# salsa\nSimple ALSA. This repository is a set of tools that ease the configuration of ALSA\n\n## Usage\n\n### Main script:\n\n`sh get_usage.sh`\n\nor\n\n`watch -n1 \"sh get_usage.sh\"` (will show the output of the script continuously with a refresh every second)\n\n\n# ALSA\n\n## I. Concepts:\n\n### What is the difference between `pcm.!default` and `ctl.!default` ?\n\nThe answer is pretty simple yet not easy to find online...\n\n`pcm.!default` will define the default card used for playback and capture. It's refered to as the **PCM card.**\n\n`ctl.!default` will define the default card that is affected when changing the sound level or tuning any settings via for example: `alsamixer`. It's refered to as the **Control card.**\n\n## II. Useful tools:\n\n## Multiple read microphone (DSNOOP)\n\nWhen several processes need to access the same microphone.\n\n## Single read speaker (Loopback device)\n\nThe loopback device lets you play some audio that can then be captured by another devices **as if it was a microphone**.\n\n⚠️ Your loopback device can be loaded as any card index. (card 0/card 1/...)\n\n### Correspondance:\n\nGiven that the loopback device is loaded on card 1 (`hw:1`)\n\nAny sound that will be played to `hw:1,0,1` can be recorded here `hw:1,1,1`.\n\n`hw:1,0,0` —\u003e `hw:1,1,0`\n\n`hw:1,0,1` —\u003e `hw:1,1,1`\n\n`hw:1,0,2` —\u003e `hw:1,1,2`\n\n...\n\nWhen you want to access the output of a speaker as if it was a microphone.\n\n## Multiple write speaker (DMIX)\n\nWhen multiple processes need to send audio to the same speaker.\n\n\n## III. Example configs:\n\n### Use different cards for capture and playback\n\nInside `pcm.!default` you can use the module `asym` and set a different card for playback and capture.\n\n```\n    pcm.!default {\n        type asym\n        playback.pcm \"plughw:0\"\n        capture.pcm  \"plughw:1\"\n    }\n```\n\n⚠️ This is not possible to do something like this for the control device (`ctl`).\n\n### Enable multiple input / output on default device.\n\nsource :[https://stackoverflow.com/a/14398926/5530191](https://stackoverflow.com/a/14398926/5530191)\n\n```\n    pcm.dmixed {\n        type dmix\n        ipc_key 1024\n        ipc_key_add_uid 0\n        slave.pcm \"hw:0,0\"\n    }\n    pcm.dsnooped {\n        type dsnoop\n        ipc_key 1025\n        slave.pcm \"hw:0,0\"\n    }\n    \n    pcm.duplex {\n        type asym\n        playback.pcm \"dmixed\"\n        capture.pcm \"dsnooped\"\n    }\n    \n    # Instruct ALSA to use pcm.duplex as the default device\n    pcm.!default {\n        type plug\n        slave.pcm \"duplex\"\n    }\n    ctl.!default {\n        type hw\n        card 0\n    }\n```\n\nThis does the following:\n\n- creates a new device using the `dmix` plugin, which allows multiple apps to share the output stream\n- creates another using `dsnoop` which does the same thing for the input stream\n- merges these into a new `duplex` device that will support input and output using the `asym` plugin\n- tell ALSA to use the new `duplex` device as the default device\n- tell ALSA to use `hw:0` to control the default device (alsamixer and so on)\n\nStick this in either `~/.asoundrc` or `/etc/asound.conf` and you should be good to go.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyxdunc%2Fsalsa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyxdunc%2Fsalsa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyxdunc%2Fsalsa/lists"}