Kodi Community Forum

Full Version: AudioEngine branch - DO NOT REQUEST BINARY BUILDS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok with latest build I'm getting crackling on some 2ch mp3s the source of these are unknown so it could be the files but I listen to music every day with AE and never had this before this is on Linux btw
Hi Gnif!
After last commits, DTS-HD and True-HD bitstreaming under Ubuntu 11.04 is not working!
I'm using an Nvidia GT-430.

On the log i get this:

Code:
DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 16 ms
21:22:29 T:140341067360000    INFO: CSoftAE::Initialize - ALSA Initialized:
21:22:29 T:140341067360000    INFO:   Output Device : hdmi:AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x0e
21:22:29 T:140341067360000    INFO:   Sample Rate   : 192000
21:22:29 T:140341067360000    INFO:   Sample Format : AE_FMT_S16NE
21:22:29 T:140341067360000    INFO:   Channel Count : 8
21:22:29 T:140341067360000    INFO:   Channel Layout: FL,FR,BL,BR,FC,LFE,SL,SR
21:22:29 T:140341067360000    INFO:   Frames        : 2048
21:22:29 T:140341067360000    INFO:   Frame Samples : 16384
21:22:29 T:140341067360000    INFO:   Frame Size    : 16
21:22:29 T:140341067360000   DEBUG: CDVDPlayerAudio:: synctype set to 0: clock feedback
21:22:29 T:140341138654976   DEBUG: CSoftAEStream::GetFrame - Underrun
21:22:29 T:140341067360000   DEBUG: CDVDPlayerAudio:: Discontinuity - was:522542.693000, should be:39805.712876, error:-482736.980124
21:22:29 T:140340874966784   DEBUG: CDVDPlayer::HandleMessages - player started 1
21:22:29 T:140341138654976   ERROR: CAESinkALSA::AddPackets - Timeout waiting for space
21:22:29 T:140341138654976   ERROR: Previous line repeats 6 times.
21:22:29 T:140341138654976   ERROR: CAESinkALSA::AddPackets - Underrun
21:22:29 T:140341079103232   DEBUG: AddOnLog: VDR XVDR Client: SendPing
21:22:30 T:140341138654976   ERROR: CAESinkALSA::AddPackets - snd_pcm_writei returned 0 (Success)
21:22:30 T:140341067360000   DEBUG: CDVDPlayerAudio:: Discontinuity - was:431098.359876, should be:239166.666667, error:-191931.693210
21:22:30 T:140341138654976   ERROR: CAESinkALSA::AddPackets - Timeout waiting for space
21:22:30 T:140341138654976   ERROR: Previous line repeats 7 times

Have you an idea of what is the reason?
Thanks and regards

Davide
@gnif - since the change you made - where it was hard coding from 2 ch to use the user specifications (in my case 5.1 now) - some negative things have happened. 1) DTSHD still doesn't play (core in my case) 2) Multichannel FLAC as well as DTS music discs no longer play. I'll post a log, should I do one log playing all three instances, or one for each or?
@dado483 - Try increasing periods per gnif's earlier post - start with about double that - should fix/reduce the underruns/discontinuities/timeouts.

gnif Wrote:@Gryph - Try and increase ALSA_PERIODS in "xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp" until the problem goes away, there was an error in the calculation of these values earlier, but obviously needs some tweaking for different hardware still.
Is my crackling caused by this issue too?
Quite likely - yes
@gnif - You commit has fixed the issue, files play fine now. But still seeing the timeouts flooding the log.

http://pastebin.com/vN5kjqNS

Enjoy that much needed sleep, I'll make some adjustments on my end ... See if I can sort that out (might even fix dado483s issue as using the same hardware and OS)

From AESinkALSA.cpp - I see this as well:
#define PERIOD_SIZE_MS 20

But from the log, I see this:
DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 30 ms

This a probable cause, or am I barking up the wrong tree?

