アプリケーションとスピーカーに音声出力を送信する

アプリケーションとスピーカーに音声出力を送信する

私はパーティーで音楽を再生するためにUbuntu 14.04 LTSノートブックを使用しています。私はMixxxを使用しており、これに非常に効果的です。これで、照明効果を追加してQlcplusを使用する予定です。そのため、MixxxのサウンドをサウンドカードとQlcplusに送信する必要があります。

ALSAループバックにサウンドを送信し、Qlcplusから回復するようにMixxxを正常に設定しました。ところで音は出力されません。 ALSAループバックのサウンドをスピーカーにルーティングするには?

ベストアンサー1

多くの検索の最後に私の質問に対する答えを見つけました。 ALSAを正しく構成する必要があります。 ALSAは、送信されたサウンドをサウンドカードやループバックデバイスなどの2つ以上のデバイスにコピーする新しいデバイスを提供します。

私が使用する.asoundrcファイルは次のとおりです。

# If you want this to be the default, then you
# need to override the default device and provide
# a playback path to the CardAndLoop and a capture
# path to whatever soundcard you have (here the 1st card)
#pcm.!default {
#  type asym
#  playback.pcm "CardAndLoop"
#  capture.pcm "hw:0,0"
#}

# This is the interface you use for sound output
# It will send the output to the soundcard and loopback device
pcm.CardAndLoop {
  type plug
  slave.pcm MultiCh
  route_policy "duplicate"
}

# Virtual multichannel device with four channels
# two the for the soundcard, two for the loopback
pcm.MultiCh {
  type multi
  slaves.a.pcm pcm.MixCard
  slaves.a.channels 2
  slaves.b.pcm pcm.MixLoopback
  slaves.b.channels 2
  bindings.0.slave a
  bindings.0.channel 0
  bindings.1.slave a
  bindings.1.channel 1
  bindings.2.slave b
  bindings.2.channel 0
  bindings.3.slave b
  bindings.3.channel 1
}

# Mixer for the soundcard
pcm.MixCard {
  type dmix
  ipc_key 1024
  slave {
#    pcm "hw:Conectiv,0"
    pcm "hw:PCH,0"
#    rate 48000
    rate 44100
    periods 128
    period_time 0
    period_size 1024 # must be power of 2
    buffer_size 8192
  }
}

# Mixer for the loopback
pcm.MixLoopback {
  type dmix
  ipc_key 1025
  slave {
    pcm "hw:Loopback,0"
#    rate 48000
    rate 44100
    periods 128
    period_time 0
    period_size 1024 # must be power of 2
    buffer_size 8192
  }
}

このファイルは、新しいALSAサウンドデバイス「CardAndLoop」を提供します。サウンドアプリケーションでこのデバイスを選択すると、サウンドは「PCH」サウンドカードとループバックデバイスに転送されます。 2番目のアプリケーションを実行し、ループバックデバイスを入力として使用すると、最初のアプリケーションでサウンドが再生されます。

私はサウンドデバイスの名前を名前で指定します。これらの名前は/proc/asound/cardsファイルから入手できます。

$ cat /proc/asound/cards
0 [PCH            ]: HDA-Intel - HDA Intel PCH
                     HDA Intel PCH at 0xf5330000 irq 44
2 [Loopback       ]: Loopback - Loopback
                     Loopback 1

楽しくお過ごしください!

おすすめ記事