Audio output device in WASAPI mode
#1
Music 
Hi All,

I currently set my audio output device (Optical S/PDIF) in WASAPI mode in order obtain the so called bit-perfect music playback (i.e. the source audio stream is passed as it is to an external DAC through the selected audio device). However, in several and quite old posts, I have red that XBMC seems to manipulate in some way the stream, so no real bit-perfect...others, at the same time, are saying that set WASAPI is the way to go for it.

My first question is: which is the real status on such point?

Secondly, looking at the settings, I do not understand the meaning of "Output configuration" and "Resample quality" options. Can someone explain them to me esepcially in case of using WASAPI? Should such options be irrelevant if WASAPI is enabled? Why then is possible to modify them?

Looking forward for the usual kind support! Thansk in advance!
Light IMDb Ratings Update - Keep updated the IMDb ratings for your movies and TV shows.
In case you found useful my work, feel free to offer me a cappuccino!
Reply
#2
A small addition: even if in WASAPI mode, when I try to change the volume inside XBMC through + or - keys, this affects the playback. I was expecting that if WASAPI is used, the only way to change the volume would be through the external amplifier...where Am I missing the point?
Light IMDb Ratings Update - Keep updated the IMDb ratings for your movies and TV shows.
In case you found useful my work, feel free to offer me a cappuccino!
Reply
#3
First of all bit-perfect does not mean pass through the decoded stream. We distinguish between

1)
passthrough the decoded stream
This mode can be configured for WASAPI as well as other drivers. You have to enable passthrough and the codecs the receiver a capable of. In this mode XBMC can't manipulate the stream because it is decoded.

2)
pcm
Note that pcm can still be bit-perfect. If you don't apply any resampling or deamplification, pcm is bit-perfect because the decoding process itself does not have any impact on this.
Reply
#4
(2014-07-01, 17:54)FernetMenta Wrote: First of all bit-perfect does not mean pass through the decoded stream. We distinguish between

1)
passthrough the decoded stream
This mode can be configured for WASAPI as well as other drivers. You have to enable passthrough and the codecs the receiver a capable of. In this mode XBMC can't manipulate the stream because it is decoded.

2)
pcm
Note that pcm can still be bit-perfect. If you don't apply any resampling or deamplification, pcm is bit-perfect because the decoding process itself does not have any impact on this.

Hi FernetMenta (nice nick by the way Wink) and thanks for your answer!

I'm starting to understand what you are saying but in order to solve completely my doubts I will go directly to the point.

I'm focusing on music and my intention would be to listen 2 channels ALAC 16bit 44,1 KHz files, having them sent to my DAC untouched (as they are coded). What Am I supposed to do in addition to set the WASAPI mode? What about the two options "Output configuration" and "Resample quality" that can not be disabled (you mentioned no resampling...)?

In addition you said that there should be no "deamplification"...does this mean that the internal XBMC volume (see <fvolumelevel>1.0</fvolumelevel> in guisettings.xml) needs be set to 1.000 and shoud not be changed?

Sorry if my questions may result stupid... Rolleyes
Light IMDb Ratings Update - Keep updated the IMDb ratings for your movies and TV shows.
In case you found useful my work, feel free to offer me a cappuccino!
Reply
#5
I am not aware of any receivers which can decode ALAC or FLAC so XBMC (ffmpeg) needs to do the decoding: Option 2.

In order to avoid deamplification set XBMC's internal volume to 1.0. This is maximum.

There are some situations which require a resampler, i.e. if you play a file with 48khz and the following file has 44.1. Gapless requires that the following stream uses the configuration of the previous. If we reconfigured the audio output device, there would be a noticeable gap. If you set output configuration to "best match" XBMC will try to reopen the device to match the stream properties. Means if you want to avoid resampling in this case, set to "best match" but be aware that this ruins gapless.
Reply
#6
(2014-07-01, 18:35)FernetMenta Wrote: I am not aware of any receivers which can decode ALAC or FLAC so XBMC (ffmpeg) needs to do the decoding: Option 2.

In order to avoid deamplification set XBMC's internal volume to 1.0. This is maximum.

There are some situations which require a resampler, i.e. if you play a file with 48khz and the following file has 44.1. Gapless requires that the following stream uses the configuration of the previous. If we reconfigured the audio output device, there would be a noticeable gap. If you set output configuration to "best match" XBMC will try to reopen the device to match the stream properties. Means if you want to avoid resampling in this case, set to "best match" but be aware that this ruins gapless.

