Bit perfect Audio in XBMC
#61
hallo! sorry for my so-so english. that's my first message, after lot of lurking and researches.
I'm not new to digital equipment for playing music. I came from ALAC accurate rips with XLD, from a mac mini, through spdif in Lavry DA10 dac, in NuForce pre P8, in NuForce ref.8, and at the end in Kilipsh RF5.

but now I'm a completely different situation. a WDTV in Onkio for 5.1, and a dedicated (little) system for 2.0 audio (but I liked discovery OE, new PVR resources, installing tvheadend and make my SAT card working, with [REMOVED BY ADMIN] and many customization and the beautiful NOX themes)

after lot of work, my OPENELEC system was declared 'working' with all features I need.
I have, however, something I can't understand with audio. here my actual set-up:

- OPENELEC 3 RC1, same ALAC sources in: zotac HD-ID11 ION2
- fatman Itube mkII with USB input
- speakers (tangent evo)

in system/audio I disabled sounds, replay gain and set USB Audio Device as output.
I really can't understand terms as Analog/Spdif, and passthrough in this situation, that I can find in audio menu! and that's first problem.

what I found, however, is that playing music with that dac pull out a sound that is distorted.
volume is very high, as I little turn up the volume on ampli it sounds very loud. that didn't happen in windows, with foobar or jriver.
music is not clear, is fat and compressed. there's something wrong in set up. my ampli is so called hybrid, a tube preamp and a discrete final stage, and it seems that it has a signal input kept in clipping.

the "eye" valve, however, reports that signal is not at so high levels.

lsusb reports: CM102-A+/102S+ Audio Controller
h**p://www.cmedia.com.tw/ProductsDetail.aspx?C1Serno=2&C2Serno=2&C3Serno=5&PSerno=17

it's a 44 / 48Khz 16 bit capable DAC

