[WINDOWS][PATCH]Bitstream output of HD audio formats

  Thread Rating:
  • 17 Votes - 4.76 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Closed
loekf Offline
Junior Member
Posts: 41
Joined: Apr 2012
Reputation: 0
Location: Netherlands
Post: #1246
(2012-04-16 22:46)DDDamian Wrote:  @loekf - absolutely it matters, Use WASAPI for passthrough, not DirectSound. DirectSound uses system mixers which essentially prevent passthrough. Make sure your Windows settings are set for WASAPI exclusive mode as well.

Amazing...

I switch to WASAPI AMD HDMI device + exclusive mode and my DTS-ES movies work !!

So now basically all my movies work with bitstreaming (DD, DTS, DTS-ES and DTS MA).

(with DTS-ES movies I'm referring to those Lord Of The Rings and Star Wars movies)

EDIT: switching to the AE thread, because now I have also a question on AudioEngine ;-)
(This post was last modified: 2012-04-16 23:23 by loekf.)
find
bluray Offline
Posting Freak
Posts: 8,316
Joined: May 2011
Reputation: 145
Post: #1247
(2012-04-16 23:22)loekf Wrote:  I switch to WASAPI AMD HDMI device + exclusive mode and my DTS-ES movies work !!
Man, did you miss the screen shot in the first page? It clearly show WASAPI in OP first post......I posted the screen shot with Onkyo AVR in the 3rd page too.......

[Image: w99vlg.jpg]

I told you that there is nothing wrong with Onkyo........

>Alienware X51- do it all HTPC
>Simplify XBMC configurations
>HOW-TO Bitstreaming using XBMC
I refused to watch movie without bitstreaming HD audio!
find
loekf Offline
Junior Member
Posts: 41
Joined: Apr 2012
Reputation: 0
Location: Netherlands
Post: #1248
Well, just started to use XBMC. Typical case of RTFM, or better said was too lazy to read through 125 pages in this thread.... sorry for that

Nothing wrong with Onkyo indeed, great value for money.

HTPC: MS-Tech MC-1200 | Asus F1A75-M | AMD A6 3650 | OCZ Agility3 120GB | Corsair Vengeance 2x4GB DDR3| LiteOn iHOS104 BDR | Win7 x64 (Catalyst 12.4) | XBMC 12.0-ALPHA2 Git:20120512-694a759
Home AV: Philips 37PFL5603 | UPC Mediabox | Philips BDP7600/12 | Onkyo TX-NR609 | Sony PS3 Slim | Logitech Harmony One | Sonos audio | Apple TV | 5.1 speakers (TMA, Phonar)
find
DDDamian Offline
Team-XBMC Developer
Posts: 3,030
Joined: Sep 2011
Reputation: 254
Location: Canada
Post: #1249
Hmmm...a little harsh there.

System: XBMC HTPC with HDMI WASAPI & AudioEngine - Denon AVR-3808CI - Denon DVD-5900 Universal Player - Denon DCM-27 CD-Changer
- Sony BDP-S580 Blu-Ray - X-Box 360 - Android tablet wireless remote - 7.1 Streem/Axiom/Velodyne Surround System
If I have been able to help feel free to add to my reputation +/- below - thanks!
find
steeve23 Offline
Member
Posts: 67
Joined: Apr 2011
Reputation: 0
Post: #1250
Just a quick question on the same theme as above, I tried using Wasapi, but got no end of problems (audio breakup mainly), but saw (a while back) here about using Directsound, been using it for a while, and I thought it worked, amp is
displaying correct symbols.

So is it working for me, or is an illusion (no sarcasm intended), will directsound work ok? I assumed as the amp has the correct pretty pretty lights, I was good?

Thanks,
Steve
find
DDDamian Offline
Team-XBMC Developer
Posts: 3,030
Joined: Sep 2011
Reputation: 254
Location: Canada
Post: #1251
Posted this in another thread - thought it might be good here too:

Just a little tutorial:

Since Vista SP1, Windows has two primary audio interfaces, DirectSound and Wasapi (Windows Audio Session Application Programming Interface). The latter was a replacement for XP's Kernal Streaming mode.

