XBMC Community Forum  

Go Back   XBMC Community Forum > Help and Support > XBMC General Help and Support > XBMC for Windows Specific Support

XBMC for Windows Specific Support Need help with XBMC for Windows, or think you've found a bug? Discuss it here.

Reply
 
Thread Tools Search this Thread Display Modes
Old 2008-04-06, 14:32   #1
phunqe
Member+ (Donator)
 
Join Date: May 2004
Posts: 222
phunqe is on a distinguished road
Default Music player

Hi,

I've been using ASIO / Kernel audio playback with MediaPortal for greater sound quality and I'm wondering how music is played back in XBMC (currently or what the plans are).
Will/is it possible to do this in XBMC for window as well?

Cheers.
phunqe is offline   Reply With Quote
Old 2008-04-07, 04:14   #2
jmarshall
Team-XBMC Developer
 
Join Date: Oct 2003
Posts: 15,070
jmarshall is on a distinguished road
Default

We use our own custom player.

Perhaps you could elaborate on this "greater sound quality" you speak of and exactly how said quality is achieved?
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


jmarshall is offline   Reply With Quote
Old 2008-04-07, 09:50   #3
phunqe
Member+ (Donator)
 
Join Date: May 2004
Posts: 222
phunqe is on a distinguished road
Default

Thanks for answering jmarshall.
Normal playing through Windows uses the kmixer (I don't know how you are playing the music back however), which tends to reduce sound quality due to crappy resampling to 48 kHz.
With greater sound quality I mean bit perfect playback, achieved by using ASIO or direct kernel streaming (which would output at 44.1 kHz).
It might sound like an audiophile thing, but there actually is an audible difference (of course, you music files needs to be of high quality as well). There are bit-perfect playback plug-ins to for example foobar and winamp.

See below for further explanation.

Quote:
Bit Perfect / Bit Accurate

Lets start off with a bit of explination of how Windows handles audio.

What is the KMixer?

The KMixer is a part of Windows that enables your computer to take multiple audio sources and play them back at the same time and at the same bit rate. The KMixer is also how Windows handles your volume control. Regular CD audio is 44.1 kHz. Many times, due to poorly written drivers, sound cards that will interact with the KMixer wil cause this 44.1kHz data to be resampled to 48kHz. Obviously this will result in an undesireable result when trying to achieve the upmost in sound quality. The mixing algorithm as implemented by Microsoft has been shown in many cases to only have a signal to noise ratio of about 92dB. CDs have a signal to noise ratio of about 96dB (technically 97.5dB). The KMixer effectively reduces the data from 16bit to 14 bit.

To bypass the Windows KMixer you either need to use ASIO or Kernel Streaming.

ASIO

ASIO is a professional audio standard that provides for a low-latency audio stream from the computer. ASIO bypasses the KMixer entirely. ASIO is used by the recording industry as a standard. For more information on ASIO, please see here: MP3Car.com thread

Kernel Streaming

Kernel Streaming is just about the same thing as ASIO. It is Microsofts answer for being able to play audio files in a bit perfect format on a Windows machine. Kernel Streaming make efficient real-time streaming of audio possible. However, Kernel Streaming is not an industry standard. ASIO will have many more supported plugins avaliable for various media players. Kernel Streaming requires less CPU time than the regular ‘wave out method’.

What does this mean?

By bypassing the Windows KMixer and running either ASIO or Kernel Streaming, you are ensuring that you are hearing the music as it was encoded on the CD.

The downside to this? If there are errors on the CD, you will hear them as there is not any correction being made to overcome the error.

In essence, by runinng bit-perfect, you are ensuring that there is no difference in information between the CD that is being read and what makes its way out of the digital output of your sound card.

The quality of a sound card can have an effect on the quality of the output, even with bit perfect playback enabled. The timing and/or jitter can vary between sound cards, usually with the lower end sound cards having a higher likely hood of jitter.

Software:

For ASIO plug-ins:

Http://otachan.com (For a translated version of the page: Translated Web Page)

WinAmp5:

.dll version – From 10/4/2006
.exe version – From 10/4/2006
x64 version – From 10/4/2006

Foobar 2000:

.dll version – From 2/25/2005
.exe version – From 2/25/2006
.x64 version – From 2/25/2006


For Kernel Streaming plug-ins:

You can find a Kernel Streaming plug in for WinAmp 2 available here from Steve Monks: http://www.stevemonks.com/ksplugin/
For some discussion or possibly for some support on this plug-in, check this thread: Hydrogen Audio

For a Kernel Streaming plug in for WinAmp, as well as FLAC and VolumeLogic: Torrent Download

A note about this plug-in for WinAmp: Sometimes the play list will not advance automatically when a song finishes. You will have to manually press Next or select another song. This can be resolved by combining the Kernel Streaming plug-in with the VolumeLogic plug-in also included in this torrent. In Winamp’s output plug-in list, double click on VolumeLogic (setting it as the output plug-in for Winamp to use) and a window will pop up asking you to select the out put plug-in. Select Kernel Streaming from here. This will fix the play list advance issue so everything works. When you double click a song, however, rarely, it will not start. Just press pause twice and it will start like normal.


Audio Codecs that are capable of Bit Perfect:

* ACL880 and ACL882

The AC97 codec is NOT capable of bit perfect playback.

Some rules of thumb for bit-perfect:

* When Bit Accurate mode is applied to the playback, adjusting the volume control or applying EAX effects will not have any effect on digital output signals.
* Once Bit Accurate playback starts, the digital output sampling rate is automatically set to the current playback's sampling rate regardless of the current digital output sampling rate.
* Bit-perfect can only truly be tested using the tos-link out of either your sound card or a compatible audio codec for onboard sound for some motherboards and a DTS-decoder.
* Any software DSP or sound processing will cause the benefits of bit perfect to become null.
* Play with the buffering options. The buffer settings will vary depending on your system. Lower buffers are better, obviously as you will have a lower latency, however, if they are too low you will run into issues with audio drop-out with a system that is under a heavy load.
* Bit Accurate mode is only applicable to .WAV files with the following specifications:
o Stereo Format
o PCM audio data
o 16-bits and above (maximum 32-bits with 24-bits resolution)
o 44.1, 48, or 96 kHz
* Once Bit Accurate playback starts, the digital output sampling rate is automatically set to the current playback's sampling rate regardless of the current digital output sampling rate.


How do I know that I am getting bit-perfect?

If you have successfully achieved bit-perfect playback, you should be able to play a DTS file off of a CD (16-bit, 44.1kHz). If you only get static from trying to play the file, then you know that you haven’t achieved bit-perfect playback.
phunqe is offline   Reply With Quote
Old 2008-04-07, 09:59   #4
phunqe
Member+ (Donator)
 
Join Date: May 2004
Posts: 222
phunqe is on a distinguished road
Default

The quote above is quite old however, there are excellent universal WDM drivers for ASIO at http://www.asio4all.com/
phunqe is offline   Reply With Quote
Old 2008-04-07, 10:06   #5
phunqe
Member+ (Donator)
 
Join Date: May 2004
Posts: 222
phunqe is on a distinguished road
Default

ASIO SDK: http://www.steinberg.de/329+M52087573ab0.html

There are a few implementation out there already however.

As I said, I don't know how you are playing back music at the moment, but if bit-perfect playback isn't possible at the moment I might have time at a later stage to look at a bit-perfect implementation in Windows XBMC myself, Team-XBMC allowing.
phunqe is offline   Reply With Quote
Old 2008-04-07, 10:15   #6
WiSo
Team-XBMC Developer
 
Join Date: Oct 2003
Location: Germany
Posts: 1,773
WiSo is on a distinguished road
Default

feel free. A good starting point is Win32DirectSound.cpp.
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
WiSo is offline   Reply With Quote
Old 2008-04-07, 10:24   #7
jmarshall
Team-XBMC Developer
 
Join Date: Oct 2003
Posts: 15,070
jmarshall is on a distinguished road
Default

I believe Wiso's recent work has allowed XBMC for win32 to output "bit-perfect" (i.e. pass-through'd) compressed streams such as AC3 and DTS assuming they're 48kHz - I'm not sure whether it works with 44.1kHz, and ofcourse it'd depend on the sound card.