I tried with XBMC MAC version. it was late night, so I didn't turn up volume, but my impressions were the same. so I think that it's XBMC related, same files on iTunes (midi configuration set to: 44Khz, 16bit, 100% volume so coreaudio ins't involved and audio is bit perfect) plays nice and with no distorsion / clipping.

a little help is greatly appreciated, I'm one step to my goal. thank you.
Reply
#62
oh, no! now I *lost* my stereo left channel, however sound come from right speaker is still bad...
I haven't done anything to make left channel mute, so I'm going mad.

I had a boot in windows 8 to have a test with wasapi foobar, and left channel came back... and... what a sound!
I'm not in fault, there's something bad, but what?

here some cut of log:

21:31:37 T:139902788302592 DEBUG: NEWADDON PythonCallbackHandler construction with PyThreadState 0x7f3da0000920
21:31:39 T:139905032124224 DEBUG: Previous line repeats 15 times.
21:31:39 T:139905032124224 DEBUG: Joystick 0 button 1 Down
21:31:39 T:139904843585280 DEBUG: CSoftAE::Run - Sink restart flagged
21:31:39 T:139904843585280 INFO: CSoftAE::InternalOpenSink - sink incompatible, re-starting
21:31:39 T:139904843585280 INFO: CAESinkALSA::Initialize - Attempting to open device "@:CARD=Device,DEV=0"
21:31:39 T:139904843585280 INFO: CAESinkALSA::Initialize - Opened device "front:CARD=Device,DEV=0"
21:31:39 T:139904843585280 INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
21:31:39 T:139904843585280 INFO: CAESinkALSA::InitializeHW - Using data format AE_FMT_S16NE
21:31:39 T:139904843585280 DEBUG: CAESinkALSA::InitializeHW - Request: periodSize 512, periods 16, bufferSize 8192
21:31:39 T:139904843585280 DEBUG: CAESinkALSA::InitializeHW - Got: periodSize 512, periods 16, bufferSize 8192
21:31:39 T:139904843585280 DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 186 ms
21:31:39 T:139904843585280 DEBUG: CSoftAE::InternalOpenSink - ALSA Initialized:
21:31:39 T:139904843585280 DEBUG: Output Device : USB Sound Device
21:31:39 T:139904843585280 DEBUG: Sample Rate : 44100
21:31:39 T:139904843585280 DEBUG: Sample Format : AE_FMT_S16NE
21:31:39 T:139904843585280 DEBUG: Channel Count : 2
21:31:39 T:139904843585280 DEBUG: Channel Layout: FL,FR
21:31:39 T:139904843585280 DEBUG: Frames : 512
21:31:39 T:139904843585280 DEBUG: Frame Samples : 1024
21:31:39 T:139904843585280 DEBUG: Frame Size : 4
21:31:39 T:139904843585280 DEBUG: CSoftAE::InternalOpenSink - Using speaker layout: 2.0
21:31:39 T:139904843585280 DEBUG: CSoftAE::InternalOpenSink - Internal Buffer Size: 4096
21:31:39 T:139904843585280 DEBUG: AERemap: Downmix normalization is enabled
21:31:39 T:139904843585280 DEBUG: CSoftAEStream::CSoftAEStream - Converting from AE_FMT_S16NE to AE_FMT_FLOAT
Reply
#63
@8rnity - I'm confused. You mention a Mac, then in the next post Win8 but show a log portion using a Linux build??
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!
Reply
#64
hi, as I wrote I come from mac mini, (prev configuration) actual I have openELEC on zotac HD-ID11 mini pc. I tried windows 8 to test with foobar if something wrong with my dac/ampli.

I have an update: if I boot with tv volume higher than 0 (mute) I have both channels, otherwise I lose my left front channel. as said I have an usb dac, plus the zotac id11 is connected via hdmi to my tv set. maybe the very bad signal is dued to some kind of interation with hdmi signal?
Reply
#65
(2013-01-04, 17:56)ian-ep Wrote: Does anyone know the situation with regard to bit-perfect stereo audio over USB?

I have a Cambridge StreamMagic 6 which contains a USB audio 2.0 (asynch) DAC capable of 24/192 (same DAC as the DacMagic plus). It works fine with spdif (optical) up to 24/192 from my Asrock ION 330HT running the latest Openelec beta with Frodo. However, I can almost never get xbmc to recognize the StreamMagic as a USB DAC. It simply doesn't appear as an option. I say 'almost never' as I have succeeded a couple of times getting the DAC to appear in the options a couple of betas ago, but it disappeared again after a reboot. So it obviously can be done ... but how to make it stick?

It worked flawlessly in Eden with a custom audio setting of 'plughw:2,1', but the custom option has mysteriously been removed in Frodo, so ...

Any suggestions?

Ian

G'day Ian,

I had a similar issue that I previously used the old custom audio settings for - basically the HDMI is selected as default and the USB outboard not even acknowledged (and so did not show as an option in Frodo)! (This is a Linux issue - not an XBMC failing).

If this sounds similar to what you are experiencing, I fixed it by editing /etc/modprobe.d/alsa-base.conf

Simply change:
Code:
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2


To:
Code:
# Assign USB Audio as default sound card
options snd_usb_audio index=-1

And reboot... with any luck you should now be able to select your USB DAC from within XBMC.
Reply
#66
Hi,

I'd like to first say a big thanks for all your work, efforts and supports!
xbmc is a wonderfull piece of software!

Now that my new htpc is running, I'd like to "optimize" audio & video quality,
I'm having a 2 speakers HiFi installation, with external DAC and use a Usb HiFace2 as transport (usb to toslink).
If I configure Hiface2 to WASAPI, and uncheck all Dsp/Gain tweaks, will my rips (FLAC CD) play bit-perfect?
Anyway to ensure that?

I'm running Frodo 12.0 on Windows Home Server 2011
Reply
#67
>>mika91

I doubt you'll have any luck friend.
I'm in a similar situation trying to output 24bit 2ch lpcm via my toslink and no luck, can't be done.

Either xbmc won't output it or (in my case) openelec is f**ked up, either way it's back to my old "Dune Base HD 3" that machine plays it all and actually outputs what it's menat to Smile

Here's my thread perhaps it can give you some hints: LINK
Reply
#68
(2013-01-07, 00:05)rat666 Wrote: i´ve tried to play a HDCD coded Flac with RC3 and my Receiver didn´t show "HDCD" on the Display (it shows 2Ch PCM), so i don´t think the output is Bitperfect (the HDCD Flag gets lost).
With the Betas of frodo my Receiver switches permanently between HDCD and 2ch PCM.

i have tried the latest openelec release 2.99 rc 4 from 1st of March, the Problem remains.

i guess it has something to to with the internal Volume control. The HDCD Flag get lost at exact the same time, everytime i play the File.

sad, i hoped i can use xbmc for serius digital audio output, but without an untouched bitperfect output, i can t. Sad

i ve tried audiophile settings in advancedsettings.xml and <fvolumelevel>1.000000</fvolumelevel> without success.
HTPC (AMD X4 620, Geforce GT 520, Tevii 470, Antec Fusion Case with Imon LCD) with Openelec Gotham Nightlies
Raspberry Pi with Openelec Nightlies for Testing

Reply
#69
How come the volume adjustments in xbmc affect the sound volume when using passthrough?

Passthrough should not be affected by any mixer/amplification/normalization right?

I'm just trying to learn and understand how xbmc (AE) does it's work.
Yes I have annoying threads all around discussing different aspects of audio out, I'm a curious Asperger-like maniac who just doesn't stop Wink

Anyway, when I'm playing wave files (just simple audio files ripped from my CD's, uncompressed.) I can always adjust the volume using the xbmc volume adjustments.
To me that says there is no passthrough but instead, the audio is going through all the "magic" processing I really would prefer to skip.
Also looking at my logs the passthrough device is either logged as "no passthrough" or just not mentioned at all.

