Kuşatma Ses
Wiki.Pardus-Linux.Org sitesinden
surround51 ve surround40 genel PCM (Atım Modu Modülasyonu (Pulse Code Modulation)) olarak 6 (5.1 olarak da bilinmektedir) ve 4 (4.0 olarak da bilinmektedir) kanal analoğ çıktı için tanımdır. ALSA sürücüsü 5.1 veya 4.0 analog çıktıyı desteklediği zaman, ALSA-lib için uygun yapılandırma dosyası saydam olarak kuşatma51 (surround51) ve kuşatma40 (surround40) tanımlarını içerir. Kullanımı çok basittir. Sadece surround51 veya surround40 PCM ismi olarak geçin...
aplay -Dsurround51 foo.wav
foo.wav 6 kanal stereo örneği içeren bir WAV dosyasıdır. Şunu unutmayınki kuşatma51 (surround51) ve kuşatma40 (surround40) analog olarak farz edilmektedir, dijital AC3/DTS olarak değil. Onlar hiç bir şeyi kodlamazlar. Onlar sadece çoklu kanal PCM'yi desteklerler.
Konu başlıkları |
Kuşatma PCM üzerine ek notlar
Greg Lee tarafından
- Şuanki aplay sürümü bir wav dosyasından kanal sayısını okuyup size, komut satırında aygıtı belirlemenize gerek kalmadan otomatikman 6 yada 4 kanal ses verecektir. Ancak, tıpkı yukarıda açıklandığı gibi, eğer aygıtı siz açıkça belirtirseniz daha iyi ses verir. "-Dsurround51" olmadan, belkide aplay gerçek 6 kanal sesin eklenti canlandırmasını yapıyor olacak.
- Test etmek için altı kanallı wave dosyaları bulmak çok zordur. burada birkaç örnek altı kanal wave dosyası ftp://ling.lll.hawaii.edu/pub/greg/Surround-SDL-testfiles.tgz adresinde bulunmaktadır, ayrıca gt ile ulaşılan bazı altı kanallı ogg'ler ftp://ling.lll.hawaii.edu/pub/greg/gt-demo.tar.gz adresindeki tar arşivinde bulunmaktadır.
- Web'de bulabileceğiniz wave genişletilebilir biçimli ALSA'nın beklentileri dışında sırayla birleştirilmiş (interleaved) kanallara sahip bazı altı kanallı dosyalar(merkez ve lfe sol ve sağ arkadan önce gelir) bulabilirsiniz. Bu bir MS işidir. bunları sfplay ile çalabilirsiniz, basit bir komut satırı oynatıcısı I Erik de Castro Lopo'nun libsndfile dağıtımındaki örnek bir programdan uyarlanmıştır. sfplay wave genişletibilir dosyları algılar ve kanal sırasını ALSA'nın çalabileceği şekilde değiştirir. sfplay için kaynak kodlar ftp://ling.lll.hawaii.edu/pub/greg/surround-utils-0.0.1.tar.gz arşivindedir, ayrıcı bu çalışan 6 kanal wave dosyaları için başka araçlarda içermektedir. Onları derlemek için libsndfile dosyasına ihtiyacınız var: http://www.mega-nerd.com/libsndfile/libsndfile-1.0.9.tar.gz, veya şuanki güncel sürümü neyse o.
- Kuşatma aygıtları için Alsa'da timidity'nin bir sürümü vardır. GusSoundfont'un sayfasında kaynak kodları ile açıklanmıştır ftp://ling.lll.hawaii.edu/pub/greg/gt-0.3.tar.gz.
- Şuan ki SDL'nin CVS sürümü , popüler bir oyun programlama kütüphanesidir, 4 ve 6 kanal ses Alsa desteği vardır.
Kuşatma çıktılarına sinyalleri özel yöneltme
- Not:
- ALSA'nın 1.0.14rc2'den önceki sürümlerinin bazılarının çoklu kanal LADSPA Eklentileri] ilgili problemi vardır. Eğer acayip bir davranış tecrübesi edinirseniz, elinizdeki sürümü belirtilen sürümün üzerine çıkarmanız gerekir. LADSPA ile düşük geçişli(lowpass) filitreleme için ayrıca Nasıl:subwoofer kanalı için düşük geçişli filitreleme yapılır.
Biraz .asoundrc hacklemesi ile, basitçe sinyalleri istediğiniz gibi yönlendirebilirsiniz. Örneğin stereo sinyalini ön ve arka hopörlörden çalmayının nasıl olduğunu ögrenmek için, Bakınız kuşatma ses ayarlarında stereo çalmak (nasıl). Örneğin basitçe sizin ihtiyaçlarınıza göre ayarlanabilir. Bu nasıl belgesi normal stereo sinyallerinin 4 veya 5 hopörlöre dağıtacağımızı anlatıyor. Düşük geçişli filitre ile bu işlemi subwoofer'a uygulamakda güzel olurdu. The Howto tells us how to route our "normal" stereo signals to 4 or 5 speakers. Bu LADSPA eklentilerinin kullanışlı olduğu durumdur:
pcm.lowpass {
type ladspa
slave.pcm ...
path "/usr/lib/ladspa"
plugins [ {
label lpf
input {
controls [ 50 ]
}
} ]
}
Bu filitre 50 Hz.altındaki bütün herşeyi kesecektir. Tek sorun: Nasıl bu filitre üzerinden sadece bir kanal yollayabilirim ( sol ve sağ kanalın bir karışımı)? ve filitrelenmiş sinyali nereye yolladım? Ben bu ayarı denedim:
# move channel 0 to channel 2
pcm.move0to2 {
type route
slave.pcm 3to6
slave.channels 3
ttable.0.2 1
}
# 3to6 has 3 input and 6 output channels
# the stereo signal is on ch. 0 and 1
# ch.0 is copied to 0 and 2 (front and rear)
# ch.1 is copied to 1 and 3 (front and rear)
# ch.0 and ch.1 will is mixed to ch.4 (center)
# ch.2 is routed to ch.5 (subwoofer)
pcm.3to6 {
type route
slave.pcm "surround51"
slave.channels 6
ttable.0.0 1
ttable.1.1 1
ttable.0.2 1
ttable.1.3 1
ttable.0.4 0.5
ttable.1.4 0.5
ttable.2.5 1
}
Bu düşük geçiş filitresinden çalışarak çıktı verecek gibi görünüyor (ben şunu denedim, aplay -D ```plug:lowpass``` sound.wav). Ama hala bir soru var - bir kanaldaki veriyi nasıl düşük geçiş filitresine alırım ?
güncelleme 18 Nisan 2006 - alsa 1.0.11rc2'den beridir, ladspa eklentisi çoklu kanal ladsa eklentilerini ele alabiliyor. 3 kanallı ladspa eklentisi ile 2 kanal, düşük geçiş filitreli bir kanaldan geçirilerek, istenilen efekt elde edilebilir.
Soru: Biri şunu açıklayabilirmi, bu düşük geçiş filitresi nasıl sadece LFE kanalına, Ladspa eklentileri ile uygulanabilir?
Cevap:
- libasound2 sürüö 1.0.11-7bpo.1 Debian Sarge'de kurulduktan sonra .
- Örnek ayar - giriş 1 mono kanal ve alt kanal (0-sub,1-normal mono) için:
pcm.ice2_11cutoffsub {
type ladspa
slave.pcm ice_plug
path "/usr/lib/ladspa"
plugins {
0 {
label lp4pole_fcrcia_oa
policy none
input.bindings.0 "Input";
output.bindings.0 "Output";
input {
controls [ 300 0 ]
}
}
1 {
label delay_5s
input.bindings.0 "Input";
output.bindings.0 "Output";
input {
controls [ 0 0 ]
}
}
}
}
Diğer örnek ayar - stereo kanal ve alt kanal (0,1-stereo,2-sub):
pcm.ice2_21cutoffsub {
type ladspa
slave.pcm ice_plug
path "/usr/lib/ladspa"
plugins {
0 {
label lp4pole_fcrcia_oa
policy none
input.bindings.2 "Input";
output.bindings.2 "Output";
input {
controls [ 300 0 ]
}
}
1 {
label delay_0.01s
input.bindings.0 "Input";
output.bindings.0 "Output";
input {
controls [ 0 1 ]
}
}
}
}
Hiç bir kod göremiyorum, ama görünüşe göre bütün ALSA kanllarını en azından 1 eklentiyle kapsamalısınız - en azından benim ALSA sürümümle öyle. Görünürde - eğer diğer kanalları alsa eklentirinden geçirmezseniz, o kanaldan ses alamazsınız. Kontrol et beni!
Soru: Ben hepsini duyarak filitre seçtim, ama kim onun en iyi olduğunu biliyor ve neden?
JACK ile kuşatmaXX PCM'leri kullanmak
Benim SBLive'ım ile, çıplak surround40 aygıtı JACK ile kullanılamıyor. Burada iki problem var:
- The individual channels are laid out in memory in a non-contiguous way, which prevents JACK from using mmap() on them (hope that's accurate, please review), and
- JACK assumes that all output channels correspond to capture channels and tries to open four ins as well, while the card only has two. Simply using the --inchannels option of jackd does not work.
So we need to create a new virtual device that will be mmap()able and has 2 ins and 4 outs. TakashiIwai helped out with some magic incantations to add to your .asoundrc:
ctl.jack40 {
type hw
card 0
}
pcm.jack40 {
# "asym" allows for different
# handling of in/out devices
type asym
playback.pcm {
# route for mmap workaround
type route
slave.pcm surround40
ttable.0.0 1
ttable.1.1 1
ttable.2.2 1
ttable.3.3 1
}
capture.pcm {
# 2 channels only
type hw
card 0
}
}
Now you can start jackd with two inputs and four outputs:
jackd -d alsa --device jack40 --inchannels 2 --outchannels 4
For 5.1 cards, there is probably a similar spell. I only have 2 stereo outs on my card, so I can't test other setups. If you get 5.1 or other configurations to work, please add them here. On the older (dual-DAC) CMedia CMI8738, the above asoundrc setup works with:
jackd -d alsa --device jack40 --playback --outchannels 4
and the --outchannels switch can be omitted. You can't get capture inputs at the same time (I'm assuming because the ADC is busy driving the rear channels) but you do get four-way audio outputs.
For 5.1 sound, this .asoundrc works just fine
ctl.jack51 {
type hw
card 0
}
pcm.jack51 {
# "asym" allows for different
# handling of in/out devices
type asym
playback.pcm {
# route for mmap workaround
type plug
slave.pcm "surround51"
slave.channels 6
route_policy duplicate
}
capture.pcm {
# 2 channels only
type hw
card 0
}
}
Just start JACK with
jackd -d alsa --device jack51 --inchannels 2 --outchannels 6
Using Surround and Mplayer or Xine
I had a problem where speaker-test worked for my alsa configuration but Xine didn't. I also never got my 7.1 surround system to work past 4.0...until I used the following for Xine (.xine/config):
audio.device.alsa_surround40_device:plughw:0,1
and
audio.device.alsa_surround51_device:plughw:0,1
Mplayer is similar:
mplayer -channels 6 -ao alsa:mmap:noblock:device=hw=0.1 dvd://4
Now I have Center, LFE, rear, and front. I should have side as well, but I haven't tested that yet. You can check your /proc/asound/card0/pcmXp/info files (replace X with the device #) to play with the 0,1 (or 0.1) to try it out.
The first number is the card number and the second is the device # on the card. Usually the device with multiple devices is your surround, but I am still confused by this. When using plughw, it is backwards of what I expected in /proc, but when I set up sections in my .asoundrc, it seems to follow what is in /proc.
Hope that helps someone! It took me a year and a half and countless hours to get this to finally work on my 64-Bit Asus A8V Deluxe (via8237 -> snd-via82xx).
Troubleshooting
Are you sure your speakers are plugged in properly? Sound cards that are integrated into the motherboard often have only three jacks: line out, line in, and microphone. Most of the time, the front speakers miniplug should go in the line out jack and the rear speakers miniplug should go in the line in jack. On at least one system with the VT8237 integrated audio chip, the rear speakers miniplug should go in the microphone jack for proper surround output.
İlgili Bağlantılar
- Kaynak: Resmi olmayan Alsa wikisi: http://alsa.opensrc.org/index.php/SurroundSound
- http://www.halfgaar.net/surround-sound-in-linux - Oyunlar için çalışan kuşatma ses alabilmek için nelerin gerekli olduğunu gösteriyor. OpenAL yapılandırmasını içermektedir.
