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

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: AudioEngine branch - DO NOT REQUEST BINARY BUILDS (/showthread.php?tid=78289)



- ArtVandelae - 2010-09-12

I put together a DirectSound sink this morning so AE now outputs audio under XP as well.


- gnif - 2010-09-13

Sweet! Do the sinks support passthrough? Currently only AC3 works, and only barely atm, so don't assume its your code if it doesn't work.

Make me some patches and I will apply them, I dont think the sink interface is going to change again, and if it does, it should only be minor.


- gnif - 2010-09-14

Time to post another update...

Things have been progressing rapidly, I now have paplayer fully functional with full precision audio reproduction, so those that have 24bit flac files can enjoy 24bit bliss now Smile

Also AC3 passthrough now works, DTS is broken still, but should not be hard to get going since it shares 99% of the code with AC3.

Heaps of bug fixes, crash fixes, etc... Also looks like some of the smoothvideo features will be handled by AE too, removing some of the complex code from dvdplayer.

Things to do in order:

* Get DTS working
* Re-implement AC3 encoding
* Create an AE factory so a pulse audio variant can be made, this will allow us to take advantage of pulse's features such as pre-loaded sounds, and its own in-built mixing.
* Implement Pulse, and CoreAudio.


- ArtVandelae - 2010-09-14

gnif Wrote:Sweet! Do the sinks support passthrough? Currently only AC3 works, and only barely atm, so don't assume its your code if it doesn't work.

Make me some patches and I will apply them, I dont think the sink interface is going to change again, and if it does, it should only be minor.

Passthrough is supported and should work just fine. The core code is more-or-less the same as the old renderers and it worked fine there.

I'll merge your latest changes, clean up what I have and submit it soon.


- erhnam - 2010-09-14

gnif Wrote:Time to post another update...

Thanks for the update! Like reading this stuff. Very nice and thanks for all the hard work.


- gnif - 2010-09-14

No worries Smile

The abstraction has been done and so is a new sink, OSS! Smile. top2fs has started on Pulse support now that things have been abstracted... and I am continuing on the transcoding support.


- ArtVandelae - 2010-09-14

The Windows patch is up.

http://trac.xbmc.org/ticket/10168


- gnif - 2010-09-15

Thanks ArtVandelae! Big Grin

Windows should work now, feel free to try it out Big Grin


- gnif - 2010-09-15

More updates....

* topfs2 has been hard at work implementing a fully featured Pulse driver now the interface is relatively locked down.
* a few buffer overflow issues have been corrected
* oss and alsa latency has been greatly improved (gui sounds happen on time!)
* audio visualizations now render properly when the channel layout > 2.0
* passthrough is possibly broken again, un-tested
* devices are enumerated for ALSA now (OSS still to come)
* audio configuration settings are applied instantly now, even during playback


- ArtVandelae - 2010-09-15

I made a few more changes and fixes since yesterday.

Patch is here http://trac.xbmc.org/ticket/10178

Additionally the previous patch didn't merge the new sink code into the repository for some reason so I re-attached them to this patch.


- erhnam - 2010-09-16

gnif Wrote:More updates....
* audio configuration settings are applied instantly now, even during playback

Nice Smile Can't wait to test this! Keep us informed, thanks!


- bobb0 - 2010-09-20

Great work! I love that my receiver doesn't reset when I pause audio/video!! Once ready, this is going to be an addition that really thrusts XBMC toward consumer-level quality (though it actually well exceeds that in MANY respects already... Smile

I'm running 32-bit Ubuntu 10.04, using hdmi output to my receiver.
Vanilla alsa 1.0.21 (ie, from package.. no custom compiles and/or hacks)
Compiled XBMC-AE r33927M

AC3 passthrough works great
DTS still broken

I find that the audio is clipping a lot, as if it is being mixed too loud? I have to reduce the volume to about 50% to minimize clipping and even then it still clips. It is the bass frequencies that are clipping.

