Skip to content
This repository

Ae final rebase #939

Merged
merged 38 commits into from almost 2 years ago
jmarshallnz
Owner

This is a rebased version of the old #900. There is no difference other than this one is rebased.

This should be the one to review. I shall keep the previous branch (ae_rebase) open for now while @gnif and @DDDamian et. al. work on DSPs and DRC.

Review is needed:

  1. For build system changes (@theuni, @amejia1 ?)
  2. For dvdplayer changes (@elupus ?)
  3. Any platform specific stuff.
  4. General overview of AE (if anyone has time!)

The main feature dropped currently with this is the volume amplification - gnif and DDDamian are working on a DSP system which should allow this back in later. Note that this is no major loss - the one we have is essentially a poor-mans version - it basically just applies gain to the stream which is then lowered (where necessary) by the volume limiter - poor man's DRC basically.

It would be great to get this in the May window.

jmarshallnz jmarshallnz referenced this pull request May 05, 2012
Closed

AudioEngine #900

Geoffrey McRae
Collaborator
gnif commented May 08, 2012

I am happy with where ae_rebase is right now, and even with its known issues I feel it is ready for merge to master, so here is my +1 :)

Andres Mejia
Collaborator
amejia1 commented May 09, 2012

The build system changes LGTM and I see now XBMC doesn't blast my computer's volume to max when playing anything using this branch, so +1 from me.

Damian Huckle
Collaborator

I've been involved almost daily with this project for several months, working mostly at Win32 and filters development, but also general troubleshooting and arranging test builds and gathering bug reports. For Linux/Win I'm probably the second most familiar with the code.

IMO the code is ready for this merge window. It won't be perfect for months (if ever) as there's much planned for addition and we're at the blue-moon bug level for most testers now. It does what it says on the can - quite well.

+1 for this merge window.

Joakim Plate
Collaborator
elupus commented May 09, 2012
jmarshallnz
Owner

Thanks all. Will rebase up and hit the big green button :)

davilla
Collaborator
davilla commented May 09, 2012

fair enough, they don't belong there and it's something that needs to get resolved anyway.

Jonathan Mar... and others added some commits May 09, 2012
fire OnUpdate events when the thumb or fanart is updated in the video…
… info dialog, fixes #13005.
0e6b478
Geoffrey McRae removes unneeded headers 208605c
Geoffrey McRae remove unused audiooutput.passthroughmp* eccc2ac
Geoffrey McRae add SSE method for MathUtils::round_int() 1363a62
Geoffrey McRae cosmetic: AdvancedSettings::m_musicResample -> m_audioResample 79e46f1
Geoffrey McRae cosmetic: audioframe.channels -> audioframe.channel_count e5ed6b0
Geoffrey McRae [AE] settings: Add setting to disable GUI sounds during playback af92212
Geoffrey McRae [AE] build system support for HAS/HAVE_ALSA e407d10
Geoffrey McRae [AE] change pulseaudio to default to no rather than auto 532abe2
Geoffrey McRae [AE] av_crc_init added to libavutil interface 3d6d6cd
Geoffrey McRae [AE] core: add base files and support for ALSA/OSS 369984f
[AE] volume: drop unneeded g_settings.m_iPreMuteVolumeLevel as settin…
…g volume to zero is no longer used to mute
da81ff3
Damian Huckle [AE] core: add win32 sinks 74d6a48
Tobias Arrskog [AE] core: add PulseAudio engine f540c34
[AE] core: add coreaudio engine 14f17e7
Geoffrey McRae [AE] update .gitignore b516c35
Geoffrey McRae [AE] removal of g_audioContext 288be2c
Geoffrey McRae [AE] add new files to build system bf1b6e3
Geoffrey McRae [AE] remove SDL_mixer and HAS_SDL_AUDIO e58e6b1
Geoffrey McRae [AE] visualisations: change AudioData to use floats e529389
[AE] volume: remove dynamic range compression support at the app level 926cf9e
Geoffrey McRae [AE] volume: Use a float in the range [0,1] for volume cdeef46
Geoffrey McRae [AE] settings: add new advanced settings f2a704b
Geoffrey McRae [AE] settings: change 'Output stereo to all speakers' -> 'Enable ster…
…eo upmix'
f35d6d2
Geoffrey McRae [AE] gui: no need to check passthrough when calling g_audioManager.En…
…able()
299273c
Geoffrey McRae [AE] settings: Add new settings for AE and reorganise code 5eda08f
Geoffrey McRae [AE] gui: switch to AE 9311cdb
Geoffrey McRae [AE] dvdplayer: drop vis callbacks 964a150
[AE] players: change SetVolume to take a float 217694d
Geoffrey McRae [AE] dvdplayer: switch to use AE 08b78c8
Geoffrey McRae [AE] paplayer: drop ReadSamples/HasFloatData from codecs 461207b
Geoffrey McRae [AE] paplayer: add GetChannelInfo to codecs 67638dc
Geoffrey McRae [AE] paplayer: dvdplayercodec can support passthrough 83b6497
Geoffrey McRae [AE] paplayer: cosmetic cleanup of MP3Codec a470796
Geoffrey McRae [AE] paplayer: drop m_BitsPerSampleInternal in MP3Codec 48abb61
Geoffrey McRae [AE] paplayer: switch MP3Codec to pass through signed 32bpp data 9ea3255
Geoffrey McRae [AE] paplayer: switch to AE 349ec40
Geoffrey McRae [AE] remove old files from the build system 99efc86
Damian Huckle
Collaborator

