Kodi Community Forum
AudioEngine branch - DO NOT REQUEST BINARY BUILDS - Printable Version

+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+--- Thread: AudioEngine branch - DO NOT REQUEST BINARY BUILDS (/showthread.php?tid=78289)



- apgood - 2011-05-13 00:47

Great work. Will download it and test


- apgood - 2011-05-13 01:11

ArtVandelae Wrote:Alright, new test build. There was a tiny unsigned int wrapping bug in the stream code that took forever to track down because when it occurred the whole playback pipeline would get backed up and cause buffer overflows and error messages everywhere but where the problem actually was. The good news is that the resampler should now work perfectly. I've tried several clips that used to crash and they all work perfectly.

Have at it: http://www.multiupload.com/LQT1YGSKPM

No go mp3 audio still garbled for me.... If there is any sort of additional info a can provide (e.g. logs) then just let me know where i need to get them from...

Edit: Ok found problem. I did this "try it with Settings->Video->Playback->Sync Playback to Display turned off" and the mp3 audio is no longer garbled. So I guess there's a bug in the code somewhere related to this... hope this helps


- ArtVandelae - 2011-05-13 01:43

apgood Wrote:No go mp3 audio still garbled for me.... If there is any sort of additional info a can provide (e.g. logs) then just let me know where i need to get them from...

Edit: Ok found problem. I did this "try it with Settings->Video->Playback->Sync Playback to Display turned off" and the mp3 audio is no longer garbled. So I guess there's a bug in the code somewhere related to this... hope this helps

It's not really a 'bug'. The code to adjust the audio to be in sync with the video just hasn't been updated to work perfectly with AE yet. It's on the to-do list.


- apgood - 2011-05-13 02:03

Ok no worries I'll just for.it to be updated then before I use that option. Smile


- ArtVandelae - 2011-05-13 03:56

Unpack this exe and overwrite the previous XBMC.exe. See if this fixes your garbled mp3s.

http://www.multiupload.com/CN8T8GVBA5


- Calvados - 2011-05-13 14:14

@gnif: your last merge with ArtVandelae code doesn't compile on Linux, some header fudge I think.


- apgood - 2011-05-14 01:35

ArtVandelae Wrote:Unpack this exe and overwrite the previous XBMC.exe. See if this fixes your garbled mp3s.

http://www.multiupload.com/CN8T8GVBA5

Thanks Smile I'll test it tonight and let you know how it goes.


- apgood - 2011-05-14 06:38

ArtVandelae Wrote:Unpack this exe and overwrite the previous XBMC.exe. See if this fixes your garbled mp3s.

http://www.multiupload.com/CN8T8GVBA5

Thanks ArtVandelae. Tested this with mp3 sound track and video sync enabled. Worked perfectly.


- HeresJohnny - 2011-05-14 10:14

I've tested the Windows build with an Nvidia ION via HDMI and I get either no sound or freezes :-(. Hopefully AE will not affect XBMC generally this way once it's merged. All I was really hoping for was that the audio engine would finally be honouring the correct bitdepth and not downsample everything to 16bit... the passthrough via WASAPI already seems to work in Dharma for the formats I'm using. As a music lover, I would have replaced foobar with XBMC in that case. Sorry for ranting.


- dado483 - 2011-05-14 15:15

gnif Wrote:@dado483 - Can you please post your log.

Here is my log:
http://pastebin.com/usNQXax7

Reading the log, i can see when i am in the main menu, XBMC open the correct audio device (hdmi:NVidia) and sounds works good.
When i play a movie, XBMC try to open a wrong audio device as below:

15:03:09 T:140300823357184 M:3671257088 ERROR: CAESinkALSA::Initialize - snd_pcm_open_lconf(-22) - hdmi:CARD=NVidia:AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x02
15:03:09 T:140300823357184 M:3671257088 ERROR: CAESinkOSS::Initialize - Failed to get supported formats, assuming AFMT_S16_NE
15:03:09 T:140300823357184 M:3671257088 INFO: CSoftAE::Initialize - NULL Initialized:
15:03:09 T:140300823357184 M:3671257088 INFO: Output Device : NULL
15:03:09 T:140300823357184 M:3671257088 INFO: Sample Rate : 48000
15:03:09 T:140300823357184 M:3671257088 INFO: Sample Format : AE_FMT_S16NE
15:03:09 T:140300823357184 M:3671257088 INFO: Channel Count : 2
15:03:09 T:140300823357184 M:3671257088 INFO: Channel Layout: FL,FR
15:03:09 T:140300823357184 M:3671257088 INFO: Frames : 960
15:03:09 T:140300823357184 M:3671257088 INFO: Frame Samples : 1920
15:03:09 T:140300823357184 M:3671257088 INFO: Frame Size : 4