All other audio is upsampled using SSRC to 48kHz, which is likely the best way to go for many chipsets (such as those that only allow 48kHz output). Whether or not it still passes through the windows mixer I have no idea, but I presume it does - we use standard directsound for the output.

Any patches to this will ofcourse be considered.

Cheers,
Jonathan
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


jmarshall is offline   Reply With Quote
Old 2008-04-07, 12:55   #8
phunqe
Member+ (Donator)
 
Join Date: May 2004
Posts: 222
phunqe is on a distinguished road
Default

Thank you both, I'll direct any possible future questions on this to the Windows dev forum section.
phunqe is offline   Reply With Quote
Old 2008-10-23, 17:58   #9
injeee
Junior Member
 
Join Date: Oct 2008
Posts: 15
injeee is on a distinguished road
Default

Hi folks,

Any news around this thread? Friend of mine is using MediaPortal for music playback, since it supports ASIO / Kernel Mode.. and he asked me if XBMC could do the same..

Will it be possible sometime?

Thanks!
injeee is offline   Reply With Quote
Old 2008-10-23, 18:23   #10
spiff
Grumpy Bastard Developer
 
spiff's Avatar
 
Join Date: Nov 2003
Posts: 7,715
spiff is on a distinguished road
Default

sure. it's just a matter of you coding it and submitting the patch.
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
spiff is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 20:43.


Protected by Akismet, We recommend WordPress blogs
Copyright © 2008, XBMC Project