Log1
Log2

Tried using different settings, actually all possible combinations.
Mostly these
:
Audio Output: Optical/Coax ( And Analog)
Speaker Config: 2.0
Boost Volume level on downmix: disabled
Output stereo to all speakers: disabled
-Dolby Digital capable receiver: disabled
-DTS capable receiver: disabled
-AAC capable receiver: disabled
-Multichannel LPCM capable receiver: disabled
-DTSHD capable receiver: disabled
Audio Output Device: ALC892 Digital S/PDIF
Passthrough Device: ALC892 Digital S/PDIF
GUI Sounds: Disabled

Using current software/hardware:
Xtreamer Ultra2 (OpenELEC - Version: 3.0.0, 3.7.10 x86_64) -> Optical Out -> Benchmark DAC


Anyway, hope everyone is having a good weekend Smile
Reply
#70
You know, I started answering your post a different way before I checked on my own HTPC (see sig). Then you got me curious. Nice going. Big Grin

I'll repeat what I understand just in case I've understood something wrong:
  • You want to passthrough 2 channel wav files (CD original source, it appears, so it's PCM)
  • Your external DAC is connected via S/PDIF
  • Your external DAC handles max 2 channels @ 192kHz. Doesn't do Dolby Digital nor DTS.

I have pass-through configured in my setup and it works, at least for DTS and DD encoded material. As you note, I can't change the volume when it's being passed through. Verified from a debug log I ran on a test. Since your DAC doesn't do DD or DTS, you would never be able to check this in your setup.

The question here is really if PCM material should behave the same way. I.e. lockout the XBMC volume control.

I went through the wiki entry for AudioEngine/HOW-TO: Configure audio and it seems to indicate that multichannel LPCM should be passed through to the receiver through the pass-through output device (WASAPI exclusive mode, HDMI, in my case). I also understand LPCM and PCM to be the same thing.

I tried two 5.1 channel PCM wave files I downloaded from here and here, but as you can see from my debug log 1 and debug log 2, passthrough mode isn't used. I did cheat on the first log and set my "audio output device" to s/pdif (which isn't connected) and got no sounds. So it obviously wasn't being passed through to my AVR -- it does handle up to 8 ch PCM on HDMI. Yes, I have enabled the "MultiChannel LPCM capable receiver " option. My AVR does indicate PCM, however, even in the 5.1 tests with correct number of channels listed.

Maybe I'm not understanding how PCM is supposed to work, or the multichannel LPCM receiver option.

The wiki states that LCPM is played to the device listed in the "Audio output device". It also states the encoded formats in the capable receiver options are sent to the pass-through device -- of which multichannel LCPM is an option. Unless LCPM isn't considered an "encoded" format.

Hopefully I haven't diverged very far from this thread. If so, I'd be happy to take this point to a new thread. But now I have to know.
HP Stream Mini w/Libreelec -> HDMI -> Toshiba 37"
Intel NUC8i3BEH w/Libreelec -> HDMI -> LG OLED55C3PUA -> S/PDIF -> Sony HT-CT80
Dell Optiplex 7050 Micro w/Libreelec -> HDMI -> Yamaha RX-V467 -> HDMI -> Toshiba 47L7200U
Reply
#71
All PCM tracks use the Audio Output Device and are capable of being processed by XBMC hence why volume amplification works, audio will remain untouched unless any of the processing options are modified from defaults, just ensure WASAPI is used to prevent Windows doing anything to the audio stream.