hdmi:CARD=NVidia:AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x02 is not a valid device for me and audio is not working (movie is also played 3x faster).

On the linux console, i can read this message when i play a movie:

ALSA lib conf.c:4647: (snd_config_expand) Parse arguments error: Invalid argument
ALSA lib pcm.c:2212: (snd_pcm_open_noupdate) Unknown PCM hdmi:CARD=NVidia:AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x02

Hope this help.

Davide


- Ominous - 2011-05-14 15:46

ArtVandelae Wrote:Unpack this exe and overwrite the previous XBMC.exe. See if this fixes your garbled mp3s.

http://www.multiupload.com/CN8T8GVBA5

Everything is working great now. AAC, MP3, AC3, THD, DTS, FLAC! Wonderful work.


- dado483 - 2011-05-14 17:58

dado483 Wrote:hdmi:CARD=NVidia:AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x02 is not a valid device for me and audio is not working (movie is also played 3x faster).

Hi Gnif,

i've found the problem!!
I've correct it in my github repo, you can see the solution at this link: https://github.com/dado483/xbmc/commit/2fdb83a4117d0b38c49440d512c9a0782e8c37ba

Can you correct this on your code?

A big problem is now solved for me, but all is no working so good.... No
I've tried to play a Blu-Ray disc with Dolby True HD audio: my Onkyo TX-SR308 correctly identify the True HD track (LED are correctly turned on), but audio is distorted and not always reproduced by the speakers.

With others audio formats (DD, DTS, Mpeg2) sound is OK.

I don't know now what is the problem, if can help i can post a new log.

Thanks
Davide


- Calvados - 2011-05-15 06:26

Compiled the latest build - so I can confirm my mono 22Khz FLV crash bug is now fixed Smile. However, FYI, the loss of multi channel after playing a pass through bug still exists. The log for my test case is at:

http://pastebin.com/bfMJETQQ

1. I played a FLAC 5.1 88Khz, AE plays it correctly.
2. I played a DTS movie, AE pass it down correctly.
3. I played again the initial 5.1 88Khz flac, AE "downmix" to 2 channels... in fact everything would be passed as a 2 channels.

Alternatively, you can take any Multichannel PCM/Wave/whatever, it will do the same.

Cheers


- Calvados - 2011-05-15 06:48

@dado483: I think your ALSA sound config is not entirely done "properly". plug:CARD=NVidia means that you do not select HDMI as an audio output device but use a custom string. In my experience, the HBR passthrough only works fine when it outputs to HDMI device as per defined in the HDA-Intel.conf file, otherwise it kinds of barf at it. I had to set a probe_mask to get that going nice.

That being said, I could be wrong, ALSA is still baffling me sometimes Smile. I think your suggested patch makes the rest of the params passed ignored, which is why the thing doesn't play correctly.


- dado483 - 2011-05-15 15:04

Calvados Wrote:@dado483: I think your ALSA sound config is not entirely done "properly". plug:CARD=NVidia means that you do not select HDMI as an audio output device but use a custom string

If you see my log, the device opened by XBMC is not plug:CARD=NVidia, but hdmi:CARD=NVidia, so i think the device is correct (in fact audio is working good. In XBMC settings i've not used a custom audio device, but i've selected the option "HDA NVidia hdmi").
For allow system to address the correct device using hdmi:CARD=NVidia i've setted a probe_mask in /etc/modprobe.d, without this setting is necessary address directly the audio device (for example hw:1,9) otherwise the system, using hdmi:CARD=NVidia, open a wrong audio device.

Googoling a lot, i've found that if you want pass some settings to your audio device (for example AES settings), the correct syntax is use the comma (,) and not the colon ( : ). In fact if you see my modify at the code, i've changed it (i've also try it using "aplay" and "speaker-test" utility and they too have confirmed this).

Now my problem is when opening a video with a THD audio track. Audio is discontinuos and fragmented, i don't know if it's an ALSA problem or an XBMC problem, but for me is not working properly.

Other audio track formats (MP2, Dolby Digital, DTS) are all working ok.
Today i can try to change my alsa drivers (currently i'm using 1.0.24) and see if this improve the situation.

Davide