hdmi audio: cache alsa device
* It's always been intended that changing audio output devices requires a reboot. Get the ALSA device once when the HAL is initialized. Might save a few ms on start_output_stream.
This commit is contained in:
@@ -55,6 +55,8 @@
|
||||
#define CHANNEL_STEREO 2
|
||||
#define MIN_WRITE_SLEEP_US 5000
|
||||
|
||||
char device_name[PROPERTY_VALUE_MAX];
|
||||
|
||||
struct stub_stream_in {
|
||||
struct audio_stream_in stream;
|
||||
};
|
||||
@@ -101,8 +103,6 @@ static int start_output_stream(struct alsa_stream_out *out)
|
||||
if (out->unavailable)
|
||||
return -ENODEV;
|
||||
|
||||
char device_name[PROPERTY_VALUE_MAX];
|
||||
get_alsa_device_name(device_name);
|
||||
ALOGI("start_output_stream: %s", device_name);
|
||||
|
||||
int r;
|
||||
@@ -717,6 +717,9 @@ static int adev_open(const hw_module_t* module, const char* name,
|
||||
|
||||
ALOGV("adev_open: %s", name);
|
||||
|
||||
get_alsa_device_name(device_name);
|
||||
ALOGI("adev_open: %s", device_name);
|
||||
|
||||
if (strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0)
|
||||
return -EINVAL;
|
||||
|
||||
|
Reference in New Issue
Block a user