I wrote that wiki page and probably generalised too much regarding the "capable receiver" items, Multichannel LPCM is not an encoded format so is the one exception and should indeed use the Audio Output Device along with all other forms of PCM. I thought I'd made the distinction between the devices obvious so this would be clear.

As for WAV, MP3, FLAC, etc music, these are all containers and the audio inside is PCM, thus these can be processed and sent to the Audio Output Device.
Reply
#72
>>Jogee

Nice to see that I infected you with my own curiousity Wink
You are correct in the assumptions (all three) regarding my dilemma/settings.


>>Jjd-uk

Thanks for clarifying! Smile
So if I get this right (english is not native to me) you're saying that pcm is not being "processed" but only volume adjustments still apply right?
If so, at what volume setting in xbmc is no amplification or volume adjustment made to the sound?

And are the settings I'm using the correct ones for my 2ch DAC?
http://forum.xbmc.org/showthread.php?tid...pid1388961
Reply
#73
If settings are at defaults then the PCM is not touched by XBMC.

The PCM will be processed if volume adjustments are made within XBMC, thus it's best to never touch the XBMC volume adjustment and adjust volume on your amp instead.

To be absolutely sure check the guisettings.xml file in your userdata folder and look for:

<fvolumelevel>1.000000</fvolumelevel>

anything other than 1 means volume is being adjusted.
Reply
#74
I've posted earlier in this thread (posts #12 - #15) about a sound issue when playing my multichannel FLAC files (88.2kHz 5.1 files extracted from SACDs that I own). The issue seems to have got much worse with the recent Frodo stable release on openelec (openelec 3.0). Basically what is happening is that between tracks on my multichannel albums, my Onkyo receiver is "clicking" due to stream format change (or whatever) and doesn't process the first bars of the next track. This was happening back in January and reported in the earlier posts, but only when I manually skipped from track to track. Now it is happening while xbmc is playing normally and occurs after almost every track, but this behaviour is not consistent. Also, when I press "STOP" on the remote control when playing a track the receiver starts clicking constantly until I select another source of sound output - a TV programme or video or whatever. It doesn't seem to be an issue with normal two channel PCM sound.
I've posted a debug log - http://pastebin.com/Qshatc4j
At 12:36:17 I start playing track 1.
At 12:42:00 the eof from track 1 is detected and xbmc starts to seek track 2 from cache
At 12:42:05 there is an error in the log 12:42:05 T:139859167131392 ERROR: CAESinkALSA::HandleError(snd_pcm_writei(1)) - underrun
The amplifier clicks

Again at 12:47:10 between track 2 and track 3 there is another underrun error and corresponding "click"

When track 4 plays at 12:54:31 there is no click from the amplifier and I can't find any underrun errors in the log.

When I press "STOP" at 12:55:43 there is constant intermittent clicking from the amplifier until I select the album again - this time from a network source.
The error displayed in the log is 12:55:43 T:139859167131392 ERROR: CAESinkALSA::HandleError(snd_pcm_wait) - underrun
12:55:52 T:139858267780864 ERROR: Previous line repeats 34 times.

The problem seems to be slightly different from when I experienced it before but it would seem to be associated with snd_pcm-writei or snd_pcm_wait underrun errors.

Is there anything I can tweak in the settings or is this a bug?
Odroid N2+ and Venz V10Pro (S905X), Sony DN1080 AVR, Samsung 49" LCD, Monitor Audio Bronze 5.1 speakers
Reply
#75
>> fat-tony

I doubt it will help but you could try my settings by adding this to your advancedsettings.xml file:

<advancedsettings>

<gui>
<algorithmdirtyregions>1</algorithmdirtyregions>
<nofliptimeout>1000</nofliptimeout>
<destroywindowcontrols>false</destroywindowcontrols>
</gui>

<network>
<disableipv6>true</disableipv6>
<cachemembuffersize>335544320</cachemembuffersize>
<statfiles>false</statfiles>
</network>

<audio>
<audiophile>1</audiophile>
<allowtranscode44100>1</allowtranscode44100>
<streamsilence>1</streamsilence>
<applydrc>false</applydrc>
<limiterhold>0</limiterhold>
<limiterrelease>0</limiterrelease>
<fvolumelevel>1.000000</fvolumelevel>
</audio>

</advancedsettings>

Good luck!
Reply

Logout Mark Read Team Forum Stats Members Help
Bit perfect Audio in XBMC2