• Welcome to the Pipe Organ Forum! This is a part of the open community Magle International Music Forums focused on pipe organs (also known as "church organs"), organists, organ music and related topics.

    This forum is intended to be a friendly place where technically advanced organists and beginners (or even non-organists) can feel comfortable having discussions and asking questions. We learn by reading and asking questions, and it is hoped that the beginners (or non-organists) will feel free to ask even the simplest questions, and that the more advanced organists will patiently answer these questions. On the other hand, we encourage complex, technical discussions of technique, music, organ-building, etc. The opinions and observations of a diverse group of people from around the world should prove to be interesting and stimulating to all of us.

    As pipe organ discussions can sometimes become lively, it should be pointed out that this is an open forum. Statements made here are the opinion of the poster, and not necessarily that of the forum itself, its administrator, or its moderators.

    In order to post a new topic - or reply to existing ones - you may join and become a member by clicking on Register New User. It's completely free and only requires a working email address (in order to confirm your registration - it will never be given away!). We strive to make this a friendly and informative forum for anyone interested in pipe organs and organ music.

    (Note: If you wish to link to and promote your own website please read this thread first.)

    Many kind regards
    smile.gif

    Frederik Magle
    Administrator

    Krummhorn
    Co-Administrator

multi-channel audio setup with low latency for virtual organ

oleg68

New member
Hello!

I'd like to share my experience of making an inexpensive multi-channel audio setup with a virtual organ for using at home. I use GrandOrgue under linux, but most of tips are still valid for other OS and simulators.

I'd like to build multi-channel audio system: two front speakers, two surround and optionally one subwoofer. It may be used, for example, with surround samplesets or you may put reveberation output to the surround speakers only.

Most of us have similar 5.1 speaker system in a home theatre. It'd like to share it with a virtual organ for cost reducing.

The home theatre usually has a AV receiver that allows to connect with several sound sources (computer, dvd, tuner etc).

The question is how to connect these 5.1 loudspeakers to the computer.

There are several options:

1. Analog connections (RCA). You need some semi-professional sound card (ex. m-audio delta 1010 lt) for low latency.

1.1. You need to have several active loudspeakers, or passive loudspeakers with at least two stereo amplifiers. It is quite expensive and does not allow sharing with a home theatre.

1.2. Analog 5.1 connection to the AV receiver.

1.2.1. Most of AV receivers has such input port, but not all of them allows easy switch the input source between RCA 5.1 and other ports (my Marantz 5006 cann't do it with a control knob and it is need to enter to the menu).

1.2.2. You need a huge amount of cables. If there is a distance between the computer more than 1-2 meters then some interference will arrive.

1.2.3. AV receivers has digital audio signal processing. So there will be
3 gigital-analog conversions: the soundcard: from digital to analog, the AV receiver: from analog to digital before the sound processing and from digital to analog - after. It decreases the quality of sound.

2. s/pdif optical or coaxial connection to a AV receiver. This still requires a semi-professional soundcard for a low latency.

The disadvantages:

2.1. If there is a distance between the computer and AV receiver, the optical cable is too expensive.

2.2. s/pdif can transfer only 2-channel stereo uncompressed signal, without surround.

2.2.1. You can compress 5.1 audio stream with a a software dodby digital (ac3) encoder.

2.2.1.1. But it requires a complex program setup that increases latency.

2.2.1.2. It requires reformatting samples from 24-bit to 16-bit, that decreases the sound quality.

2.2.2. You can compress 5.1 audio stream with a software DTS interacive encoder.

2.2.2.1 - the same problem as 2.2.1.1

2.2.2.2. There is no legal implementation of such encoder for linux.

3. Use two s/pdif connections with two sound cards

The disadvantages

3.1. AV receivers can not play sound from two s/pdif sources at the same time.

3.2. It's difficult to setup two soundcards in GO and other programs

4. HDMI connection to the AV-receiver. It allows to transfer up to 8 sound channels.

The disadvantages:

4.1. If you use HDMI port of a video card, the latency wil be poor (100 ms and above).

4.2. There are no available modern sound cards (for low latency) with HDMI ports.

4.3. Such legacy cards (ex. asus xonar 1.3 hdav) does not support hdmi sound in linux.

I've selected the option with HDMI-connection with a videocard and I've made some research. I use Jack Audio Server with a realtime linux kernel. Jack daemon has two parameters controlling latency: -p - the buffer size in samples and -n - the number of buffers. Less values provide lower latency, but may bring xruns or sound distorsion. There is also the parameter -r that specifies the sample rate (44100, 48000, 96000 etc).

The default values are -p1024 -n2. With the sample rate 48000 it bings the latency about 42 ms (and the AV receiver added more 15-20 ms for sound processing. If you use some software plugins for jack, each of them adds amout 42 ms.

The configuration -p512 -n2 still works, but -p256 -n2 - does not: the sound distortion arrives.

I've found several tips for reducing latency

1. If you decrease the buffer size, you have to increase the number of buffers for avoiding the distorsion, but not in linear manner. For example, -p256 -n2 does not work, but -p256 -n3 works again. Because the latency is proportional the multiplication of -p and -n parameters, -p256 -n3 provide less latency than -p512 -n2. -p128 -n3 also works.

2. Another method of decreasing the latency is increasing the sample rate with the same buffer size and adding one more buffer. For example, -r96000 -p128 -n4 gives less latency than -r48000 -p128 -n3.

My working configuration of jack is

jackd -R -S -P40 -dalsa -dhw:NVidia_1,9 -r96000 -p64 -n5 -s -P

The base latency is about 3 ms and the same is per each software plugin. Plus 15-20 ms on the AV-receiver.

Using of semi-professional sound cards is not more necessary.
 
Top