XBMC Community Forum
AudioEngine branch - DO NOT REQUEST BINARY BUILDS - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+--- Thread: AudioEngine branch - DO NOT REQUEST BINARY BUILDS (/showthread.php?tid=78289)



- gnif - 2011-07-14 07:33

einhänder - I have not tested external ffmpeg with AE, but it should work with any recent version as the DTS-HD and TrueHD processing code is built into AE and does not rely on ffmpeg.


- T800 - 2011-07-14 11:55

@gnif
I'm quite curious on how the new engine is created.
Is it done from documentation based on the audio codecs and then you code to suit? Is some of it guess work and then you tweak it?


- gnif - 2011-07-14 12:19

@T800 - The old code just talked directly to the audio API of the operating system, the players had to perform any conversions required to get the audio out, which meant lots of code duplication, 16bit audio, and many output inconsistencies, and no multiple stream output (eg, guisound + dvdplayer).

The Engine is an abstraction-layer which performs all the required conversions, stream mixing, resampling, etc, required to get high quality consistent output.

All the codecs now pass their raw decoded data to the streams which AE processes before passing it into the sound API and visualisation output too.

It gets even more complicated when it comes to bitstreaming as AE can operate in three modes, analog, transcode or raw passthrough.

* Analog is just that, analog.

* Transcode is when AE transparently encodes multichannel analog audio into AC3 5.1 and passes it out the sound device after encapsulating it for AC3 SPDIF.

* Raw Passthrough is where AE just passes the digital stream straight out the sound device after encapsulating it according to the format.

For example, the stream could be any one of the following

Analog:
44110hz 5.1 stream -> AE -> 44110hz 5.1 analog output (1 to 1)
44110hz 5.1 stream -> AE -> 48000hz 5.1 analog output (resampled)
44110hz 5.1 stream -> AE -> 44100hz 4.0 analog output (downmixed)
44110hz 5.1 stream -> AE -> 48100hz 4.0 analog output (resampled & downmixed)

Passthrough:
44110hz DTS-HD -> AE -> DTS -> Packetizer -> SPDIF
44110hz DTS-HD -> AE -> DTS-HD -> Packetizer -> HDMI
44110hz DTS -> AE -> DTS -> Packetizer -> HDMI
(repeat for each passthrough format, AC3, TrueHD, AAC)

Transcode:
44110hz 5.1 stream -> AE -> 44110hz 5.1 analog -> AC3Encode -> Packetizer
44110hz 5.1 stream -> AE -> 48000hz 5.1 analog -> AC3Encode -> Packetizer
44110hz 5.1 stream -> AE -> 44100hz 4.0 analog -> AC3Encode -> Packetizer
44110hz 5.1 stream -> AE -> 48100hz 4.0 analog -> AC3Encode -> Packetizer

Note that this does not take into account resolution conversion, channel remapping, or stream mixing.

In total there would have to be at least over a hundred possible input/output combinations depending on hardware, input source, user preferences, channel counts, channel mapping, sample rates.

None of this is guess work, just lots and lots of headaches.

AE's goal is to hide all this from the developer and provide a simple API that works on every platform for any random crap it is handed in the fastest and best possible way, leaving the developer to concentrate on the program rather then the issues of audio format wrangling.


- SpectreX - 2011-07-14 12:57

The sad thing is the gnif is working all by himself on some serious hardcore coding and mathematical algortims to put XBMC in same league in terms of audio with the other solutions like ffdshow, yet the rest of the developers are working on pseudo-useless features like dirty regions, to give a speed bump on an application that is already the fastest in the HTPC realm. Thanks again gnif for all the hard work


- T800 - 2011-07-14 14:30

Thanks the explanation, it sounds pretty complicated.
It is surprising for such a platform to have just one developer doing all of it. Not that it matters but at least you will have sole credit.

I'm not sure it will help at all but I've got an old Mac Powerbook I could donate to maybe help on the OSX side it (if the PPC computer is of any use).


- Robotica - 2011-07-14 14:35

SpectreX Wrote:The sad thing is the gnif is working all by himself on some serious hardcore coding and mathematical algortims to put XBMC in same league in terms of audio with the other solutions like ffdshow, yet the rest of the developers are working on pseudo-useless features like dirty regions, to give a speed bump on an application that is already the fastest in the HTPC realm. Thanks again gnif for all the hard work