DirectSound acts as a program-friendly middle layer between the program and the audio driver, which in turn speaks to the audio hardware. With DS, Windows controls the sample rate, channel layout and other details of the audio stream. Every program using sound passes it's data to DS, which then resamples as required so it can mix audio streams from any program together with system sounds.

The advantages are that programs don't need resampling code or other complexities, and any program can play sounds at the same time as others, or the same time as system sounds, because they are all mixed to one format.

The disadvantages are that other programs can play at the same time, and that a program's output gets mixed to whatever the system's settings are. This means the program cannnot control the sampling rate, channel count, format, etc. Even more important for this thread is that you cannot pass through encoded formats, as DS will not decode them and it would otherwise bit-mangle them, and there is a loss of sonic quality involved in the mixing and resampling.

Partly to allow for cleaner, uncompromised or encoded audio, and for low-latency requirements like mixing and recording, MS re-vamped their Kernal Streaming mode from XP and came up with WASAPI.

WASAPI itself has two modes, shared and exclusive. Shared mode is in many ways similar to DS, so I won't cover it here.

WASAPI exclusive mode bypasses the mixing/resampling layers of DS, and allows the application to negotiate directly with the audio driver what format it wishes to present the data in. This often involves some back-and-forth depending on the format specified and the device's capabilities. Once a format is agreed upon, the application decides how it will present the data stream.

The normal manner is in push mode - a buffer is created which the audio device draws from, and the application pushes as much data in as it can to keep that buffer full. To do this it must constantly monitor the levels in the buffer, with short "sleeps" in between to allow other threads to run.

WASAPI, and most modern sound devices, also support a "pull" or "event-driven" mode. In this mode two buffers are used. The application gives the audio driver a call-back address or function, fills one buffer and starts playback, then goes off to do other processing. It can forget about the data stream for a while. Whenever one of the two buffers is empty, the audio driver "calls you back", and gives you the address of the empty buffer. You fill this and go your way again. Between the two buffers there is a ping-pong action: one is in use and draining, the other is full and ready. As soon as the first is emptied the buffers are switched, and you are called upon to fill the empty one. So audio data is being "pulled" from the application by the audio driver, as opposed to "pushed" by the application.

WASAPI data is passed-through as-is, which is why you must negotiate capabilities with the audio driver (i.e. it must be compatible with the format you want to send it as there is no DS between to convert it), and why encoded formats like DTS can reach the receiver unchanged for decoding there.

Because WASAPI performs no mixing or resampling, it is best used in the exclusive mode, and as a result the application gets the exclusive rights to the audio buffers, to the exclusion of all other sounds or players. WASAPI shared mode does allow this, but that's not a common mode and not what we want for an HTPC. I myself have a dislike of Window's cutesy system sounds happening at 110db

Hope some of you found today's primer of use. Please pick up a scorecard from the desk and drop it in the big round "collection box" on your way out

Cheers,
Damian

System: XBMC HTPC with HDMI WASAPI & AudioEngine - Denon AVR-3808CI - Denon DVD-5900 Universal Player - Denon DCM-27 CD-Changer
- Sony BDP-S580 Blu-Ray - X-Box 360 - Android tablet wireless remote - 7.1 Streem/Axiom/Velodyne Surround System
If I have been able to help feel free to add to my reputation +/- below - thanks!
(This post was last modified: 2012-04-17 02:50 by DDDamian.)
find
bluray Offline
Posting Freak
Posts: 8,316
Joined: May 2011
Reputation: 145
Post: #1252
(2012-04-17 02:01)steeve23 Wrote:  So is it working for me, or is an illusion (no sarcasm intended), will directsound work ok? I assumed as the amp has the correct pretty pretty lights, I was good?

Thanks,
Steve
If AVR displayed it correctly, you're good to go.....

>Alienware X51- do it all HTPC
>Simplify XBMC configurations
>HOW-TO Bitstreaming using XBMC
I refused to watch movie without bitstreaming HD audio!
find
voip-ninja Offline
Donor
Posts: 1,093
Joined: Jan 2010
Reputation: 21
Post: #1253
Thanks Damian that is extremely informative.
find
DDDamian Offline
Team-XBMC Developer
Posts: 3,030
Joined: Sep 2011
Reputation: 254
Location: Canada
Post: #1254
cheers voip-ninja - it's a confusing bit of jargon for many

