mirror of
https://github.com/team-infusion-developers/android_hardware_samsung.git
synced 2024-11-06 21:55:41 +00:00
audio: Disable support for IRQ affinity by default
Change-Id: I410f0037747149471a1d5fe7cf38720121938822
This commit is contained in:
parent
56204f6d19
commit
3b643835f9
2 changed files with 12 additions and 0 deletions
|
@ -2750,6 +2750,7 @@ static int out_set_volume(struct audio_stream_out *stream, float left,
|
|||
return -ENOSYS;
|
||||
}
|
||||
|
||||
#if SUPPORTS_IRQ_AFFINITY
|
||||
static int fast_set_affinity(pid_t tid) {
|
||||
cpu_set_t cpu_set;
|
||||
int cpu_num;
|
||||
|
@ -2772,6 +2773,7 @@ static int fast_set_affinity(pid_t tid) {
|
|||
CPU_SET(cpu_num, &cpu_set);
|
||||
return sched_setaffinity(tid, sizeof(cpu_set), &cpu_set);
|
||||
}
|
||||
#endif
|
||||
|
||||
static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
|
||||
size_t bytes)
|
||||
|
@ -2795,6 +2797,7 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
|
|||
|
||||
lock_output_stream(out);
|
||||
|
||||
#if SUPPORTS_IRQ_AFFINITY
|
||||
if (out->usecase == USECASE_AUDIO_PLAYBACK && !out->is_fastmixer_affinity_set) {
|
||||
tid = gettid();
|
||||
err = fast_set_affinity(tid);
|
||||
|
@ -2803,6 +2806,7 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
|
|||
}
|
||||
out->is_fastmixer_affinity_set = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (out->standby) {
|
||||
#ifdef PREPROCESSING_ENABLED
|
||||
|
@ -3362,6 +3366,7 @@ static ssize_t in_read(struct audio_stream_in *stream, void *buffer,
|
|||
/* no need to acquire adev->lock_inputs because API contract prevents a close */
|
||||
lock_input_stream(in);
|
||||
|
||||
#if SUPPORTS_IRQ_AFFINITY
|
||||
if (in->usecase == USECASE_AUDIO_CAPTURE && !in->is_fastcapture_affinity_set) {
|
||||
tid = gettid();
|
||||
err = fast_set_affinity(tid);
|
||||
|
@ -3370,6 +3375,7 @@ static ssize_t in_read(struct audio_stream_in *stream, void *buffer,
|
|||
}
|
||||
in->is_fastcapture_affinity_set = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (in->standby) {
|
||||
pthread_mutex_unlock(&in->lock);
|
||||
|
|
|
@ -51,4 +51,10 @@
|
|||
*/
|
||||
#define SWAP_SPEAKER_ON_SCREEN_ROTATION 0
|
||||
|
||||
/*
|
||||
* You can that this to 1 if your kernel supports irq affinity for
|
||||
* fast mode. See /proc/asound/irq_affinity
|
||||
*/
|
||||
#define SUPPORTS_IRQ_AFFINITY 0
|
||||
|
||||
#endif // SAMSUNG_AUDIO_H
|
||||
|
|
Loading…
Reference in a new issue