• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/libaudio


コミットメタ情報

リビジョン4f5006abcb66e923cabc4644b613db8d2c93a2bb (tree)
日時2016-09-14 00:17:02
作者Chih-Wei Huang <cwhuang@linu...>
コミッターChih-Wei Huang

ログメッセージ

audio_hw: select HDMI audio if notified by the framework

変更サマリ

差分

--- a/audio_hw.c
+++ b/audio_hw.c
@@ -45,6 +45,7 @@
4545 #define PCM_CARD 0
4646 #define PCM_DEVICE 0
4747 #define PCM_DEVICE_SCO 2
48+#define PCM_DEVICE_HDMI 3
4849
4950 #define OUT_PERIOD_SIZE 512
5051 #define OUT_SHORT_PERIOD_COUNT 2
@@ -177,7 +178,7 @@ static void release_buffer(struct resampler_buffer_provider *buffer_provider,
177178
178179 /* Helper functions */
179180
180-struct snd_pcm_info *select_card(unsigned int device __unused, unsigned int flags)
181+struct snd_pcm_info *select_card(unsigned int device, unsigned int flags)
181182 {
182183 static struct snd_pcm_info *cached_info[4];
183184 struct snd_pcm_info *info;
@@ -221,12 +222,12 @@ struct snd_pcm_info *select_card(unsigned int device __unused, unsigned int flag
221222 free(namelist);
222223 }
223224 }
224- if (property_get_bool("hal.audio.primary.hdmi", false) && cached_info[d + 2]) {
225+ if (property_get_bool("hal.audio.primary.hdmi", device == PCM_DEVICE_HDMI) && cached_info[d + 2]) {
225226 info = cached_info[d + 2];
226227 } else {
227228 info = cached_info[d] ? cached_info[d] : cached_info[d + 2];
228229 }
229- ALOGI_IF(info, "choose pcmC%dD%d%c", info->card, info->device, d ? 'c' : 'p');
230+ ALOGI_IF(info, "choose pcmC%dD%d%c for %d", info->card, info->device, d ? 'c' : 'p', device);
230231 return info;
231232 }
232233
@@ -341,7 +342,7 @@ static int start_output_stream(struct stream_out *out)
341342 device = PCM_DEVICE_SCO;
342343 out->pcm_config = &pcm_config_sco;
343344 } else {
344- device = PCM_DEVICE;
345+ device = (adev->out_device & AUDIO_DEVICE_OUT_AUX_DIGITAL) ? PCM_DEVICE_HDMI : PCM_DEVICE;
345346 out->pcm_config = &pcm_config_out;
346347 out->buffer_type = OUT_BUFFER_TYPE_UNKNOWN;
347348 }
--- a/audio_policy.conf
+++ b/audio_policy.conf
@@ -26,7 +26,7 @@ audio_hw_modules {
2626 sampling_rates 48000
2727 channel_masks AUDIO_CHANNEL_OUT_STEREO
2828 formats AUDIO_FORMAT_PCM_16_BIT
29- devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO
29+ devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL
3030 flags AUDIO_OUTPUT_FLAG_PRIMARY
3131 }
3232 }