Thanks a lot! Your explaination was 100% clear!

Is there a way to force XBMC setting the volume at 1.0 every time it starts (actually the last volume level is used)?

Anyway, being my music collection completely at 44,1 KHz, I will go for the "best match" as you suggested! So if after listening some music I will pass to a 5.1 movie the audio device will be reconfigured according to the new source, right?

In addition to that, how the output configuration set to "best match" in XBMC is related to the configuration used in Windows (see below image)? I suppose that XBMC will change that Windows configuration dinamically in case of WASAPI mode...is it the same also in the case of using DircetSound (i.e. no WASAPI)?

Image

Thanks again for you help!
Light IMDb Ratings Update - Keep updated the IMDb ratings for your movies and TV shows.
In case you found useful my work, feel free to offer me a cappuccino!
Reply
#7
Quote:Anyway, being my music collection completely at 44,1 KHz, I will go for the "best match" as you suggested! So if after listening some music I will pass to a 5.1 movie the audio device will be reconfigured according to the new source, right?

yes

Quote:In addition to that, how the output configuration set to "best match" in XBMC is related to the configuration used in Windows (see below image)? I suppose that XBMC will change that Windows configuration dinamically in case of WASAPI mode...is it the same also in the case of using DircetSound (i.e. no WASAPI)?

XBMC opens the configuration which is best for the stream regardless what you have set as default. This is also true for DirectSound with the difference that DS is not open exclusively. DS may mix and manipulate the stream internally.
Reply
#8
Thanks a lot FernetMenta for your reply! Now is all clear!

Just one more hint on your side: no way to have the volume set to 1.0 as a default value every time XBMC is started? Or there could be a way to automatically set it to 1.0 when starting to play music files? In fact, lets suppose to watch a movie that requires to decrease the volume, it would be more efficent not take care about returning it to 1.0 every time I would start to listen music afterwards (or when I start XBMC and the value was set less than 1.0 during the previous "session" of XBMC).

Have a nice evening!
Light IMDb Ratings Update - Keep updated the IMDb ratings for your movies and TV shows.
In case you found useful my work, feel free to offer me a cappuccino!
Reply
#9
I have never thought about this use case. On my living room box I haven't change XBMC's internal volume in 4 years. You can write a simple script and change volume via the api after xbmc has started.
Reply
#10
I know...my use cases are quite crazy...but there is a reason behind...as for everything! Wink

Thanks to your suggestion I have checked the built in functions of XBMC and I found the SetVolume(percent[,showvolumebar]) one that is going in my direction. For example I could use this when opening the music menu... Wink I'm going to open a new thread in the Aeon Nox skin section...actually it seems that is possible to assing only one function to a menu...for me would be nice two: set the volume and open my music collection.

Thanks again for your competence and big help!
Light IMDb Ratings Update - Keep updated the IMDb ratings for your movies and TV shows.
In case you found useful my work, feel free to offer me a cappuccino!
Reply
#11
Already solved! Just for info see http://forum.xbmc.org/showthread.php?tid=199205.
Light IMDb Ratings Update - Keep updated the IMDb ratings for your movies and TV shows.
In case you found useful my work, feel free to offer me a cappuccino!
Reply
#12
(2014-07-01, 18:35)FernetMenta Wrote: I am not aware of any receivers which can decode ALAC or FLAC so XBMC (ffmpeg) needs to do the decoding: Option 2.

In order to avoid deamplification set XBMC's internal volume to 1.0. This is maximum.

There are some situations which require a resampler, i.e. if you play a file with 48khz and the following file has 44.1. Gapless requires that the following stream uses the configuration of the previous. If we reconfigured the audio output device, there would be a noticeable gap. If you set output configuration to "best match" XBMC will try to reopen the device to match the stream properties. Means if you want to avoid resampling in this case, set to "best match" but be aware that this ruins gapless.

For me "gapless" is only meaningful when playing an album, such as Dark Side of the the Moon where the music flows from one track to the next. All the tracks on such an album would usually be the same sample rate. Do you agree that "ruining gapless" will generally have no impact when playing a selection of tracks with different sample rates, even if the "best match" option is selected provided those tracks have a brief period of silence at the beginning and end as most tracks do? Or is there something else to it?

Like the OP I too wish to preserve the audio stream as far as possible and now have the "best match" option selected. I have not noticed any issues.
Reply

Logout Mark Read Team Forum Stats Members Help
Audio output device in WASAPI mode0