Great news.

@jmarshallnz - I would give it one last pr from gnif's branch before you do final rebase - there were three notable fixes that went in during the last 24hr scramble. Gnif will likely be awake again in a few hours. Cheers.

jmarshallnz jmarshallnz merged commit 19df5c9 into from May 09, 2012
jmarshallnz jmarshallnz closed this May 09, 2012
ronie

string 407 didn't make it into the .po file and thus shows up as empty in the skin.

Collaborator

As I see we have this string duplicated with ids 347 and 407 but at least with this commit we only use 407.
I suggest removing 407 and change line477 to use string 347.

Collaborator

Done.

Damian Huckle
Collaborator

thx ronie - just got new of that too - it's the DTS-MA string - woohoo the first patch is coming :)

jmarshallnz
Owner

@alanwww1 Can you please fix this up AND remove strings.xml from git so that it doesn't happen again.

Damian Huckle
Collaborator

@alanwww1 - string 407 should be "- DTS-MA capable receiver"

rene-ww

Syntax error (space missing) in Main.cpp:143:36: error: expected ')' before ';' token

Owner

which main (multiple here in this commit)? You can comment the exact line by clicking at the very left of the line...

rene-ww

I'M getting this error: Main.cpp:143:36: error: expected ')' before ';' token

Owner

fixed - thx

Geoffrey McRae

Please fix this to use CAEConvert::Float_S16NE to take advantage of platform instructions (SSE/NEON)

Collaborator

Not possible, viz's are considered addons and as such they should not be assessing xbmc core functions.

Sascha Montellese
Collaborator

@gnif This rewrite is missing the calls to m_callback.OnPlaybackPaused() and m_callback.OnPlaybackResumed() which both addons and HTTP-API/JSON-RPC clients (e.g. the official android remote) rely on to keep track of the current playback in XBMC. I haven't tested all the other callbacks but what I also noticed is that m_callback.OnPlaybackStarted() is always called/executed twice. OnPlaybackSpeedChanged and OnPlaybackStopped work fine.

Damian Huckle

Good catch spiff - PAPlayer has been exhibiting very high cpu usage

Sascha Montellese

Why do we call SetHardwareVolume() directly here instead of going through SetVolume() which contains some extra logic (sending a JSON-RPC notification that the volume has changed)?

bobo1on1
Collaborator

Why?

Collaborator
Rainer Hochecker

@DDDamian @anssih
could you please confirm if this is wrong or correct? shouldn't this be 16 for AC3?

Collaborator

Not just for AC3, but if this is for bitstreaming, then I think all formats (AAC - DTS-HD) should be 16 bits here?

Collaborator
Collaborator

16 would seem to be more correct, yes. However, I didn't check how exactly is this function used.

Collaborator

"more correct" might be the proper term her :) What about TRUEHD? The standard says up to 24bit. Do we need to parse the header instead of assuming a constant?

Collaborator

Bitstreaming is always 16bit regardless of the actual payload sample width.

Collaborator

Was just going to say that. What can change is samplerate and number of channels. Samplerate need to match (or possibly be the double), but number of channels is only to make room for the larger amount of data.

Rainer Hochecker

can anybody explain why only 512/2 samples per channel are considered here? Eden just ignored the rest. You can't run a fft when ignoring the rest of the samples, right?

