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)



- gnif - 2012-01-17

Bitstreaming is working again.

@liquidskin76

Thanks for the details, I do not have any sample material in this format I can test with, if it can be provided I will see if there is something I can do, it seems like the audio delay calculations are out of whack for bit-stream if it doesn't occur on decoded audio.

I do know that there are still a few issues with delay calculations due to a channel count bug I discovered earlier, but the fix is fairly involved and related to the bitstream breakage that just occured Smile


- liquidskin76 - 2012-01-17

gnif Wrote:@liquidskin76

Thanks for the details, I do not have any sample material in this format I can test with, if it can be provided I will see if there is something I can do.

Sure... if someone doesn't beat me to it, i can sort a small sample and upload it.

Leave with me.

Cheers Wink


- rodercot - 2012-01-17

gnif Wrote:@rodercot, please provide a sample file and I will attempt to replicate the issue here.

gnif,

I would love to; the problem, I cannot replicate the error in the same place and this seems to only happen on DTS-HD bitstreaming. I will pull and recompile with the latest updates and try an Truehd file and a dts-hd file and try to get it to replicate in the same place.

you guys with compile errors, are you running make clean after the pull. I asked before is there a reason we need to run make with sudo?

edit - so there error reads as such:

DEBUG: CDVDPlayerAudio:: Discontinuity - was:1955597224.952000, should be:1955613908.285333, error:16683.333333
20:33:00 T:40176496 ERROR: CAESinkALSA::AddPackets - Underrun
20:33:00 T:40176496 ERROR: CAESinkALSA::AddPackets - snd_pcm_writei returned -32
20:33:00 T:2811419504 DEBUG: CDVDPlayerAudio:: Discontinuity - was:1989875848.414333, should be:1989771259.964657, error:-104588.449677

