Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AE] Fix issues related to endianness in passthrough #973

Merged
merged 6 commits into from
Jul 10, 2012

Commits on May 17, 2012

  1. [osx] added: show endianness for kAudioFormat60958AC3

    As per Core Audio data types reference, endianness is defined for
    kAudioFormat60958AC3 format. Show it in log similarly to PCM
    formats.
    anssih committed May 17, 2012
    Configuration menu
    Copy the full SHA
    4d4d662 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a60574b View commit details
    Browse the repository at this point in the history
  3. [AE] added: perform byteswap in raw mode if sink requires it

    The sink may need raw audio data either in S16_LE or S16_BE format.
    
    Currently the code assumes that the sink takes S16_NE. However, this may
    not be the case, and especially on big-endian systems the sink may need
    S16_LE instead (if the audio hardware takes that instead of S16_BE).
    
    Therefore, perform a late byteswap if needed.
    
    It would be preferred to take this into account in the IEC-61937 packer
    already, so that we wouldn't consume CPU power byteswapping padding
    (which there can be a lot of) or byteswap twice. However, the IEC-61937
    packer can't currently get that information from the engine/sink.
    anssih committed May 17, 2012
    Configuration menu
    Copy the full SHA
    9df032a View commit details
    Browse the repository at this point in the history
  4. [AE] fixed: allow ALSA passthrough with non-native data format

    The ALSA sink currently only tries SND_PCM_FORMAT_S16 for passthrough.
    However, the non-native endianness format is not tried. The most common
    case when this is needed is big-endian systems that commonly have an
    ALSA device that still takes in S16_LE.
    
    Fix that by trying both formats for passthrough if SND_PCM_FORMAT_S16
    fails.
    anssih committed May 17, 2012
    Configuration menu
    Copy the full SHA
    cd3fa45 View commit details
    Browse the repository at this point in the history
  5. [AE] removed: incorrect comment in AEConvert

    A comment says that the output is always machine byte endian, but that
    doesn't seem to be the case since there are specific functions for both
    endian formats.
    
    Remove the comment.
    anssih committed May 17, 2012
    Configuration menu
    Copy the full SHA
    1d42f5e View commit details
    Browse the repository at this point in the history
  6. [AE] fixed: passthrough of LE DTS, pre-padded DTS, invalid DTS

    AEPackIEC61937 currently doesn't take into account that LE DTS needs to
    be byteswapped to BE format (in addition to any other byteswaps) before
    being transmitted to the receiver, as only the BE format is standard and
    supported by all receivers. Code comment says that the "DTS spec shows
    it suppors both BE and LE", but in reality there is no provision for LE
    in the DTS specification.
    
    Additionally, AEPackIEC61937 doesn't properly handle DTS streams that
    are pre-padded for S/PDIF transmission. Such streams fit exactly into
    the output S/PDIF stream and no padding or IEC61937 wrapping is needed
    (there is not enough space for those, either).
    
    Also, frame size is not validated properly. Valid DTS frame sizes
    in the range [ BurstPeriod-BurstHeader+1 , BurstPeriod-1 ] cannot be
    packed into IEC 61937 as there is no space for the burst header.
    Currently the code crashes with such inputs.
    
    Fix all three issues by adding code handling them.
    anssih committed May 17, 2012
    Configuration menu
    Copy the full SHA
    941eae2 View commit details
    Browse the repository at this point in the history