EDIT: But I did forget to say, that DTSHD/HR & TrueHD all seems to work perfectly - It doesn't miss a beat.
The pretty blue light shines to life stating HD Audio; when I terminal into the receiver and play a few sample files it spits out everything I want to see!
!1IFVHDMI 1,1920x1080p 24Hz,YCbCr,24bit,HDMI,1920x1080p 24Hz,YCbCr,30bit,,
!1IFAHDMI 1,DTS-HD MSTR, 48kHz, 5.1ch,DTS-HD Master Audio,5.1ch,
!1IFAHDMI 1,Dolby TrueHD, 48kHz, 5.1ch,Dolby TrueHD,5.1ch,
!1IFAHDMI 1,DTS-HD HI RES, 96kHz, 7.1ch,DTS-HD High Resolution,7.1ch,
same here no dts-hd or true hd on lucid gt430 as well, but all flac, mp3, dts,dd etc all are fine. suspend resumes with about 5% cpu usage but still no audio and have to restart xbmc to get it. I will test in the morning and post some logs for ya.

I upped mine to 8 from 4 and DTS-HD played ok for a bit and then started dropping frames and audio, truehd Not at all.

thanks,

Dave
@gnif - e-mailed u WASAPI sink 1.0.0 and mod to SoftAE to support audiophile mode as discussed Big Grin

Excuse the kludge in the sink - can clean up after some feedback from here and we'll get *very* good debug info.

For shits and giggles: The Origin of WASAPI
@DDDamian - How does this audiophile mode work? I have already compiled the latest commit with this in it, wanted to test it out.
Gryph Wrote:@DDDamian - How does this audiophile mode work? I have already compiled the latest commit with this in it, wanted to test it out.

It'll involve quite a bit more in the next while, but right now what it means is that music (or other audio streams) are played back true to their source format.

For example, if I'm playing a stereo mp3 and add a 6-channel flac at 96/24 next, the flac will be played back in it's original format instead of being down-converted to stereo at 44.1khz. It means we don't lose audio quality when we bounce around different formats.

Same applies to going from a DD5.1 trailer to a DTS-MA movie.

The downside is: not cross-fading and a slight pause while your receiver switches it's internal processing to accomodate the new sample rate or channel count.
Another note: Windows Vista and Win7 users can now select between Exclusive mode (best audio quality) and Shared mode (won't override other Windows sounds), and it's all event-driven for the lowest possible latency Cool
@gnif - I just compiled and tried a few movies. Everything seems to be working as it should so far. I've played a few DTS-HD, DTS and Dolby Digital movies. The only thing that is not working is the GUI sounds. I don't know if they are active yet or not?

I made a log but the logs get really big in this version (3,5mb) and pastebin does not allow that many rows.
Do you want me to upload the log somewhere else?

Edit: I uploaded the log here. http://www.speedyshare.com/file/xYEHp/download/xbmc.log
This is when starting XBMC and navigating the GUI and playing a DTS-HD clip. There is no sound in the GUI for some reason and the log seems really big compared to what it used to be.
@DDDamian ... Cheers, that clears up that ... It's actually one thing I haven't tested out in particular with AE in detail now you brought that up, I only have a few flacs, and only 2 channel ...

But, having just listened to them now ... I am really impressed! I'll have to dig out some 6 channel ones for testing.
DDDamian Wrote:The downside is: not cross-fading and a slight pause while your receiver switches it's internal processing to accomodate the new sample rate or channel count.

Heh, my processor takes 7-10 seonds to adjust between stream changes, so (without me having read exactly what this does) I sure hope it's optional.

One feature I want with AE - to work around my processor's slow switching is to keep the same format when listening to music, say 24/96 5.1
and stereo music would be upmixed to 5.1 or 2.1 (.1 being LFE and the other 3 channels maybe something similar to old functionality we had on Xbox, Stereo to all speakers). All being optional to user of course.

I also listen to multi channel music, like SACD rips or QUAD Vinyl recordings. they too would be upmixed from eg 44.1, 48, 88.2Khz to 96 if they aren't already.