# ALSA (Advanced Linux Sound Architecture) 設定

**URL:** https://forum.ficusonline.com/t/topic/490
**Category:** Linux
**Created:** [2023 年 9 月 5 日午後 2:56 UTC](https://forum.ficusonline.com/t/topic/490 "2023-09-05T14:56:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2023 年 9 月 5 日午後 2:56 UTC](https://forum.ficusonline.com/t/topic/490/1 "2023-09-05T14:56:27Z")

</div>

Raspberry PiでUSBマイクを利用する場合の音声入力設定と、3.5mmオーディオジャック、HDMIから音声出力するための音声出力設定はALSAにて行います。設定項目やALSA関連のコマンドがややこしいのでここで纏めます。

#### ALSA本家

[https://alsa.opensrc.org/](https://alsa.opensrc.org/)

#### ALSA Wiki(Arch Linux)

[Advanced Linux Sound Architecture - ArchWiki](https://wiki.archlinux.org/title/Advanced_Linux_Sound_Architecture#:~:text=The%20Advanced%20Linux%20Sound%20Architecture,for%20high%20level%20API%20development).

#### インストールパッケージ

```auto
alsa-base/stable,now 1.0.27+1 all [installed]
  dummy package to ease purging of obsolete conffiles

alsa-utils/stable,now 1.2.4-1+rpt1 armhf [installed]
  Utilities for configuring and using ALSA

```

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2023 年 9 月 6 日午前 12:11 UTC](https://forum.ficusonline.com/t/topic/490/2 "2023-09-06T00:11:59Z")

</div>

### Softvol

ソフトウェアによって新しい音量コントロールを追加し、音声の音量またはその一部を制御することができる、ALSAプラグイン。サウンドカードがハードウェアによる音量制御を行えない場合やアプリケーション自体が音量制御を行えない場合でも音量を個別に制御できます。

[https://alsa.opensrc.org/Softvol](https://alsa.opensrc.org/Softvol)

### Dsnoop

dsnoop は dmix プラグインと同等ですが、サウンドを録音するためのものです。 dsnoop プラグインを使用すると、複数のアプリケーションが同じデバイスから同時に録音できるようになります。

[https://alsa.opensrc.org/Dsnoop](https://alsa.opensrc.org/Dsnoop)

### Dmix

複数のストリームを直接ミキシングする機能を提供。  
**注）** ALSA 1.0.9rc2以降では、 **アナログ出力のためにdmixを設定する必要はありません** 。ハードウェアミキシングをサポートしないサウンドカードに対して、dmixはデフォルトで有効になっています。ただし、デジタル出力に対しては引き続き設定する必要があります。

[https://alsa.opensrc.org/Dmix](https://alsa.opensrc.org/Dmix)

### Asym

asymは、dsnoopやdmixなどの半二重PCMプラグインを1つの全二重デバイスに結合するALSA PCMプラグイン。ALSAバージョン1.0.1以降から、asymはALSAに含まれています。

[https://alsa.opensrc.org/Asym](https://alsa.opensrc.org/Asym)

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2025 年 1 月 20 日午前 5:39 UTC](https://forum.ficusonline.com/t/topic/490/3 "2025-01-20T05:39:20Z")

</div>

### alsemixer : 再起動後に設定がリセット

[https://forums.debian.net/viewtopic.php?t=155066](https://forums.debian.net/viewtopic.php?t=155066)

rootユーザでのログインに起因するかもしれませんが、.asoundrcのalsamixerの設定が再起動後に読み込まれない問題が発生。

1はcardナンバー：aplay -l で確認

```shell
# alsactl store 1

```

ALSA設定の確認

```shell
# cat /var/lib/alsa/asound.state

```

ALSA設定クリア

```shell
# rm -f /var/lib/alsa/asound.state
# alsactl restore

```

> <https://stackoverflow.com/questions/76333959/alsa-failed-to-import-hw0-use-case-configuration-2>

```shell
# alsactl --no-ucm restore

```

`ucm` は **Use Case Manager** の略で、ALSA (Advanced Linux Sound Architecture) のユースケース管理システムです。

ALSA には、特定のハードウェアのための設定を管理する仕組みがあり、**Use Case Manager (UCM)** は、音声の異なるユースケース (例: 音楽再生、通話、録音 など) に応じた設定を適用するための仕組みです。

Yocto で Raspberry Pi 2 を使っている環境では、UCMが正しく構成されていない可能性があるため、このオプションを指定。