System: XBMC HTPC with HDMI WASAPI & AudioEngine - Denon AVR-3808CI - Denon DVD-5900 Universal Player - Denon DCM-27 CD-Changer
- Sony BDP-S580 Blu-Ray - X-Box 360 - Android tablet wireless remote - 7.1 Streem/Axiom/Velodyne Surround System
If I have been able to help feel free to add to my reputation +/- below - thanks!
find
Maxoo Offline
Fan
Posts: 364
Joined: Mar 2010
Reputation: 12
Location: Paris, France
Post: #1255
Didn't know half of that, thanks a lot for this explanation/clarification !

Admin @ Passion-XBMC
(official french community)
find
steeve23 Offline
Member
Posts: 67
Joined: Apr 2011
Reputation: 0
Post: #1256
(2012-04-17 02:57)bluray Wrote:  
(2012-04-17 02:01)steeve23 Wrote:  So is it working for me, or is an illusion (no sarcasm intended), will directsound work ok? I assumed as the amp has the correct pretty pretty lights, I was good?

Thanks,
Steve
If AVR displayed it correctly, you're good to go.....

Thanks, I had hoped it was working right, but sometimes you're never sure Big Grin

Steve
find
DanielaE Offline
Team-Kodi Member
Posts: 78
Joined: Dec 2011
Reputation: 30
Location: Germany
Post: #1257
Hi folks,

with spare time on short supply, it took me much longer than anticipated to release a new build. This time with the following changes:
  • cut off the very latest Eden branch (mostly translation changes on top of official Eden)
  • a small fix for the single channel audio issue (thanks minimoe)
  • a small fix for the erratic frame rate values seen with some sample files
  • enhanced support for rare types of Dolby Digital Plus streams
  • fix to ffmpeg for correct handling of Dolby Digital Plus streams with embedded AC3 core
On my system this build works at least as good as the official Eden build, in some cases even better. All sample files that I have around work as expected (i.e. within hardware limits of the AMD E-350 APU).

With audio passthrough enabled I strongly recommend to choose these general settings:
  • adjust display refresh rate to match video [on]
  • sync playback to display [off]
  • A/V sync method [audio clock] (if you happen to insist on A/V sync switched on)
Even with A/V sync off you'll see the amount of A/V sync mismatch hovering around a constant value, if your hardware is fine and the media stream is properly muxed - the better the mux, the smaller the deviation. At least, this is the observable behaviour on my lowly machine. Your milage my vary...

Download link: XBMC-11.0+HD-audio full installer

ciao, Dani

AMD Fusion E-350/Win 8/custom XBMC, Yamaha RX-V1900, Pioneer DV-LX50, custom speakers
(This post was last modified: 2012-04-17 20:11 by DanielaE.)
find
Dj Freddy D Offline
Junior Member
Posts: 23
Joined: Jun 2011
Reputation: 0
Post: #1258
Thank you - I will install this in all my htpc's
find
loekf Offline
Junior Member
Posts: 41
Joined: Apr 2012
Reputation: 0
Location: Netherlands
Post: #1259
Big thank you. Works great !!

HTPC: MS-Tech MC-1200 | Asus F1A75-M | AMD A6 3650 | OCZ Agility3 120GB | Corsair Vengeance 2x4GB DDR3| LiteOn iHOS104 BDR | Win7 x64 (Catalyst 12.4) | XBMC 12.0-ALPHA2 Git:20120512-694a759
Home AV: Philips 37PFL5603 | UPC Mediabox | Philips BDP7600/12 | Onkyo TX-NR609 | Sony PS3 Slim | Logitech Harmony One | Sonos audio | Apple TV | 5.1 speakers (TMA, Phonar)
find
minimoe Offline
Senior Member
Posts: 225
Joined: Feb 2011
Reputation: 3
Post: #1260
Thanks Daniela, all problems solved! [Image: JC_doubleup.gif]

[Image: episode-thin-fanart@2x.jpg] [Image: movie-thin-fanart@2x.jpg]
Panasonic 42G10 ♦ Onkyo TX SR507 ♦ Teufel Concept R2 ♦ HTPC (Intel Q6600/ATI5450/Openelec 3.0.3)
find
Thread Closed