Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Ae final rebase #939

Merged
merged 38 commits into from

16 participants

jmarshallnz Geoffrey McRae Andres Mejia Damian Huckle Joakim Plate davilla Rainer Hochecker Anssi Hannula a11599 bobo1on1 Sascha Montellese Memphiz rene-ww alanwww1 (Attila) ronie Tobias Arrskog
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
Closed

AudioEngine #900

Geoffrey McRae
Collaborator

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

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
jmarshallnz
Owner

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

davilla
Collaborator

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

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

@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.

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
Tobias Hieta tru 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
Commits on May 9, 2012
  1. fire OnUpdate events when the thumb or fanart is updated in the video…

    Jonathan Marshall authored
    … info dialog, fixes #13005.
  2. Geoffrey McRae

    removes unneeded headers

    gnif authored Jonathan Marshall committed
  3. Geoffrey McRae

    remove unused audiooutput.passthroughmp*

    gnif authored Jonathan Marshall committed
  4. Geoffrey McRae

    add SSE method for MathUtils::round_int()

    gnif authored Jonathan Marshall committed
  5. Geoffrey McRae

    cosmetic: AdvancedSettings::m_musicResample -> m_audioResample

    gnif authored Jonathan Marshall committed
  6. Geoffrey McRae

    cosmetic: audioframe.channels -> audioframe.channel_count

    gnif authored Jonathan Marshall committed
  7. Geoffrey McRae

    [AE] settings: Add setting to disable GUI sounds during playback

    gnif authored Jonathan Marshall committed
  8. Geoffrey McRae

    [AE] build system support for HAS/HAVE_ALSA

    gnif authored Jonathan Marshall committed
  9. Geoffrey McRae

    [AE] change pulseaudio to default to no rather than auto

    gnif authored Jonathan Marshall committed
  10. Geoffrey McRae

    [AE] av_crc_init added to libavutil interface

    gnif authored Jonathan Marshall committed
  11. Geoffrey McRae

    [AE] core: add base files and support for ALSA/OSS

    gnif authored Jonathan Marshall committed
  12. [AE] volume: drop unneeded g_settings.m_iPreMuteVolumeLevel as settin…

    Jonathan Marshall authored
    …g volume to zero is no longer used to mute
  13. Damian Huckle

    [AE] core: add win32 sinks

    DDDamian authored Jonathan Marshall committed
  14. Tobias Arrskog

    [AE] core: add PulseAudio engine

    topfs2 authored Jonathan Marshall committed
  15. [AE] core: add coreaudio engine

    huceke authored Jonathan Marshall committed
  16. Geoffrey McRae

    [AE] update .gitignore

    gnif authored Jonathan Marshall committed
  17. Geoffrey McRae

    [AE] removal of g_audioContext

    gnif authored Jonathan Marshall committed
  18. Geoffrey McRae

    [AE] add new files to build system

    gnif authored Jonathan Marshall committed
  19. Geoffrey McRae

    [AE] remove SDL_mixer and HAS_SDL_AUDIO

    gnif authored Jonathan Marshall committed
  20. Geoffrey McRae

    [AE] visualisations: change AudioData to use floats

    gnif authored Jonathan Marshall committed
  21. Geoffrey McRae

    [AE] volume: Use a float in the range [0,1] for volume

    gnif authored Jonathan Marshall committed
  22. Geoffrey McRae

    [AE] settings: add new advanced settings

    gnif authored Jonathan Marshall committed
  23. Geoffrey McRae

    [AE] settings: change 'Output stereo to all speakers' -> 'Enable ster…

    gnif authored Jonathan Marshall committed
    …eo upmix'
  24. Geoffrey McRae

    [AE] gui: no need to check passthrough when calling g_audioManager.En…

    gnif authored Jonathan Marshall committed
    …able()
  25. Geoffrey McRae

    [AE] settings: Add new settings for AE and reorganise code

    gnif authored Jonathan Marshall committed
  26. Geoffrey McRae

    [AE] gui: switch to AE

    gnif authored Jonathan Marshall committed
  27. Geoffrey McRae

    [AE] dvdplayer: drop vis callbacks

    gnif authored Jonathan Marshall committed
  28. [AE] players: change SetVolume to take a float

    Jonathan Marshall authored
  29. Geoffrey McRae

    [AE] dvdplayer: switch to use AE

    gnif authored Jonathan Marshall committed
  30. Geoffrey McRae

    [AE] paplayer: drop ReadSamples/HasFloatData from codecs

    gnif authored Jonathan Marshall committed
  31. Geoffrey McRae

    [AE] paplayer: add GetChannelInfo to codecs

    gnif authored Jonathan Marshall committed
  32. Geoffrey McRae

    [AE] paplayer: dvdplayercodec can support passthrough

    gnif authored Jonathan Marshall committed
  33. Geoffrey McRae

    [AE] paplayer: cosmetic cleanup of MP3Codec

    gnif authored Jonathan Marshall committed
  34. Geoffrey McRae

    [AE] paplayer: drop m_BitsPerSampleInternal in MP3Codec

    gnif authored Jonathan Marshall committed
  35. Geoffrey McRae

    [AE] paplayer: switch MP3Codec to pass through signed 32bpp data

    gnif authored Jonathan Marshall committed
  36. Geoffrey McRae

    [AE] paplayer: switch to AE

    gnif authored Jonathan Marshall committed
  37. Geoffrey McRae

    [AE] remove old files from the build system

    gnif authored Jonathan Marshall committed
Something went wrong with that request. Please try again.