audio: Disable support for IRQ affinity by default

Change-Id: I410f0037747149471a1d5fe7cf38720121938822
tirimbino
Andreas Schneider 8 years ago
parent 56204f6d19
commit 3b643835f9
  1. 6
      audio/audio_hw.c
  2. 6
      audio/include/samsung_audio.h

@ -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…
Cancel
Save