In reading and trying to make sense of this, and please correct me if my thinking here is wrong. The debug (discintinuity) is basically draining the constant buffer to the card causing the underrun error and then in code via snd_pcm_writei is trying to fill it back up (hence the audio dropouts). Then the 2nd (discontinuity) looks again at the buffer and there was a disruption in the stream or buffer and tries to correct it (if this is the case why does it not create a loop of these errors.

The link below talks about snd_pcm_recover. I am not sure if you are using that in the code it looks like it is a fairly new feature.

Forgive me gnif if I am way off base here I am grasping...LOL. Well Ok I am TRYING to help, maybe on the wrong path.

http://mailman.alsa-project.org/pipermail/alsa-devel/2009-May/017736.html (this is the end of that discussion you will need to back up a couple threads to get the full jist of it.


rgds,

Dave


- Hack_kid - 2012-01-17

Its not just bitstreaming all 24htz videos exhibit this issue and gnfi almost all DVDs and bluesy are 23.976fps=24htz go see for yourself Smile


- gnif - 2012-01-17

@rodercot - do NOT tell people to use sudo to compile, your running the compile as root, very very bad juju, a mistake in the make file could execute an "rm / -Rf" and there is nothing to stop it from succeeding.


- meridius - 2012-01-17

hi all, about the audio sync and 24hz frames per sec.

here is some test files which run at 23.976 which has both AC3 and DTS tracks.

http://www.mediafire.com/?0m2cx5gxvw6emvw

I have to delay the audio in DTS tracks to -200ms but i am sure it could be -210ms but XBMC does not let you pick that option.

What i did was run the test videos above with high volume from my amp and then recorded the picture and audio at the same time using my ipad camera app.

I loaded it into imovie (which you can see picture and audio track at the same time in the same time line) on the ipad and i moved the line so it was bang on the highest peek of the audio track and then looked at the video to see if it hit centre and i did this a few times at different delays in the audio.

the closest i could get to the centre was -200m but i am sure it could be -210ms.

I hope this helps people and its a good test to see if your audio is in sync i have not tried the AC3 track yet which would be stereo or dolby digital.

I get no sync problems when i run everything in 60hz but when i use the option that syncs the tv to the frame rate like 24hz i get audio sync problems.

sorry for the quick responce but at work on my iphone and its a pain to type on , lol

hope this helps


- liquidskin76 - 2012-01-17

Cheers meridius... was about to upload!


- rodercot - 2012-01-17

gnif Wrote:@rodercot - do NOT tell people to use sudo to compile, your running the compile as root, very very bad juju, a mistake in the make file could execute an "rm / -Rf" and there is nothing to stop it from succeeding.


AGREED and that is not what it was meant as, I was asking why it was needed with this build. I have never used it before and have only had to use when compiling this branch.

I built davide's branch without sudo FYI.


Thanks,

Dave


- DDDamian - 2012-01-17

Hack_kid Wrote:my Onkyo TX-NR609 supports outputing 1 source to botuh zones at the same time but only analog connections it wont do it with the HDMI audio (most AVRs are this way now a days) so to get it to work u simply connect audio to the analog autio in of whatever input your on
@Hack_kid I might have mentioned this in another thread, but most AVRs having that feature will allow you to connect via analog patch cables from PRE-OUT -> ZONE 2 INPUT. This will copy your HDMI input from the HTPC to your Zone 2 and do exactly what you want. You may need to enable Zone 2 in the setup of your amp.

Sorry to go off-topic, I know this thread needs to be brought back to the original intent, just know that this is gonna come up again and again.


- Drae - 2012-01-17

OT still - sorry Gnif.
rodercot Wrote:AGREED and that is not what it was meant as, I was asking why it was needed with this build. I have never used it before and have only had to use when compiling this branch.
It's not needed - mine works fine. Most likely you built it in the past with sudo or cloned/pulled with sudo and thus some files are now owned by root. Do a chown -R xbmc.xbmc on the folder containing the source (not in the folder itself - on the folder itself) - obviously replace xbmc.xbmc with whoever should own those files. If it still fails - do a fresh clone.


- joethefox - 2012-01-17

gnif Wrote:I would also like to know if people are noticing an audible difference with running AE... I am by no means an audiophile, I am only doing this for fun and to fully take advantage of my HiFi equipment.

Absolutely yes.
http://forum.xbmc.org/showpost.php?p=903314&postcount=706


- DDDamian - 2012-01-17

joethefox Wrote:Absolutely yes.
http://forum.xbmc.org/showpost.php?p=903314&postcount=706

I'll get lacerated here for not performing a double-blind study after carefully prepping the files and painting my sound room with rubber, but absolutely yes. I'm using Foobar 2K with WASAPI exclusive as a reference and 24-bit DVD-A rips to FLAC as a source, and the difference between them is now negligible.

If I compare 16-bit XBMC with XBMC-AE it's night-and-day: the clarity, precision and "air" of high-def comes out as it should, just as with Foobar and getting comparable to my standalone DVDA/SACD player over Denon's Link III, which elimates clock jitter unlike HDMI.

I took it a bit further though and ran the audio through as RAW to avoid the integer->float->integer conversion. It's *extremely* unlikely I would have heard ANY difference as a result of that, but it does keep the stream bit-for-bit. Relevent or not it's something someone's gonna ask for Laugh

Built your work from last night - gonna test!


- dado483 - 2012-01-17

mylle Wrote:Hi Davide,

Im trying to compile from your branch but its failing. Any idea what wrong?

http://pastebin.com/5bfzf1CQ

regards
Jacob

It's very strange......under Linux i don't have any problems.
Is not possible to know the line in the code where there error is?


- gnif - 2012-01-18

DDDamian Wrote:I took it a bit further though and ran the audio through as RAW to avoid the integer->float->integer conversion.

The precision of float is greater then the precision of 24bit integer, there is NO loss at all when converting between these formats, even bit-streams in pass-through would work via this conversion.

Thanks for testing though, good to know it is making a difference.


- DDDamian - 2012-01-18

gnif Wrote:The precision of float is greater then the precision of 24bit integer, there is NO loss at all when converting between these formats, even bit-streams in pass-through would work via this conversion.

Thanks for testing though, good to know it is making a difference.

Agreed, just an absolute purist would complain. FYI you are adding a signal-to-noise ratio of approximately 30,000,000:1 with the conversion lol.

Couple of things:
1) Testing with an ATI HD6470M - supports 16, 24bit from 8khz to 192khz, 8 channels plus all HD formats. I noted that with the code as-is the ATI drivers would not allow exclusive. Made numerous changes to the wfxex initial data and changed the data format to WAVE_FMT_EXTENSIBLE, that got it to work. Every field in the structure needed a valid argument. With your code as-is RealTek drivers for the same card worked fine in Exclusive.

2) I note that once you have a functioning channel layout it does not get changed if the stream format changes. In the mods I had made I had it so that, in Exclusive mode, if the incoming channel layout didn't match then I would re-open the sink with the new layout. E.G. currently going from a six-channel PCM stream to a two-channel stream the sink stays at six-channel, prohibiting AVR-based processing on the two-channel stream.

Unfortunately I had to change CSoftAE::OpenSink() to CSoftAE::OpenSink(AEAudioFormat dataFormat) and pass it the new format data to test for a change in channel count, bitdepth, samplerate etc to avoid the masterStream override you're using. Still, an improvement.

And BTW, welcome the f*&k back!!!!!