Don't forget Jim Caroll who's also doing a great job! But no disrespect from my side since all devs that donate their efforts to the commons (without double agenda's) have my respect; no matter how small the contribution.

But for gnif, thanks for all your hard work and above great explanation. Finally, I understand the advantages of the new audio engine..


- gnif - 2011-07-14 14:52

Just to set the record straight...

The dirty regions work is very important, XBMC is not very fast on embedded platforms and I can see it making a huge improvement, especially for power consumption.

gimli is writing the OSX engine, its not all my code.

Other developers have helped me more then you know behind the scenes with bug/fault finding, and teaching me how to do the math required.

While I would like to take credit for all of it, I just cant, it would be unfair as I couldn't have done it without the support of the other devs, or the generous donations to obtain HDMI capable equipment.


- rayhawk0 - 2011-07-14 19:46

Calvados Wrote:Did a few test with latest commits... it's really good, DTS-HD MA worked on the two movies I tried, and it seems that my FLAC issue has been fixed as well (consistently plays with the right samplerate/channels even after a passthrough). Will most likely do more tests tonight.

That's really cool. For me i't working a little different. I'm using the HDMI from an Nvidia GTX 460 and DTS HD MA and Dolby HD bitstreaming is working, but when I play my 24 bit Flac files, the sample rate does not match the source.

In Foobar with WASAPI, when I play a 2ch 192kHz flac, my receiver shows that it is receiving a 2 ch 192kHz stream and when I play a 6 channel 96kHz flac, my receiver will reflect that.

In XBMC, it is almost always in multichannel 96kHz, regardless of the flac source.

As of what build are the flac files playing at the correct samplerate/channels for you?


- SpectreX - 2011-07-14 20:19

Ups, sry then, din`t know others helped you. Since you were the only XBMC dev posting here in this thread, i thought you were working alone, and was a little pissed off that you were working alone. I take my words back then.

Anyway, what`s the status on HD audio bitstreaming under Linux for ATI/AMD cards?. Anssi said 15 pages ago that AMD had some non-standard/funky way of doing it and ALSA didn`t support anything but 2 channel high-bitrate (6k kbps) over HDMI on ATI cards, not the needed 6 channel 6k needed for HD audio. Has this been resolved, since i`m interested in switching to OpenELEC for my AMD E350 HTPC.


- gnif - 2011-07-15 00:29

@rayhawk0 - Can you please provide me with a sample that exhibits the behavior, your log file, and your audio settings.

@SpectreX - No worries, just wanted to be clear that others deserve credit for their contributions.

There is still no ATI support under Linux for HD streams as the drivers can not open more then 2 channels, HD requires all the channels to get the required bandwidth for it. If you want this fixed, please ask the ALSA developers, complain to AMD, etc...


- ArtVandelae - 2011-07-15 06:42

rayhawk0 Wrote:That's really cool. For me i't working a little different. I'm using the HDMI from an Nvidia GTX 460 and DTS HD MA and Dolby HD bitstreaming is working, but when I play my 24 bit Flac files, the sample rate does not match the source.

In Foobar with WASAPI, when I play a 2ch 192kHz flac, my receiver shows that it is receiving a 2 ch 192kHz stream and when I play a 6 channel 96kHz flac, my receiver will reflect that.

In XBMC, it is almost always in multichannel 96kHz, regardless of the flac source.

As of what build are the flac files playing at the correct samplerate/channels for you?

Make sure that you are using exclusive mode. Otherwise everything needs to be converted into the format that Windows is currently set to.

The other issue is that right now AE upmixes everything to the selected speaker configuration. If you have, say, 5.1 channel speakers selected in the GUI then everything, even stereo sources, are mixed into 5.1 channels. It should probably be modified to not upmix stereo sources when HDMI output is selected so that the receiver can do it's own processing (ProLogic/DTS Neo/5CH Stereo) on these sources.


- rayhawk0 - 2011-07-15 06:59

The XBMC with HD Audio that was installed in my PC, I got by following the instructions in the first post in the following forum: http://voxcommando.com/forum/index.php?topic=479.0

If I am going to give you log files and such, I should be doing it from an XBMC compiled from your GIT.

So I did the following:

1. git cloned git://github.com/gnif/xbmc.git

2. ran DownloadBuildDeps.bat in xbmc\project\BuildDependencies

3. ran DownloadMingwBuildEnv.bat in xbmc\project\BuildDependencies

4. ran BuildSetup.bat in xbmc\project\Win32BuildSetup

It starts Compiling XBMC, but does not. I get this:

ERROR: "XBMC.EXE failed to build! See ..\vs2010express\XBMC\Release (DirectX)\B
uildLog.htm for details."
------------------------------------------------------------
View the build log in your HTML browser? [y/n]

When I say y, it opens up a log file. I have pasted it here: http://pastebin.com/j4Grf6cJ

Those steps I followed worked on the git://github.com/xbmc/xbmc.git repository, so I thought they would work on yours.

Any help would be nice. Thanks.


- rayhawk0 - 2011-07-15 07:08

@ArtVandalae - Yes, I was using exclusive mode. I think you should have an option to disable upmixing.


- gnif - 2011-07-15 07:21

@rayhawk0 - The windows build files need updating again


- rayhawk0 - 2011-07-15 07:29

@gnif, thanks for the quick reply. Do you mean that I need to wait until they are updated or that I need to run the 2 BuildDependencies batch files again?