Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d93e3a8 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes from topic "nullzero-hal-v7"

* changes:
  Remove PREUPLOAD.cfg from audio HAL example
  audio: Implement VTS tests for V7.0
  audio: Add example HAL implementation
  audio: Reformat README as Markdown
  audio: HAL V7 tweaks
parents 389e9aa7 94ab03a3
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -117,7 +117,7 @@ interface IDevice {
            AudioIoHandle ioHandle,
            AudioIoHandle ioHandle,
            DeviceAddress device,
            DeviceAddress device,
            AudioConfig config,
            AudioConfig config,
            bitfield<AudioOutputFlag> flags,
            vec<AudioInOutFlag> flags,
            SourceMetadata sourceMetadata) generates (
            SourceMetadata sourceMetadata) generates (
                    Result retval,
                    Result retval,
                    IStreamOut outStream,
                    IStreamOut outStream,
@@ -142,7 +142,7 @@ interface IDevice {
            AudioIoHandle ioHandle,
            AudioIoHandle ioHandle,
            DeviceAddress device,
            DeviceAddress device,
            AudioConfig config,
            AudioConfig config,
            bitfield<AudioInputFlag> flags,
            vec<AudioInOutFlag> flags,
            SinkMetadata sinkMetadata) generates (
            SinkMetadata sinkMetadata) generates (
                    Result retval,
                    Result retval,
                    IStreamIn inStream,
                    IStreamIn inStream,
+15 −41
Original line number Original line Diff line number Diff line
@@ -44,49 +44,23 @@ interface IStream {
    getBufferSize() generates (uint64_t bufferSize);
    getBufferSize() generates (uint64_t bufferSize);


    /**
    /**
     * Return supported native sampling rates of the stream for a given format.
     * Return supported audio profiles for this particular stream. This method
     * A supported native sample rate is a sample rate that can be efficiently
     * is normally called for streams opened on devices that use dynamic
     * played by the hardware (typically without sample-rate conversions).
     * profiles, e.g. HDMI and USB interfaces. Please note that supported
     * profiles of the stream may differ from the capabilities of the connected
     * physical device.
     *
     *
     * This function is only called for dynamic profile. If called for
     * For devices with fixed configurations, e.g. built-in audio devices, all
     * non-dynamic profile is should return NOT_SUPPORTED or the same list
     * the profiles are specified in the audio_policy_configuration.xml
     * as in audio_policy_configuration.xml.
     * file. For such devices, this method must return the configuration from
     *
     * the config file, or NOT_SUPPORTED retval.
     * Calling this method is equivalent to getting
     * AUDIO_PARAMETER_STREAM_SUP_SAMPLING_RATES on the legacy HAL.
     *
     *
     * @param format audio format for which the sample rates are supported.
     * @return retval operation completion status.
     *                Must be OK if the format is supported.
     * @return sampleRateHz supported sample rates.
     */
    getSupportedSampleRates(AudioFormat format)
            generates (Result retval, vec<uint32_t> sampleRates);

    /**
     * Return supported channel masks of the stream. Calling this method is
     * equivalent to getting AUDIO_PARAMETER_STREAM_SUP_CHANNELS on the legacy
     * HAL.
     *
     * @param format audio format for which the channel masks are supported.
     * @return retval operation completion status.
     *                Must be OK if the format is supported.
     * @return masks supported audio masks.
     */
    getSupportedChannelMasks(AudioFormat format)
            generates (Result retval, vec<vec<AudioChannelMask>> masks);

    /**
     * Return supported audio formats of the stream. Calling this method is
     * equivalent to getting AUDIO_PARAMETER_STREAM_SUP_FORMATS on the legacy
     * HAL.
     *
     *
     * @return retval operation completion status.
     * @return retval operation completion status.
     * @return formats supported audio formats.
     * @return formats supported audio profiles.
     *                 Must be non empty if retval is OK.
     *                 Must be non empty if retval is OK.
     */
     */
    getSupportedFormats() generates (Result retval, vec<AudioFormat> formats);
    getSupportedProfiles()
            generates (Result retval, vec<AudioProfile> profiles);


    /**
    /**
     * Retrieves basic stream configuration: sample rate, audio format,
     * Retrieves basic stream configuration: sample rate, audio format,
@@ -94,18 +68,18 @@ interface IStream {
     *
     *
     * @return config basic stream configuration.
     * @return config basic stream configuration.
     */
     */
    getAudioProperties() generates (AudioBasicConfig config);
    getAudioProperties() generates (AudioConfigBase config);


    /**
    /**
     * Sets stream parameters. Only sets parameters that are specified.
     * Sets stream parameters. Only sets parameters that are specified.
     * See the description of AudioBasicConfig for the details.
     * See the description of AudioConfigBase for the details.
     *
     *
     * Optional method. If implemented, only called on a stopped stream.
     * Optional method. If implemented, only called on a stopped stream.
     *
     *
     * @param config basic stream configuration.
     * @param config basic stream configuration.
     * @return retval operation completion status.
     * @return retval operation completion status.
     */
     */
    setAudioProperties(AudioBasicConfig config) generates (Result retval);
    setAudioProperties(AudioConfigBase config) generates (Result retval);


    /**
    /**
     * Applies audio effect to the stream.
     * Applies audio effect to the stream.
+29 −2
Original line number Original line Diff line number Diff line
@@ -228,6 +228,33 @@ package audio.policy.configuration.V7_0 {
    enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_WMA_PRO;
    enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_WMA_PRO;
  }
  }


  public enum AudioInOutFlag {
    method public String getRawName();
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_DIRECT;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_FAST;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_HW_AV_SYNC;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_HW_HOTWORD;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_MMAP_NOIRQ;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_RAW;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_SYNC;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_VOIP_TX;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_DEEP_BUFFER;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_DIRECT;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_DIRECT_PCM;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_FAST;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_HW_AV_SYNC;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_IEC958_NONAUDIO;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_INCALL_MUSIC;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_MMAP_NOIRQ;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_NON_BLOCKING;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_PRIMARY;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_RAW;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_SYNC;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_TTS;
    enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_VOIP_RX;
  }

  public class AudioPolicyConfiguration {
  public class AudioPolicyConfiguration {
    ctor public AudioPolicyConfiguration();
    ctor public AudioPolicyConfiguration();
    method public audio.policy.configuration.V7_0.GlobalConfiguration getGlobalConfiguration();
    method public audio.policy.configuration.V7_0.GlobalConfiguration getGlobalConfiguration();
@@ -396,7 +423,7 @@ package audio.policy.configuration.V7_0 {


  public static class MixPorts.MixPort {
  public static class MixPorts.MixPort {
    ctor public MixPorts.MixPort();
    ctor public MixPorts.MixPort();
    method public String getFlags();
    method public java.util.List<audio.policy.configuration.V7_0.AudioInOutFlag> getFlags();
    method public audio.policy.configuration.V7_0.Gains getGains();
    method public audio.policy.configuration.V7_0.Gains getGains();
    method public long getMaxActiveCount();
    method public long getMaxActiveCount();
    method public long getMaxOpenCount();
    method public long getMaxOpenCount();
@@ -404,7 +431,7 @@ package audio.policy.configuration.V7_0 {
    method public java.util.List<audio.policy.configuration.V7_0.AudioUsage> getPreferredUsage();
    method public java.util.List<audio.policy.configuration.V7_0.AudioUsage> getPreferredUsage();
    method public java.util.List<audio.policy.configuration.V7_0.Profile> getProfile();
    method public java.util.List<audio.policy.configuration.V7_0.Profile> getProfile();
    method public audio.policy.configuration.V7_0.Role getRole();
    method public audio.policy.configuration.V7_0.Role getRole();
    method public void setFlags(String);
    method public void setFlags(java.util.List<audio.policy.configuration.V7_0.AudioInOutFlag>);
    method public void setGains(audio.policy.configuration.V7_0.Gains);
    method public void setGains(audio.policy.configuration.V7_0.Gains);
    method public void setMaxActiveCount(long);
    method public void setMaxActiveCount(long);
    method public void setMaxOpenCount(long);
    method public void setMaxOpenCount(long);
+28 −3
Original line number Original line Diff line number Diff line
@@ -155,16 +155,41 @@
            <xs:element name="item" type="xs:token" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="item" type="xs:token" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        </xs:sequence>
    </xs:complexType>
    </xs:complexType>
    <xs:simpleType name="audioInOutFlags">
    <xs:simpleType name="audioInOutFlag">
        <xs:annotation>
        <xs:annotation>
            <xs:documentation xml:lang="en">
            <xs:documentation xml:lang="en">
                "|" separated list of audio_output_flags_t or audio_input_flags_t.
              The flags indicate suggested stream attributes supported by the profile.
            </xs:documentation>
            </xs:documentation>
        </xs:annotation>
        </xs:annotation>
        <xs:restriction base="xs:string">
        <xs:restriction base="xs:string">
            <xs:pattern value="|[_A-Z]+(\|[_A-Z]+)*"/>
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_DIRECT" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_PRIMARY" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_FAST" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_DEEP_BUFFER" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_NON_BLOCKING" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_HW_AV_SYNC" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_TTS" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_RAW" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_SYNC" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_IEC958_NONAUDIO" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_DIRECT_PCM" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_MMAP_NOIRQ" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_VOIP_RX" />
            <xs:enumeration value="AUDIO_OUTPUT_FLAG_INCALL_MUSIC" />
            <xs:enumeration value="AUDIO_INPUT_FLAG_FAST" />
            <xs:enumeration value="AUDIO_INPUT_FLAG_HW_HOTWORD" />
            <xs:enumeration value="AUDIO_INPUT_FLAG_RAW" />
            <xs:enumeration value="AUDIO_INPUT_FLAG_SYNC" />
            <xs:enumeration value="AUDIO_INPUT_FLAG_MMAP_NOIRQ" />
            <xs:enumeration value="AUDIO_INPUT_FLAG_VOIP_TX" />
            <xs:enumeration value="AUDIO_INPUT_FLAG_HW_AV_SYNC" />
            <xs:enumeration value="AUDIO_INPUT_FLAG_DIRECT" />
        </xs:restriction>
        </xs:restriction>
    </xs:simpleType>
    </xs:simpleType>
    <xs:simpleType name="audioInOutFlags">
        <xs:list itemType="audioInOutFlag" />
    </xs:simpleType>
    <xs:simpleType name="role">
    <xs:simpleType name="role">
        <xs:restriction base="xs:string">
        <xs:restriction base="xs:string">
            <xs:enumeration value="sink"/>
            <xs:enumeration value="sink"/>
+1 −0
Original line number Original line Diff line number Diff line
@@ -128,6 +128,7 @@ updateFile() {
for F in $SOURCE_FILES; do
for F in $SOURCE_FILES; do
    updateFile ${F} "channelMasks" ","
    updateFile ${F} "channelMasks" ","
    updateFile ${F} "samplingRates" ","
    updateFile ${F} "samplingRates" ","
    updateFile ${F} "flags" "|"
done;
done;


updateIncludes() {
updateIncludes() {
Loading