Re: [LAU] Zita-ajbridge ?

From: Fons Adriaensen <fons@email-addr-hidden>
Date: Sun Jul 21 2013 - 14:41:04 EEST

On Sat, Jul 20, 2013 at 08:50:35PM -0400, Marc Lavallée wrote:

> > mplayer will do the resampling.
>
> Mmhh... I'd prefer everything in 24bit until the output to alsa; I
> don't want to provide 16bit channels to ambdec from 24bit amb files.
> But then, is it a valid concern? I have the feeling that it doesn't
> matter much...

Resampling means 'computing samples for another sample rate', and not
'changing the sample format'. Anyway, in Jack *everything* is floating
point until output to Alsa, just as you want. Again: mplayer, or any
other Jack app, does not know the format required by the sound card,
and when connected to Jack it always outputs in floating point format.

> For FOA, mapping of amb files is WXYZ, while ambdec inputs are
> 0w,1y,1z,1x (why?),

See below.

> Here's how I remapped the outputs:
>
> mplayer -loop 0 -channels 4 -af channels=4:4:0:0:1:3:2:1:3:2 -ao
> jack:port=ambdec AJH_eight-positions.amb
> I will write a script to support other amb channels mapping with
> mplayer (up to fff in Malham notation).

Neat trick, but if it works you are just lucky.

** There is no defined order when Jack provides a list of ports. **

In most cases, Jack will list them in the order they were created,
but you can't count on that.
 
The only way to obtain a defined order is by interpreting the port
names, which is what e.g. Qjackctl does: it does a lexicographical
sort. Which is why it will show Ambdec's ports as 0w, 1x, 1y, 1z.
AFAIK, mplayer doesn't do that.

> Now my problem is to connect mplayer to a second instance of ambdec; I
> need it for lower frequencies, and since I use a triangle (for basic
> horizontal decoding), I had to change the lower limit for the number of
> allowed channels in the source code of ambdec.

There's no need to do that, just set the matrix coefficients for the
4th channel to zero.

About Ambisonics channel order
------------------------------

Spherical harmonics are identified by two numbers, 'degree' and
'order', usually notated 'l' and 'm'. [*] I'll use 'L' and 'M'
here to avoid confusing 'l' and '1'.

This is the mapping using the FuMa channel names:

   | -3 -2 -1 0 +1 +2 +3 M
---|--------------------------------------
 0 | W
 1 | Y Z X
 2 | V T R S U
 3 | Q O M K L N P
   |
 L |

The triangle gets wider as L increases, as there are
2 * L + 1 components of degree L.

If you read it top to bottom and left to right, and start
counting at zero, you get what is called the "Ambisonic
channel number" or ACN: W = 0, Y = 1, Z = 2, X = 3, etc.
Ambdec uses ACN internally, so it creates ports in that
order, and then Jack will (usually) list them in the same
order. When Ambdec gets extended to 4th degree (order) and
higher, it will also use ACN in the port names - there are
no FuMA names for those. The only alternative would be to
use port names that explicitly contain L and M.

Note that

  ACN = L^2 + L + M

and when given ACN

  L = sqrt (ACN) rounded down, and then
  M = ACN - L^2 - L

[*] To add to the confusion, in Ambisonics the 'degree' is
    usually called 'order'.

Ciao,

-- 
FA
A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Mon Jul 22 00:15:02 2013

This archive was generated by hypermail 2.1.8 : Mon Jul 22 2013 - 00:15:02 EEST