Kodi Community Forum
Testing audio engine ActiveAE - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: Testing audio engine ActiveAE (/showthread.php?tid=170338)



RE: Testing audio engine ActiveAE - FernetMenta - 2014-03-13

Describe exactly the steps needed to reproduce the issue. Only if it can be reproduced it can be fixed.


RE: Testing audio engine ActiveAE - kyungrak - 2014-03-13

(2014-03-13, 19:24)FernetMenta Wrote: Describe exactly the steps needed to reproduce the issue. Only if it can be reproduced it can be fixed.

Well, if paplayer is the default audio player and setting is 'best match', you can play individually audio files whatever the sample rate.
But if using party mode or a playlist with audio files with different sample rates, xbmc freezes when the sample rate of the source file changes.
It doesn't happen with dvdplayer.
If the setting is 'optimized', it doesn't happen neither but when switching from 44.1 to 192 for instance, the sample rate stays on 44.1.


RE: Testing audio engine ActiveAE - FernetMenta - 2014-03-13

hmm, I can't reproduce here with this information. With exact steps I meant:

- what platform are you on
- what exactly are your audio settings
- xfading active? if yes what setting
- what samples (format sample rate, ....) are needed in the playlist? are 2 enough?


RE: Testing audio engine ActiveAE - kyungrak - 2014-03-13

(2014-03-13, 19:45)FernetMenta Wrote: hmm, I can't reproduce here with this information. With exact steps I meant:

- what platform are you on
- what exactly are your audio settings
- xfading active? if yes what setting
- what samples (format sample rate, ....) are needed in the playlist? are 2 enough?

I'm on xbmcbuntu.
Audio streams are output through HDMI, set with 5.1 channels and 'best match'.
No crossfading.
I have only alac and flac files in my library. Most of my standard 44.1/16bit files are alac. All of my hi res files (>48, 24bit) are flac.
About playlists I'm not sure the bug is there (don't remember if I tested only with playlists without party mode). I know for sure it doesn't work with party mode. One easy way to reproduce the bug with party mode, is to start a party mode, and then chosing a song to be played next with a different sample rate, it crashed each time I tried.


RE: Testing audio engine ActiveAE - FernetMenta - 2014-03-13

You need to be more precise if you want me to fix.

What files in what order do I have to put into a playlist?


RE: Testing audio engine ActiveAE - gjwAudio - 2014-03-13

@FernetMenta

Thank you for your reply. Please allow me to echo back the content, with my understanding of it's meaning and implications.
(2014-03-13, 13:30)FernetMenta Wrote: This <IS WHAT> happens when opening <A> 3.0 <CHANNEL FILE, FORMATTED AS> FL,FR,FC
  1. <BECAUSE> you can't have gaps <BETWEEN THE REQUIRED CHANNELS IN THE ALSA CHANNEL MAPPING SEQUENCE>,
  2. <AND> in ALSA map, FC is at pos 5 <ie: FL,FR,BL,BR,FC,LFE>
  3. <AND> only even numbers of channels are allowed <IN ALSA, eg: 2 -OR- 4 -OR- 6, etc.>
<XBMC/ActiveAE MUST CHOOSE A 6-CH OUTPUT STRUCTURE, AND MUTE THE 3 UNUSED CHANNELS, TO TRANSPORT FL,FR,FC TO CORRECT SPEAKER LOCATIONS>

This is why 3.0 opens as 5.1.

The preceding implies that ActiveAE is where the decision is made to select an appropriate 2- or 4- or 6-channel output structure. That choice is not restricted by a call to some "black box", over which ActiveAE has no control.

(2014-03-13, 13:30)FernetMenta Wrote: <SINCE A> 4.0 <FILE IS ALREADY STRUCTURED> as FL,FR,BL,BR <IT> is valid <ACCORDING TO CONSTRAINTS 1 & 3 LISTED ABOVE.
THEREFORE, ActiveAE CHOOSES A 4-CH TRANSPORT WITH ONE-to-ONE MAPPING>.

<SINCE> ...most devices <ABLE TO ACCEPT MCH-PCM OVER HDMI> don't have issues with this <4-CH PCM FORMAT>, we <FEEL IT IS NOT APPROPRIATE TO MAKE AN EXCEPTION FOR PROBLEMATIC DOWNSTREAM HARDWARE, AND> can't just open 5.1 for this case.

I understand and agree with this position regarding "standard behaviour". I understand the choice of 2- or 4- or 6-ch output is made within ActiveAE, and under the control of the developers (not some closed, 3rd party utility).

I'm less confident about "most devices don't have issues with this", when talking about HDMI-equipped receivers & pre-processors. The HDMI v1.1 specification was designed long after the days of Quadraphonic, 4-channel-no-subwoofer music (early 1970's thru early 80's). I don't know if there is a provision for accepting 4-CH-ONLY PCM, but even if it IS in the spec, how many hardware manufacturers would be concerned catering to a "dead" format - and spend the necessary R&D funds to do so ?

I know of at least one high-end manufacturer (Anthem) who prides themselves on being a complete A/V solution - yet they are blind to anything but Stereo OR 5.1/7.1 PCM audio input.