DWORD CDVDAudio::AddPackets(const DVDAudioFrame &audioframe)
{
  CSingleLock lock (m_critSection);

  unsigned char* data = audioframe.data;
  DWORD len = audioframe.size;

  DWORD total = len;
  DWORD copied;

  //Feed audio to the visualizer if necessary.
  if(m_pCallback && !m_bPassthrough)
    m_pCallback->OnAudioData(data, len);

SoftAE does something I don't follow:

  /* we have a frame, if we have a viz we need to hand the data to it */
  if (m_audioCallback && !m_packet->vizData.CursorEnd())
  {
    float *vizData = (float*)m_packet->vizData.CursorRead(2 * sizeof(float));
    memcpy(m_vizBuffer + m_vizBufferSamples, vizData, 2 * sizeof(float));
    m_vizBufferSamples += 2;
    if (m_vizBufferSamples == 512)
    {
      m_audioCallback->OnAudioData(m_vizBuffer, 512);
      m_vizBufferSamples = 0;
    }
  }

Does it take one sample for two channels of a continuous stream and delivers when it has reached a size of 512? The API does not expose a max of 512. If you deliver more, it crashes badly.

Owner

Eden ran it in 512 blocks and threw away the rest, yes. While it's inaccurate, the result in the vis will be still close enough. IIRC most of the winamp vis's used to do the same thing.

SoftAE is taking every sample by the looks, as I think that block is run on a per-sample basis?

Collaborator

thanks for explaining.

as I think that block is run on a per-sample basis?

not very resource-friendly :)

Dale Hamel dalehamel referenced this pull request from a commit in RasPlex/plex-home-theatre January 08, 2014
Tobias Hieta Fix saving settings to channels
Fixes #939
bd613bd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 38 unique commits by 5 authors.

May 10, 2012
fire OnUpdate events when the thumb or fanart is updated in the video…
… info dialog, fixes #13005.
0e6b478
Geoffrey McRae removes unneeded headers 208605c
Geoffrey McRae remove unused audiooutput.passthroughmp* eccc2ac
Geoffrey McRae add SSE method for MathUtils::round_int() 1363a62
Geoffrey McRae cosmetic: AdvancedSettings::m_musicResample -> m_audioResample 79e46f1
Geoffrey McRae cosmetic: audioframe.channels -> audioframe.channel_count e5ed6b0
Geoffrey McRae [AE] settings: Add setting to disable GUI sounds during playback af92212
Geoffrey McRae [AE] build system support for HAS/HAVE_ALSA e407d10
Geoffrey McRae [AE] change pulseaudio to default to no rather than auto 532abe2
Geoffrey McRae [AE] av_crc_init added to libavutil interface 3d6d6cd
Geoffrey McRae [AE] core: add base files and support for ALSA/OSS 369984f
[AE] volume: drop unneeded g_settings.m_iPreMuteVolumeLevel as settin…
…g volume to zero is no longer used to mute
da81ff3
Damian Huckle [AE] core: add win32 sinks 74d6a48
Tobias Arrskog [AE] core: add PulseAudio engine f540c34
[AE] core: add coreaudio engine 14f17e7
Geoffrey McRae [AE] update .gitignore b516c35
Geoffrey McRae [AE] removal of g_audioContext 288be2c
Geoffrey McRae [AE] add new files to build system bf1b6e3
Geoffrey McRae [AE] remove SDL_mixer and HAS_SDL_AUDIO e58e6b1
Geoffrey McRae [AE] visualisations: change AudioData to use floats e529389
[AE] volume: remove dynamic range compression support at the app level 926cf9e
Geoffrey McRae [AE] volume: Use a float in the range [0,1] for volume cdeef46
Geoffrey McRae [AE] settings: add new advanced settings f2a704b
Geoffrey McRae [AE] settings: change 'Output stereo to all speakers' -> 'Enable ster…
…eo upmix'
f35d6d2
Geoffrey McRae [AE] gui: no need to check passthrough when calling g_audioManager.En…
…able()
299273c
Geoffrey McRae [AE] settings: Add new settings for AE and reorganise code 5eda08f
Geoffrey McRae [AE] gui: switch to AE 9311cdb
Geoffrey McRae [AE] dvdplayer: drop vis callbacks 964a150
[AE] players: change SetVolume to take a float 217694d
Geoffrey McRae [AE] dvdplayer: switch to use AE 08b78c8
Geoffrey McRae [AE] paplayer: drop ReadSamples/HasFloatData from codecs 461207b
Geoffrey McRae [AE] paplayer: add GetChannelInfo to codecs 67638dc
Geoffrey McRae [AE] paplayer: dvdplayercodec can support passthrough 83b6497
Geoffrey McRae [AE] paplayer: cosmetic cleanup of MP3Codec a470796
Geoffrey McRae [AE] paplayer: drop m_BitsPerSampleInternal in MP3Codec 48abb61
Geoffrey McRae [AE] paplayer: switch MP3Codec to pass through signed 32bpp data 9ea3255
Geoffrey McRae [AE] paplayer: switch to AE 349ec40
Geoffrey McRae [AE] remove old files from the build system 99efc86
Something went wrong with that request. Please try again.