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)



- DDDamian - 2012-01-18

Just to expand on #2 above, CSoftAE::Makestream is called by DVDPlayer or PAPlayer with the data format passed via the AEDataFormat structure, and in turn calls CSoftAE:OpenSink without passing that info. OpenSink then looks at the current stream and tries to use it as an override for the incoming stream.

By calling OpenSink with the AEDataFormat structure filled in for the next stream we can play that stream in it's original format. For bitdepth it doesn't matter much as everything converts to float, but for channel layout it's important when shifting down in channels.

I can clean this up a bit if you're not already doing so, and can use the Exclusive Mode GUI setting as a switch. Then it's possible to just leave the sink open for "mixing" or crossfading in share mode but having original content played correctly in Exclusive Mode.

Rather than using the master stream to override we simply play the stream as is by passing the data format to OpenSink.


- einhänder - 2012-01-19

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.

Hey gnif,

I can only repeat my feedback from last year: http://forum.xbmc.org/showpost.php?p=839266&postcount=483

But it seems one of the last commits introduced a bug in regards to the selected output device. Atm XBMC will always output audio through HDMI and doesn't honor the selected device for the standard audio output device in the audio settings. (tested custom settings, too)


- ashlar - 2012-01-19

gnif, I don't know if this is something AE could take care of but... do you think it might be doable to solve the "silent stream bug" that's been plaguing people since times unknown? You can google it but, basically, it would be nice to have the audio stream never be interrupted while XBMC is working. For instance, let's say one selects HDMI audio with all software decoding. On my receiver this means getting a Multichannel signal. The problem arises when, for instance, I start playing a video. The audio signal is interrupted, the receiver switches the input, a relay activates producing an audible click.


- DDDamian - 2012-01-19

Re: Silent stream bug - handshaking issue also occuring with ATI cards, not just nVidia as some forums suggest. Only workaround I could think of is injecting a silent stream of ~2 sec of the same format into the actual stream to allow the handshaking to occur during that period. Would only apply to a sink opening (i.e. new data format) or unpausing.

@gnif, I assume that would be a pain in the nuts from a timing perspective but would be a good use of the If (masterstream) && isCompatible logic in the code. If the formats don`t match and a sink ha to be re-opened inject a 2-sec null dummy file into the stream buffers.

Aren`t you glad you raised your head? Laugh


- ashlar - 2012-01-19

Thanks DDDamian, I'm no coder but I'm glad you could provide some more technical info on what I was asking.


- gnif - 2012-01-20

Hi Guys,

I have been out of the area for the last few days, head home tomorrow when I will have a look through this, as for the silent issue and relay click, please try the latest build, there was a correction for the IsCompatible code under ALSA that may have already corrected it when the streams do match.


- CrystalP - 2012-01-20

Sorry for the off-topic...

@DDDamian, I haven't seen your changes for exclusive mode, but maybe they could help with Eden WASAPI and DSound? Every now and then there is a report for soundcards that don't work with XBMC but work with other players. It could have to do with a field missing or filled improperly.


- DDDamian - 2012-01-20

CrystalP Wrote:Sorry for the off-topic...

@DDDamian, I haven't seen your changes for exclusive mode, but maybe they could help with Eden WASAPI and DSound? Every now and then there is a report for soundcards that don't work with XBMC but work with other players. It could have to do with a field missing or filled improperly.

Hi Crystal - I believe that may be the case. Eden doesn't offer the option for Exclusive Mode, and I haven't delved into it's code as I have with the AE branch, so I'm not sure if it's attempting Exclusive or Shared mode.

I run Eden with WASAPI selected, and that seems to work for me regardless of ATI/AMD drivers vs RealTek drivers. It's definitely using WASAPI vs DirectSound as selected, but not sure which mode. I'll do a quick test to see if Eden's running Shared mode and PM you.

*** EDIT: Detailed PM sent - short answer is on my test bed Eden Beta 1 release functions correctly with ReakTek or ATI drivers in DirectSound and WASAPI (which is initializing correctly as Exclusive not Shared). The initialization issues seem related only to the AE code. Eden Beta 1 is fully correct. Applies only to Win 7 x64.


- DDDamian - 2012-01-20

d
gnif Wrote:Hi Guys,

I have been out of the area for the last few days, head home tomorrow when I will have a look through this, as for the silent issue and relay click, please try the latest build, there was a correction for the IsCompatible code under ALSA that may have already corrected it when the streams do match.

Hi gnif - yep, see much different logic there in building the sink details. I assume that's your working platform. I've save the mods I've made for WASAPI but haven't commited anything to my branch as I've made changes to the OpenSink() method which may or may not suit where you're headed with the bigger picture. As and when you get back to it I can always keep going on the WASAPI side if it helps and suits what you're planning.

Cheers and thanks for all you're doing Big Grin


- Hack_kid - 2012-01-22

hey i merged gnifs AE branch with EdenBeta2. if you want you can grab it from my git

git://github.com/Albinoman887/xbmc.git and then checkout master+AE

it compiles on linux, havent tested windows yet but it should work

i also patched the Global AV Audio Delay patch from this sub-forum to fix 24htz av sync issues. i will push that shortly to new branch master+AE+AVDelay. seems to work just the same as with normal master


- PatrickBateman - 2012-01-22

Hack_kid Wrote:hey i merged gnifs AE branch with EdenBeta2. if you want you can grab it from my git

git://github.com/Albinoman887/xbmc.git and then checkout master+AE

it compiles on linux, havent tested windows yet but it should work

i also patched the Global AV Audio Delay patch from this sub-forum to fix 24htz av sync issues. i will push that shortly to new branch master+AE+AVDelay. seems to work just the same as with normal master

Fantastic! Nod


- gnif - 2012-01-22

@Hack_kid - Please take your branches into a separate thread, this is AE discussion ONLY, not hybrid unofficial discussion. It would be better if you could provide any patches to fix things also so that they get included in the official AE branch that will be merged for Frodo later.


- DDDamian - 2012-01-22

DDDamian Wrote:Just to expand on #2 above, CSoftAE::Makestream is called by DVDPlayer or PAPlayer with the data format passed via the AEDataFormat structure, and in turn calls CSoftAE:OpenSink without passing that info. OpenSink then looks at the current stream and tries to use it as an override for the incoming stream.

By calling OpenSink with the AEDataFormat structure filled in for the next stream we can play that stream in it's original format. For bitdepth it doesn't matter much as everything converts to float, but for channel layout it's important when shifting down in channels.

I can clean this up a bit if you're not already doing so, and can use the Exclusive Mode GUI setting as a switch. Then it's possible to just leave the sink open for "mixing" or crossfading in share mode but having original content played correctly in Exclusive Mode.

Rather than using the master stream to override we simply play the stream as is by passing the data format to OpenSink.

Work complete - WASAPI sinks now work in Exclusive mode and source plays as original, rather than being resampled/rechanneled to match current stream.


Your latest commit... - koko1967k - 2012-01-22

@gnif
I'm not sure if this is a silly question, but:
What is your latest version based on? Eden PRE, beta 1 or beta 2?

I am asking because I had some issues with PRE and would like to test your latest version knowing that those old issues will not affect the test.

Thanks


- shadow - 2012-01-22

elite1967 Wrote:@gnif
I'm not sure if this is a silly question, but:
What is your latest version based on? Eden PRE, beta 1 or beta 2?

I am asking because I had some issues with PRE and would like to test your latest version knowing that those old issues will not affect the test.

Thanks

According to the system info it is 11.0-pre