My intuition is, 99% of Quad listeners, who send 4-channel music via PCM to their home theater receivers, whether from disc spinners or HTPC's, will suffer the same outrage. The fault is with the hardware, BUT... xbmc - being software - is in a position to solve this problem for the Quadraphiliac.

A switch could be added to the many existing audio-related parameters in advancedsettings.xml, whereby ActiveAE can be toggled to send 4.0 via a 5.1 mapping. The standard channel mapping would be in effect by default, unless the end user chooses to alter it.

I believe this is technically possible (though I could be mistaken), and the roadblock is the will to do so. Perhaps other QuadPeople will add their voice to this request/suggestion.

In any event, thanks for playing Wink
Grant


RE: Testing audio engine ActiveAE - kyungrak - 2014-03-13

You should try with flac files. Put a 44.1/16bit file and then a 88.2/24bit file for instance.


RE: Testing audio engine ActiveAE - FernetMenta - 2014-03-13

I did but I can't repro here. This is why I ask those questions. Please enable debug logging in advanced settings and post full debug log.


RE: Testing audio engine ActiveAE - FernetMenta - 2014-03-13

@gjwAudio

ActiveAE plays no role in this scenario. It is the ALSA sink and the driver. The driver should not open in 4.0 mode if the device does not support it. This needs to be fixed in the driver. Others will complain if we opened 4.0 as 5.1 because this would disable upmixing in the AVR.


RE: Testing audio engine ActiveAE - kyungrak - 2014-03-13

Here's a log file. I reproduced the bug with a playlist with two files, first 44.1/16bit and second 88.2/24bit

http://xbmclogs.com/show.php?id=148664


RE: Testing audio engine ActiveAE - FernetMenta - 2014-03-13

The log is spammed by jsonrpc and webserver. Please disable those and try again. Would it make a difference if you played the files from a local disk?


RE: Testing audio engine ActiveAE - kyungrak - 2014-03-13

new log:
http://xbmclogs.com/show.php?id=148694

I haven't tried with local disk yet since all my medias are on my server. I'll do a test later.


RE: Testing audio engine ActiveAE - gjwAudio - 2014-03-13

(2014-03-13, 20:52)FernetMenta Wrote: ActiveAE plays no role in this scenario. It is the ALSA sink and the driver.
@FernetMenta

Thank you for the quick clarification. My attention is therefore directed toward the ALSA sink/driver, as the place to effect a change.
Quote:The driver should not open in 4.0 mode if the device does not support it.
Amen to that... and this is one of the things I'm trying to achieve through these many posts.

Q1: What mechanism informs the driver of the AVR's supported formats ?

Quote:This needs to be fixed in the driver.
Q2: Does the xbmc dev team have any input to changing this driver ?

Quote:Others will complain if we opened 4.0 as 5.1 because this would disable upmixing in the AVR.
Two thoughts on this point:

The statement implies that you (ie: xbmc Audio subsystem) have input to cause the driver to use a particular 2- or 4- or 6-ch output structure. If so, then you could implement the aforementioned advancedsettings switch to modify the behaviour logic. But I may still misunderstand the big picture.

Next - and on this there can be no debate - if a user is so lunatic as to seek out and own Quadraphonic, 4-channel-no-subwoofer music, the last thing they want for playback, is to mangle the four channels with upmixing. Can you name me anything other than 70's-Quad that would be issued in 4.0 Surround ?

I contend that the only 4.0-People are the QuadPeople - who will bless you for fixing their playback issue - not complain about opening 4.0 as 5.1.

Q3: How does xbmc direct the ALSA driver in the case where the user specifies a fixed output channel config ?

Q4: How is this control fundamentally different from the advancedsettings switch I am suggesting ?

Thanks again for your consideration.
Grant


RE: Testing audio engine ActiveAE - FernetMenta - 2014-03-13

the log is still unreadable. please disable all addons usng python and jsonrpc. move you .xbmc folder and try to reproduce with a clean environment.


RE: Testing audio engine ActiveAE - FernetMenta - 2014-03-14

Quote:Q1: What mechanism informs the driver of the AVR's supported formats ?

If the AVR is attached through HDMI, it's EDID

Quote:Q2: Does the xbmc dev team have any input to changing this driver ?

Anssi is familiar with ALSA and has done patched. It always depends on time and in this case one have to find out if it can be fixed in the audio driver. The audio driver gets informed by the video driver which queries EDID. First thing to check is if your device sends correct info. Next if EDID is sufficient. E-EDID has more info but I don't think any Linux driver queries E-EDID.

Regarding Q3, Q4.

We are in the process of cleaning up all the mess done with advanced settings in the past. I have eliminated all settings related to audio and move the useful ones to GUI settings.
We have been running this thread for quite a while and collect feedback from other sources as well. This is the only case I got to know reporting this 4.0 channels issue. We can't implement an advances setting as a work around for a single user. If it turns out that a larger group is affected by this driver issue, we can re-think adding some work around.

I the meantime you can build XBMC yourself and change the code to you needs. Not a big to to build XBMC from source. I am happy to assist you with the necessary code change.