tips:linux:arch:hardware:start

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
tips:linux:arch:hardware:start [2026/01/13 20:37] – [サウンドまわり on 実機] asaasatips:linux:arch:hardware:start [2026/07/06 19:29] (現在) – [USBスピーカーの節電対策 (音が序盤欠けるとか短時間音が鳴らないとか)] asaasa
行 16: 行 16:
 ===== サウンドまわり on 実機 ===== ===== サウンドまわり on 実機 =====
  
 +==== USBスピーカーの節電対策 (音が序盤欠けるとか短時間音が鳴らないとか) ====
 +  * sox コマンドで 1hz の音声を流し続ける (2026/07時点)
 +    * 以下のコマンド ( pacman -S sox でいれておく前提 ) で問題解消を確認すること
 +
 +<code bash>
 +user$ play -q -n repeat - synth sin 1 vol 0.001
 +        #コマンドの意味 //  -q: ログ出力を非表示にします。-n: 入力ファイルなし(生成モード)。synth sin 1: 1Hzのサイン波(無音)を生成します。vol 0.001: 音量を極小にします。
 +        
 +</code>
 +
 +sox コマンドで問題解消されるなら、下記のとおりユーザーサービスを登録してログイン直後から自動で無音に近い「音を流し続ける」状態にもっていく。
 +
 +<code bash>
 +user$ mkdir -p ~/.config/systemd/user
 +user$ nano ~/.config/systemd/user/usb-speaker-keepalive.service
 +</code>
 +<code ini>
 +[Unit]
 +Description=Keep USB Speaker Alive
 +After=pipewire.service wireplumber.service
 +
 +[Service]
 +Type=simple
 +ExecStart=/usr/bin/play -q -n repeat - synth sin 1 vol 0.001
 +Restart=always
 +RestartSec=2
 +
 +[Install]
 +WantedBy=default.target
 +</code>
 +<code bash>
 +user$ systemctl --user daemon-reload
 +user$ systemctl --user enable --now usb-speaker-keepalive.service # 有効化
 +user$ systemctl --user status usb-speaker-keepalive.service       # 状況確認
 +
 +user$ #停止は systemctl --user stop usb-speaker-keepalive.service # で止まる。
 +</code>
 +
 +  * WirePlumberでサスペンドを無効化 する手法 (2026/07時点)
 +    * ただし **安物USBスピーカー** には事実上効かない orz
 +
 +<code bash>
 +user$ sudo mkdir -p /etc/wireplumber/wireplumber.conf.d
 +user$ sudo nano /etc/wireplumber/wireplumber.conf.d/51-disable-suspend.conf
 +</code>
 +
 +<code>
 +monitor.alsa.rules = [
 +  {
 +    matches = [
 +      {
 +        node.name = "~alsa_output.*"
 +      }
 +    ]
 +    actions = {
 +      update-props = {
 +        session.suspend-timeout-seconds = 0
 +      }
 +    }
 +  }
 +]
 +</code>
 +
 +<code bash>
 +user$ systemctl --user restart wireplumber
 +user$ systemctl --user restart pipewire
 +</code>
 +
 +
 +==== サウンドの手動切り替え ====
 古いゲームとかのサウンド設定は「音量調節」などでは切り替わらないため、起動前に下記コマンドを実施すると良い。(TAB補完 は bash / zsh のタブによる自動補完 ) 古いゲームとかのサウンド設定は「音量調節」などでは切り替わらないため、起動前に下記コマンドを実施すると良い。(TAB補完 は bash / zsh のタブによる自動補完 )
  
  • tips/linux/arch/hardware/start.1768304275.txt.gz
  • 最終更新: 2026/01/13 20:37
  • by asaasa