The full debug log is here: http://www.pastebin.ca/1944667

I noticed that the audio engine was initialized at 32-bit output. I wonder if there is something happening in the conversion, or is the sample size supposed to change dynamically with the source? If I can find the code I might try hard-coding it to something lesser like 24 or 16 bits to see if it makes a difference, but I am not at all familiar with the code....

All in all, I'm super-stoked about audio-engine!! Smile


- gnif - 2010-09-20

Great, nice to see someone using it with passthrough, I have not tested it in a few weeks... as for not resetting, thats great too! I suspected that problem would be corrected as we are sending null IEC958 frames while there is no data, meaning your receiver does not loose sync with the data stream.

as for the bit depth, AE will auto convert to what your card supports, see the line
Code:
Your hardware does not support AE_FMT_FLOAT, trying other formats

We first try FLOAT, if that fails we try to select the best bit-depth we can, and convert to it. In short, what is is doing is correct Smile

As for the clipping, I have also noticed this, even on trunk, try turning off "Boost Volume Levels" in the configuration, if this fixes it, its a known issue.

Thanks for testing, and the log Wink


- bobb0 - 2010-09-20

While I agree with what you're doing something odd seems to be happening.. not that it's xbmc's fault... it could be an alsa issue for all i know.

I modified line 219 of AESinkALSA.cpp. I changed the enum starting point to AE_FMT_S24BE and re-compiled. The resulting sound was much cleaner, though I can still hear some slight clipping when I listen to A Perfect Circle. You'll be interested to know that it initialized the audio at S16NE (NE = unsigned I assume?)

I don't think that 32bit processing should be selected for my soundcard. Check out this funness:

Code:
# ~/xbmc-ae$ cat /proc/asound/card0/codec#3 | grep bits
    bits [0x0]:
    bits [0xf]: 8 16 20 24
    bits [0xf]: 8 16 20 24
    bits [0xf]: 8 16 20 24
    bits [0xf]: 8 16 20 24
    bits [0xf]: 8 16 20 24
# ~/xbmc-ae$ cat /proc/asound/card0/codec#0 | grep bits
    bits [0xe]: 16 20 24
    bits [0xe]: 16 20 24
    bits [0xe]: 16 20 24
    bits [0xe]: 16 20 24
    bits [0xe]: 16 20 24
    bits [0x1e]: 16 20 24 32
    bits [0x6]: 16 20
    bits [0x6]: 16 20
    bits [0x1e]: 16 20 24 32
    bits [0xe]: 16 20 24

codec#3 is the hdmi device. codec#0 is the analog and s/pdif (as far as i know)

So, if we assume that the features of codec#0 are irrelevant to the conversation, why would 32bit be selected over 24bit when none of the hdmi nodes accept 32bit? And similarly, why *isn't* 24bit being grabbed when I circumvent the 32bit levels?

Codec: Realtek ALC883
Address: 0

Codec: Nvidia MCP78 HDMI
Address: 3

Or do you think I'm going about this all wrong? :)

Plus: my source was stereo (mp3/ogg) so the boost level on downmix option didn't seem to have much effect, but I will try it again once I pull the latest svn changes... another time though since its late and i have to work in the a.m. :(


- gnif - 2010-09-20

AE runs in FLOAT no matter what your card supports, when it comes to output, it converts from float to what your card reports that it supports...

ALSA does not return any means of detecting what formats it supports other then failure on configure, so we just keep trying, downgrading the format each time till the card accepts a sample format. If your card accepts S32 then it supports S32.

As for the designation:
S32NE = Signed 32bit Native Endian
S32BE = Signed 32bit Big Endian
S32LE = Signed 32bit Little Endian

NE means, use what your system does natively, so for eg, if your on intel/amd hardware, it will choose LE, if your on PPC it will choose BE by default.

If you wish to force the format, comment out the "case" statements in AEFromatToALSAFormat that you don't want to support, eg, everything except for S24 formats.