30 Apr 2004 rbultje   » (Master)

So, GStreamer plays back .mp4a/.mp4v files now in CVS. Beat that, Fluendo gang! :).

And now that we've got that figured out, it's time to start working on multi-channel sound support. I recently wrapped dtsdec in GStreamer, and that makes up to a total of three codecs now (AC-3, DTS, MPEG-2/4 AAC) that support it. So far, we always downsampled to stereo or failed (in the case of faad; bad!).

So, what's needed:

  • a GstCaps property for channel positions
  • respective decoder plugins spitting these out
  • alsasink checking for those
  • audioconvert for channel conversions

So I'm basically doing the first and second now. We'll start going for a simple approach, similar to what Xine, liba52 and dtsdec do. They all use enumerations for different output modes (5_1, 4_0, stereo, mono). We will use a string that represents the number of channels in each part of your audio room (front, side, rear, lfe). The string basically consists of number-letter combinations, so 5:1 (3 front, 2 rear, LFE) sound will be "3f2rlfe" (f being front channels, s side channels, r rear channels and lfe indicates the subwoofer channel). The layout of samples in buffers is then interleaved, left-to-right, front-to-back, then lfe, so in 3f2rlfe, it would be left-front, center, right-front, left-rear, right-rear, lfe and then the next left-front sample. This isn't covering all corner cases of odd audio setups (there might be people with only three boxes on their left side), but will do for the general case.

The next step is to implement this in a52dec (AC-3 audio decoder plugin), dtsdec (DTS audio decoder plugin) and faad (MPEG-2/4 AAC audio decoder plugin), which is what I'm currently working on. Alsasink/audioconvert will be done at a later step (somewhere next week or so) and then all this should work.

So, anyone wanna buy me a 5:1 audio setup for my laptop for testing purposes? ;).

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!