Patch by Humdinger:
Changed various labels in audio drivers to sentence case. This is case-audio-drivers.diff from #5169. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35045 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -982,13 +982,13 @@ const ac97_source_info source_info[] = {
|
|||||||
{ "Recording", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO|B_MIX_RECORDMUX, 100, AC97_RECORD_GAIN, 0x8000, 4, 0, 1, 0, 0.0, 22.5, 1.5 },
|
{ "Recording", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO|B_MIX_RECORDMUX, 100, AC97_RECORD_GAIN, 0x8000, 4, 0, 1, 0, 0.0, 22.5, 1.5 },
|
||||||
{ "Master", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 101, AC97_MASTER_VOLUME, 0x8000, 5, 0, 1, 1,-46.5, 0.0, 1.5 },
|
{ "Master", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 101, AC97_MASTER_VOLUME, 0x8000, 5, 0, 1, 1,-46.5, 0.0, 1.5 },
|
||||||
//{ "Bass/Treble", B_MIX_GAIN|B_MIX_STEREO, 102, AC97_MASTER_TONE, 0x0f0f, 4, 0, 1, 1,-12.0, 10.5, 1.5 },
|
//{ "Bass/Treble", B_MIX_GAIN|B_MIX_STEREO, 102, AC97_MASTER_TONE, 0x0f0f, 4, 0, 1, 1,-12.0, 10.5, 1.5 },
|
||||||
//{ "Aux Out", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 103, AC97_AUX_OUT_VOLUME, 0x8000, 5, 0, 1, 1,-46.5, 0.0, 1.5 },
|
//{ "Aux out", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 103, AC97_AUX_OUT_VOLUME, 0x8000, 5, 0, 1, 1,-46.5, 0.0, 1.5 },
|
||||||
{ "PCM Out", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 104, AC97_PCM_OUT_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
{ "PCM out", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 104, AC97_PCM_OUT_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
||||||
{ "CD", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 105, AC97_CD_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
{ "CD", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 105, AC97_CD_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
||||||
{ "Aux In", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 106, AC97_AUX_IN_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
{ "Aux In", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 106, AC97_AUX_IN_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
||||||
{ "TAD", B_MIX_GAIN|B_MIX_MUTE|B_MIX_MONO, 107, AC97_PHONE_VOLUME, 0x8008, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
{ "TAD", B_MIX_GAIN|B_MIX_MUTE|B_MIX_MONO, 107, AC97_PHONE_VOLUME, 0x8008, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
||||||
{ "Mic", B_MIX_GAIN|B_MIX_MUTE|B_MIX_MONO|B_MIX_MICBOOST, 108, AC97_MIC_VOLUME, 0x8008, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
{ "Mic", B_MIX_GAIN|B_MIX_MUTE|B_MIX_MONO|B_MIX_MICBOOST, 108, AC97_MIC_VOLUME, 0x8008, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
||||||
{ "Line In", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 109, AC97_LINE_IN_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
{ "Line in", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 109, AC97_LINE_IN_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
||||||
//{ "Center/Lfe", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 111, AC97_CENTER_LFE_VOLUME, 0x8080, 5, 0, 1, 1,-46.5, 0.0, 1.5 },
|
//{ "Center/Lfe", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 111, AC97_CENTER_LFE_VOLUME, 0x8080, 5, 0, 1, 1,-46.5, 0.0, 1.5 },
|
||||||
{ "Center/Lfe" /* should be "Surround" but no */, B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 110, AC97_SURR_VOLUME, 0x8080, 5, 0, 1, 1,-46.5, 0.0, 1.5 }
|
{ "Center/Lfe" /* should be "Surround" but no */, B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 110, AC97_SURR_VOLUME, 0x8080, 5, 0, 1, 1,-46.5, 0.0, 1.5 }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,24 +7,24 @@
|
|||||||
* Copyright (c) 2002, Marcus Overhagen <[email protected]>
|
* Copyright (c) 2002, Marcus Overhagen <[email protected]>
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
* are permitted provided that the following conditions are met:
|
* are permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* - Redistributions of source code must retain the above copyright notice,
|
* - Redistributions of source code must retain the above copyright notice,
|
||||||
* this list of conditions and the following disclaimer.
|
* this list of conditions and the following disclaimer.
|
||||||
* - Redistributions in binary form must reproduce the above copyright notice,
|
* - Redistributions in binary form must reproduce the above copyright notice,
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
* and/or other materials provided with the distribution.
|
* and/or other materials provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -45,13 +45,13 @@
|
|||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
auich_ac97_get_mix(void *card, const void *cookie, int32 type, float *values) {
|
auich_ac97_get_mix(void *card, const void *cookie, int32 type, float *values) {
|
||||||
auich_dev *dev = (auich_dev*)card;
|
auich_dev *dev = (auich_dev*)card;
|
||||||
ac97_source_info *info = (ac97_source_info *)cookie;
|
ac97_source_info *info = (ac97_source_info *)cookie;
|
||||||
uint16 value, mask;
|
uint16 value, mask;
|
||||||
float gain;
|
float gain;
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case B_MIX_GAIN:
|
case B_MIX_GAIN:
|
||||||
value = auich_codec_read(&dev->config, info->reg);
|
value = auich_codec_read(&dev->config, info->reg);
|
||||||
@@ -63,7 +63,7 @@ auich_ac97_get_mix(void *card, const void *cookie, int32 type, float *values) {
|
|||||||
values[0] = info->max_gain - gain;
|
values[0] = info->max_gain - gain;
|
||||||
else
|
else
|
||||||
values[0] = gain - info->min_gain;
|
values[0] = gain - info->min_gain;
|
||||||
|
|
||||||
mask = ((1 << (info->bits + 1)) - 1);
|
mask = ((1 << (info->bits + 1)) - 1);
|
||||||
gain = (value & mask) * info->granularity;
|
gain = (value & mask) * info->granularity;
|
||||||
if (info->polarity == 1)
|
if (info->polarity == 1)
|
||||||
@@ -104,26 +104,26 @@ auich_ac97_get_mix(void *card, const void *cookie, int32 type, float *values) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
auich_ac97_set_mix(void *card, const void *cookie, int32 type, float *values) {
|
auich_ac97_set_mix(void *card, const void *cookie, int32 type, float *values) {
|
||||||
auich_dev *dev = (auich_dev*)card;
|
auich_dev *dev = (auich_dev*)card;
|
||||||
ac97_source_info *info = (ac97_source_info *)cookie;
|
ac97_source_info *info = (ac97_source_info *)cookie;
|
||||||
uint16 value, mask;
|
uint16 value, mask;
|
||||||
float gain;
|
float gain;
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case B_MIX_GAIN:
|
case B_MIX_GAIN:
|
||||||
value = auich_codec_read(&dev->config, info->reg);
|
value = auich_codec_read(&dev->config, info->reg);
|
||||||
if (info->type & B_MIX_STEREO) {
|
if (info->type & B_MIX_STEREO) {
|
||||||
mask = ((1 << (info->bits + 1)) - 1) << 8;
|
mask = ((1 << (info->bits + 1)) - 1) << 8;
|
||||||
value &= ~mask;
|
value &= ~mask;
|
||||||
|
|
||||||
if (info->polarity == 1)
|
if (info->polarity == 1)
|
||||||
gain = info->max_gain - values[0];
|
gain = info->max_gain - values[0];
|
||||||
else
|
else
|
||||||
gain = values[0] - info->min_gain;
|
gain = values[0] - info->min_gain;
|
||||||
value |= ((uint16)(gain / info->granularity) << 8) & mask;
|
value |= ((uint16)(gain / info->granularity) << 8) & mask;
|
||||||
|
|
||||||
mask = ((1 << (info->bits + 1)) - 1);
|
mask = ((1 << (info->bits + 1)) - 1);
|
||||||
value &= ~mask;
|
value &= ~mask;
|
||||||
if (info->polarity == 1)
|
if (info->polarity == 1)
|
||||||
@@ -178,7 +178,7 @@ auich_ac97_set_mix(void *card, const void *cookie, int32 type, float *values) {
|
|||||||
|
|
||||||
|
|
||||||
static int32
|
static int32
|
||||||
auich_create_group_control(multi_dev *multi, int32 *index, int32 parent,
|
auich_create_group_control(multi_dev *multi, int32 *index, int32 parent,
|
||||||
int32 string, const char* name) {
|
int32 string, const char* name) {
|
||||||
int32 i = *index;
|
int32 i = *index;
|
||||||
(*index)++;
|
(*index)++;
|
||||||
@@ -189,7 +189,7 @@ auich_create_group_control(multi_dev *multi, int32 *index, int32 parent,
|
|||||||
multi->controls[i].mix_control.string = string;
|
multi->controls[i].mix_control.string = string;
|
||||||
if (name)
|
if (name)
|
||||||
strcpy(multi->controls[i].mix_control.name, name);
|
strcpy(multi->controls[i].mix_control.name, name);
|
||||||
|
|
||||||
return multi->controls[i].mix_control.id;
|
return multi->controls[i].mix_control.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,17 +201,17 @@ auich_create_controls_list(multi_dev *multi)
|
|||||||
const ac97_source_info *info;
|
const ac97_source_info *info;
|
||||||
|
|
||||||
/* AC97 Mixer */
|
/* AC97 Mixer */
|
||||||
parent = auich_create_group_control(multi, &index, 0, 0, "AC97 Mixer");
|
parent = auich_create_group_control(multi, &index, 0, 0, "AC97 mixer");
|
||||||
|
|
||||||
count = source_info_size;
|
count = source_info_size;
|
||||||
//Note that we ignore first item in source_info
|
//Note that we ignore first item in source_info
|
||||||
//It's for recording, but do match this with ac97.c's source_info
|
//It's for recording, but do match this with ac97.c's source_info
|
||||||
for (i = 1; i < count ; i++) {
|
for (i = 1; i < count ; i++) {
|
||||||
info = &source_info[i];
|
info = &source_info[i];
|
||||||
PRINT(("name : %s\n", info->name));
|
PRINT(("name : %s\n", info->name));
|
||||||
|
|
||||||
parent2 = auich_create_group_control(multi, &index, parent, 0, info->name);
|
parent2 = auich_create_group_control(multi, &index, parent, 0, info->name);
|
||||||
|
|
||||||
if (info->type & B_MIX_GAIN) {
|
if (info->type & B_MIX_GAIN) {
|
||||||
if (info->type & B_MIX_MUTE) {
|
if (info->type & B_MIX_MUTE) {
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
@@ -225,7 +225,7 @@ auich_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].set = &auich_ac97_set_mix;
|
multi->controls[index].set = &auich_ac97_set_mix;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
||||||
multi->controls[index].mix_control.master = EMU_MULTI_CONTROL_MASTERID;
|
multi->controls[index].mix_control.master = EMU_MULTI_CONTROL_MASTERID;
|
||||||
@@ -240,7 +240,7 @@ auich_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].set = &auich_ac97_set_mix;
|
multi->controls[index].set = &auich_ac97_set_mix;
|
||||||
id = multi->controls[index].mix_control.id;
|
id = multi->controls[index].mix_control.id;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
if (info->type & B_MIX_STEREO) {
|
if (info->type & B_MIX_STEREO) {
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
||||||
@@ -256,7 +256,7 @@ auich_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].set = &auich_ac97_set_mix;
|
multi->controls[index].set = &auich_ac97_set_mix;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->type & B_MIX_MICBOOST) {
|
if (info->type & B_MIX_MICBOOST) {
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_ENABLE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_ENABLE;
|
||||||
@@ -274,12 +274,12 @@ auich_create_controls_list(multi_dev *multi)
|
|||||||
|
|
||||||
/* AC97 Record */
|
/* AC97 Record */
|
||||||
parent = auich_create_group_control(multi, &index, 0, 0, "Recording");
|
parent = auich_create_group_control(multi, &index, 0, 0, "Recording");
|
||||||
|
|
||||||
info = &source_info[0];
|
info = &source_info[0];
|
||||||
PRINT(("name : %s\n", info->name));
|
PRINT(("name : %s\n", info->name));
|
||||||
|
|
||||||
parent2 = auich_create_group_control(multi, &index, parent, 0, info->name);
|
parent2 = auich_create_group_control(multi, &index, parent, 0, info->name);
|
||||||
|
|
||||||
if (info->type & B_MIX_GAIN) {
|
if (info->type & B_MIX_GAIN) {
|
||||||
if (info->type & B_MIX_MUTE) {
|
if (info->type & B_MIX_MUTE) {
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
@@ -293,7 +293,7 @@ auich_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].set = &auich_ac97_set_mix;
|
multi->controls[index].set = &auich_ac97_set_mix;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
||||||
multi->controls[index].mix_control.master = EMU_MULTI_CONTROL_MASTERID;
|
multi->controls[index].mix_control.master = EMU_MULTI_CONTROL_MASTERID;
|
||||||
@@ -308,7 +308,7 @@ auich_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].set = &auich_ac97_set_mix;
|
multi->controls[index].set = &auich_ac97_set_mix;
|
||||||
id = multi->controls[index].mix_control.id;
|
id = multi->controls[index].mix_control.id;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
if (info->type & B_MIX_STEREO) {
|
if (info->type & B_MIX_STEREO) {
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
||||||
@@ -324,19 +324,19 @@ auich_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].set = &auich_ac97_set_mix;
|
multi->controls[index].set = &auich_ac97_set_mix;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->type & B_MIX_RECORDMUX) {
|
if (info->type & B_MIX_RECORDMUX) {
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX;
|
||||||
multi->controls[index].mix_control.parent = parent2;
|
multi->controls[index].mix_control.parent = parent2;
|
||||||
strcpy(multi->controls[index].mix_control.name, "Record Mux");
|
strcpy(multi->controls[index].mix_control.name, "Record mux");
|
||||||
multi->controls[index].cookie = info;
|
multi->controls[index].cookie = info;
|
||||||
multi->controls[index].type = B_MIX_MUX;
|
multi->controls[index].type = B_MIX_MUX;
|
||||||
multi->controls[index].get = &auich_ac97_get_mix;
|
multi->controls[index].get = &auich_ac97_get_mix;
|
||||||
multi->controls[index].set = &auich_ac97_set_mix;
|
multi->controls[index].set = &auich_ac97_set_mix;
|
||||||
parent3 = multi->controls[index].mix_control.id;
|
parent3 = multi->controls[index].mix_control.id;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
@@ -345,22 +345,22 @@ auich_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
strcpy(multi->controls[index].mix_control.name, "CD In");
|
strcpy(multi->controls[index].mix_control.name, "CD in");
|
||||||
index++;
|
index++;
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
strcpy(multi->controls[index].mix_control.name, "Video In");
|
strcpy(multi->controls[index].mix_control.name, "Video in");
|
||||||
index++;
|
index++;
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
strcpy(multi->controls[index].mix_control.name, "Aux In");
|
strcpy(multi->controls[index].mix_control.name, "Aux in");
|
||||||
index++;
|
index++;
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
strcpy(multi->controls[index].mix_control.name, "Line In");
|
strcpy(multi->controls[index].mix_control.name, "Line in");
|
||||||
index++;
|
index++;
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
@@ -378,15 +378,15 @@ auich_create_controls_list(multi_dev *multi)
|
|||||||
strcpy(multi->controls[index].mix_control.name, "TAD");
|
strcpy(multi->controls[index].mix_control.name, "TAD");
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
multi->control_count = index;
|
multi->control_count = index;
|
||||||
PRINT(("multi->control_count %lu\n", multi->control_count));
|
PRINT(("multi->control_count %lu\n", multi->control_count));
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auich_get_mix(auich_dev *card, multi_mix_value_info * mmvi)
|
auich_get_mix(auich_dev *card, multi_mix_value_info * mmvi)
|
||||||
{
|
{
|
||||||
int32 i, id;
|
int32 i, id;
|
||||||
@@ -398,7 +398,7 @@ auich_get_mix(auich_dev *card, multi_mix_value_info * mmvi)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
control = &card->multi.controls[id];
|
control = &card->multi.controls[id];
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||||
if (control->get) {
|
if (control->get) {
|
||||||
float values[2];
|
float values[2];
|
||||||
@@ -407,15 +407,15 @@ auich_get_mix(auich_dev *card, multi_mix_value_info * mmvi)
|
|||||||
mmvi->values[i].u.gain = values[0];
|
mmvi->values[i].u.gain = values[0];
|
||||||
else
|
else
|
||||||
mmvi->values[i].u.gain = values[1];
|
mmvi->values[i].u.gain = values[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(card, control->cookie, control->type, values);
|
control->get(card, control->cookie, control->type, values);
|
||||||
mmvi->values[i].u.enable = (values[0] == 1.0);
|
mmvi->values[i].u.enable = (values[0] == 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(card, control->cookie, control->type, values);
|
control->get(card, control->cookie, control->type, values);
|
||||||
@@ -426,7 +426,7 @@ auich_get_mix(auich_dev *card, multi_mix_value_info * mmvi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auich_set_mix(auich_dev *card, multi_mix_value_info * mmvi)
|
auich_set_mix(auich_dev *card, multi_mix_value_info * mmvi)
|
||||||
{
|
{
|
||||||
int32 i, id;
|
int32 i, id;
|
||||||
@@ -438,7 +438,7 @@ auich_set_mix(auich_dev *card, multi_mix_value_info * mmvi)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
control = &card->multi.controls[id];
|
control = &card->multi.controls[id];
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||||
multi_mixer_control *control2 = NULL;
|
multi_mixer_control *control2 = NULL;
|
||||||
if (i+1<mmvi->item_count) {
|
if (i+1<mmvi->item_count) {
|
||||||
@@ -461,27 +461,27 @@ auich_set_mix(auich_dev *card, multi_mix_value_info * mmvi)
|
|||||||
values[0] = mmvi->values[i].u.gain;
|
values[0] = mmvi->values[i].u.gain;
|
||||||
else
|
else
|
||||||
values[1] = mmvi->values[i].u.gain;
|
values[1] = mmvi->values[i].u.gain;
|
||||||
|
|
||||||
if (control2 && control2->mix_control.master != EMU_MULTI_CONTROL_MASTERID)
|
if (control2 && control2->mix_control.master != EMU_MULTI_CONTROL_MASTERID)
|
||||||
values[1] = mmvi->values[i+1].u.gain;
|
values[1] = mmvi->values[i+1].u.gain;
|
||||||
|
|
||||||
control->set(card, control->cookie, control->type, values);
|
control->set(card, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control2)
|
if (control2)
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
||||||
float values[1];
|
float values[1];
|
||||||
|
|
||||||
values[0] = mmvi->values[i].u.enable ? 1.0 : 0.0;
|
values[0] = mmvi->values[i].u.enable ? 1.0 : 0.0;
|
||||||
control->set(card, control->cookie, control->type, values);
|
control->set(card, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||||
float values[1];
|
float values[1];
|
||||||
|
|
||||||
values[0] = (float)mmvi->values[i].u.mux;
|
values[0] = (float)mmvi->values[i].u.mux;
|
||||||
control->set(card, control->cookie, control->type, values);
|
control->set(card, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
@@ -490,35 +490,35 @@ auich_set_mix(auich_dev *card, multi_mix_value_info * mmvi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auich_list_mix_controls(auich_dev *card, multi_mix_control_info * mmci)
|
auich_list_mix_controls(auich_dev *card, multi_mix_control_info * mmci)
|
||||||
{
|
{
|
||||||
multi_mix_control *mmc;
|
multi_mix_control *mmc;
|
||||||
int32 i;
|
int32 i;
|
||||||
|
|
||||||
mmc = mmci->controls;
|
mmc = mmci->controls;
|
||||||
if (mmci->control_count < 24)
|
if (mmci->control_count < 24)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
if (auich_create_controls_list(&card->multi) < B_OK)
|
if (auich_create_controls_list(&card->multi) < B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
for (i = 0; i < card->multi.control_count; i++) {
|
for (i = 0; i < card->multi.control_count; i++) {
|
||||||
mmc[i] = card->multi.controls[i].mix_control;
|
mmc[i] = card->multi.controls[i].mix_control;
|
||||||
}
|
}
|
||||||
|
|
||||||
mmci->control_count = card->multi.control_count;
|
mmci->control_count = card->multi.control_count;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auich_list_mix_connections(auich_dev *card, multi_mix_connection_info * data)
|
auich_list_mix_connections(auich_dev *card, multi_mix_connection_info * data)
|
||||||
{
|
{
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auich_list_mix_channels(auich_dev *card, multi_mix_channel_info *data)
|
auich_list_mix_channels(auich_dev *card, multi_mix_channel_info *data)
|
||||||
{
|
{
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
@@ -571,21 +571,21 @@ auich_create_channels_list(multi_dev *multi)
|
|||||||
B_CHANNEL_CENTER,
|
B_CHANNEL_CENTER,
|
||||||
B_CHANNEL_SUB
|
B_CHANNEL_SUB
|
||||||
};
|
};
|
||||||
|
|
||||||
chans = multi->chans;
|
chans = multi->chans;
|
||||||
index = 0;
|
index = 0;
|
||||||
|
|
||||||
for (mode=AUICH_USE_PLAY; mode!=-1;
|
for (mode=AUICH_USE_PLAY; mode!=-1;
|
||||||
mode = (mode == AUICH_USE_PLAY) ? AUICH_USE_RECORD : -1) {
|
mode = (mode == AUICH_USE_PLAY) ? AUICH_USE_RECORD : -1) {
|
||||||
LIST_FOREACH(stream, &((auich_dev*)multi->card)->streams, next) {
|
LIST_FOREACH(stream, &((auich_dev*)multi->card)->streams, next) {
|
||||||
if ((stream->use & mode) == 0)
|
if ((stream->use & mode) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (stream->channels == 2)
|
if (stream->channels == 2)
|
||||||
designations = B_CHANNEL_STEREO_BUS;
|
designations = B_CHANNEL_STEREO_BUS;
|
||||||
else
|
else
|
||||||
designations = B_CHANNEL_SURROUND_BUS;
|
designations = B_CHANNEL_SURROUND_BUS;
|
||||||
|
|
||||||
for (i = 0; i < stream->channels; i++) {
|
for (i = 0; i < stream->channels; i++) {
|
||||||
chans[index].channel_id = index;
|
chans[index].channel_id = index;
|
||||||
chans[index].kind = (mode == AUICH_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
chans[index].kind = (mode == AUICH_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
||||||
@@ -594,49 +594,49 @@ auich_create_channels_list(multi_dev *multi)
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode==AUICH_USE_PLAY) {
|
if (mode==AUICH_USE_PLAY) {
|
||||||
multi->output_channel_count = index;
|
multi->output_channel_count = index;
|
||||||
} else {
|
} else {
|
||||||
multi->input_channel_count = index - multi->output_channel_count;
|
multi->input_channel_count = index - multi->output_channel_count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
chans[index].channel_id = index;
|
chans[index].channel_id = index;
|
||||||
chans[index].kind = B_MULTI_OUTPUT_BUS;
|
chans[index].kind = B_MULTI_OUTPUT_BUS;
|
||||||
chans[index].designations = B_CHANNEL_LEFT | B_CHANNEL_STEREO_BUS;
|
chans[index].designations = B_CHANNEL_LEFT | B_CHANNEL_STEREO_BUS;
|
||||||
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
chans[index].channel_id = index;
|
chans[index].channel_id = index;
|
||||||
chans[index].kind = B_MULTI_OUTPUT_BUS;
|
chans[index].kind = B_MULTI_OUTPUT_BUS;
|
||||||
chans[index].designations = B_CHANNEL_RIGHT | B_CHANNEL_STEREO_BUS;
|
chans[index].designations = B_CHANNEL_RIGHT | B_CHANNEL_STEREO_BUS;
|
||||||
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
multi->output_bus_channel_count = index - multi->output_channel_count
|
multi->output_bus_channel_count = index - multi->output_channel_count
|
||||||
- multi->input_channel_count;
|
- multi->input_channel_count;
|
||||||
|
|
||||||
chans[index].channel_id = index;
|
chans[index].channel_id = index;
|
||||||
chans[index].kind = B_MULTI_INPUT_BUS;
|
chans[index].kind = B_MULTI_INPUT_BUS;
|
||||||
chans[index].designations = B_CHANNEL_LEFT | B_CHANNEL_STEREO_BUS;
|
chans[index].designations = B_CHANNEL_LEFT | B_CHANNEL_STEREO_BUS;
|
||||||
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
chans[index].channel_id = index;
|
chans[index].channel_id = index;
|
||||||
chans[index].kind = B_MULTI_INPUT_BUS;
|
chans[index].kind = B_MULTI_INPUT_BUS;
|
||||||
chans[index].designations = B_CHANNEL_RIGHT | B_CHANNEL_STEREO_BUS;
|
chans[index].designations = B_CHANNEL_RIGHT | B_CHANNEL_STEREO_BUS;
|
||||||
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
multi->input_bus_channel_count = index - multi->output_channel_count
|
multi->input_bus_channel_count = index - multi->output_channel_count
|
||||||
- multi->input_channel_count - multi->output_bus_channel_count;
|
- multi->input_channel_count - multi->output_bus_channel_count;
|
||||||
|
|
||||||
multi->aux_bus_channel_count = 0;
|
multi->aux_bus_channel_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auich_get_description(auich_dev *card, multi_description *data)
|
auich_get_description(auich_dev *card, multi_description *data)
|
||||||
{
|
{
|
||||||
uint32 size;
|
uint32 size;
|
||||||
@@ -658,7 +658,7 @@ auich_get_description(auich_dev *card, multi_description *data)
|
|||||||
strncpy(data->friendly_name, FRIENDLY_NAME_AMD, 32);
|
strncpy(data->friendly_name, FRIENDLY_NAME_AMD, 32);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(data->vendor_info, AUTHOR);
|
strcpy(data->vendor_info, AUTHOR);
|
||||||
|
|
||||||
/*data->output_channel_count = 6;
|
/*data->output_channel_count = 6;
|
||||||
@@ -666,21 +666,21 @@ auich_get_description(auich_dev *card, multi_description *data)
|
|||||||
data->output_bus_channel_count = 2;
|
data->output_bus_channel_count = 2;
|
||||||
data->input_bus_channel_count = 2;
|
data->input_bus_channel_count = 2;
|
||||||
data->aux_bus_channel_count = 0;*/
|
data->aux_bus_channel_count = 0;*/
|
||||||
|
|
||||||
data->output_channel_count = card->multi.output_channel_count;
|
data->output_channel_count = card->multi.output_channel_count;
|
||||||
data->input_channel_count = card->multi.input_channel_count;
|
data->input_channel_count = card->multi.input_channel_count;
|
||||||
data->output_bus_channel_count = card->multi.output_bus_channel_count;
|
data->output_bus_channel_count = card->multi.output_bus_channel_count;
|
||||||
data->input_bus_channel_count = card->multi.input_bus_channel_count;
|
data->input_bus_channel_count = card->multi.input_bus_channel_count;
|
||||||
data->aux_bus_channel_count = card->multi.aux_bus_channel_count;
|
data->aux_bus_channel_count = card->multi.aux_bus_channel_count;
|
||||||
|
|
||||||
size = card->multi.output_channel_count + card->multi.input_channel_count
|
size = card->multi.output_channel_count + card->multi.input_channel_count
|
||||||
+ card->multi.output_bus_channel_count + card->multi.input_bus_channel_count
|
+ card->multi.output_bus_channel_count + card->multi.input_bus_channel_count
|
||||||
+ card->multi.aux_bus_channel_count;
|
+ card->multi.aux_bus_channel_count;
|
||||||
|
|
||||||
// for each channel, starting with the first output channel,
|
// for each channel, starting with the first output channel,
|
||||||
// then the second, third..., followed by the first input
|
// then the second, third..., followed by the first input
|
||||||
// channel, second, third, ..., followed by output bus
|
// channel, second, third, ..., followed by output bus
|
||||||
// channels and input bus channels and finally auxillary channels,
|
// channels and input bus channels and finally auxillary channels,
|
||||||
|
|
||||||
LOG(("request_channel_count = %d\n",data->request_channel_count));
|
LOG(("request_channel_count = %d\n",data->request_channel_count));
|
||||||
if (data->request_channel_count >= size) {
|
if (data->request_channel_count >= size) {
|
||||||
@@ -708,7 +708,7 @@ auich_get_description(auich_dev *card, multi_description *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auich_get_enabled_channels(auich_dev *card, multi_channel_enable *data)
|
auich_get_enabled_channels(auich_dev *card, multi_channel_enable *data)
|
||||||
{
|
{
|
||||||
B_SET_CHANNEL(data->enable_bits, 0, true);
|
B_SET_CHANNEL(data->enable_bits, 0, true);
|
||||||
@@ -726,7 +726,7 @@ auich_get_enabled_channels(auich_dev *card, multi_channel_enable *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auich_set_enabled_channels(auich_dev *card, multi_channel_enable *data)
|
auich_set_enabled_channels(auich_dev *card, multi_channel_enable *data)
|
||||||
{
|
{
|
||||||
PRINT(("set_enabled_channels 0 : %s\n", B_TEST_CHANNEL(data->enable_bits, 0) ? "enabled": "disabled"));
|
PRINT(("set_enabled_channels 0 : %s\n", B_TEST_CHANNEL(data->enable_bits, 0) ? "enabled": "disabled"));
|
||||||
@@ -737,14 +737,14 @@ auich_set_enabled_channels(auich_dev *card, multi_channel_enable *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auich_get_global_format(auich_dev *card, multi_format_info *data)
|
auich_get_global_format(auich_dev *card, multi_format_info *data)
|
||||||
{
|
{
|
||||||
data->output_latency = 0;
|
data->output_latency = 0;
|
||||||
data->input_latency = 0;
|
data->input_latency = 0;
|
||||||
data->timecode_kind = 0;
|
data->timecode_kind = 0;
|
||||||
switch (current_settings.sample_rate) {
|
switch (current_settings.sample_rate) {
|
||||||
case 48000:
|
case 48000:
|
||||||
data->input.rate = data->output.rate = B_SR_48000;
|
data->input.rate = data->output.rate = B_SR_48000;
|
||||||
data->input.cvsr = data->output.cvsr = 48000;
|
data->input.cvsr = data->output.cvsr = 48000;
|
||||||
break;
|
break;
|
||||||
@@ -758,11 +758,11 @@ auich_get_global_format(auich_dev *card, multi_format_info *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auich_get_buffers(auich_dev *card, multi_buffer_list *data)
|
auich_get_buffers(auich_dev *card, multi_buffer_list *data)
|
||||||
{
|
{
|
||||||
uint8 i, j, pchannels, rchannels, bufcount;
|
uint8 i, j, pchannels, rchannels, bufcount;
|
||||||
|
|
||||||
LOG(("flags = %#x\n",data->flags));
|
LOG(("flags = %#x\n",data->flags));
|
||||||
LOG(("request_playback_buffers = %#x\n",data->request_playback_buffers));
|
LOG(("request_playback_buffers = %#x\n",data->request_playback_buffers));
|
||||||
LOG(("request_playback_channels = %#x\n",data->request_playback_channels));
|
LOG(("request_playback_channels = %#x\n",data->request_playback_channels));
|
||||||
@@ -770,10 +770,10 @@ auich_get_buffers(auich_dev *card, multi_buffer_list *data)
|
|||||||
LOG(("request_record_buffers = %#x\n",data->request_record_buffers));
|
LOG(("request_record_buffers = %#x\n",data->request_record_buffers));
|
||||||
LOG(("request_record_channels = %#x\n",data->request_record_channels));
|
LOG(("request_record_channels = %#x\n",data->request_record_channels));
|
||||||
LOG(("request_record_buffer_size = %#x\n",data->request_record_buffer_size));
|
LOG(("request_record_buffer_size = %#x\n",data->request_record_buffer_size));
|
||||||
|
|
||||||
pchannels = card->pstream->channels;
|
pchannels = card->pstream->channels;
|
||||||
rchannels = card->rstream->channels;
|
rchannels = card->rstream->channels;
|
||||||
|
|
||||||
if (data->request_playback_buffers < current_settings.buffer_count ||
|
if (data->request_playback_buffers < current_settings.buffer_count ||
|
||||||
data->request_playback_channels < (pchannels) ||
|
data->request_playback_channels < (pchannels) ||
|
||||||
data->request_record_buffers < current_settings.buffer_count ||
|
data->request_record_buffers < current_settings.buffer_count ||
|
||||||
@@ -782,10 +782,10 @@ auich_get_buffers(auich_dev *card, multi_buffer_list *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(current_settings.buffer_count == 2);
|
ASSERT(current_settings.buffer_count == 2);
|
||||||
|
|
||||||
data->flags = B_MULTI_BUFFER_PLAYBACK | B_MULTI_BUFFER_RECORD; // XXX ???
|
data->flags = B_MULTI_BUFFER_PLAYBACK | B_MULTI_BUFFER_RECORD; // XXX ???
|
||||||
// data->flags = 0;
|
// data->flags = 0;
|
||||||
|
|
||||||
data->return_playback_buffers = current_settings.buffer_count; /* playback_buffers[b][] */
|
data->return_playback_buffers = current_settings.buffer_count; /* playback_buffers[b][] */
|
||||||
data->return_playback_channels = pchannels; /* playback_buffers[][c] */
|
data->return_playback_channels = pchannels; /* playback_buffers[][c] */
|
||||||
data->return_playback_buffer_size = current_settings.buffer_frames; /* frames */
|
data->return_playback_buffer_size = current_settings.buffer_frames; /* frames */
|
||||||
@@ -796,24 +796,24 @@ auich_get_buffers(auich_dev *card, multi_buffer_list *data)
|
|||||||
|
|
||||||
for (i = 0; i < bufcount; i++)
|
for (i = 0; i < bufcount; i++)
|
||||||
for (j=0; j<pchannels; j++)
|
for (j=0; j<pchannels; j++)
|
||||||
auich_stream_get_nth_buffer(card->pstream, j, i,
|
auich_stream_get_nth_buffer(card->pstream, j, i,
|
||||||
&data->playback_buffers[i][j].base,
|
&data->playback_buffers[i][j].base,
|
||||||
&data->playback_buffers[i][j].stride);
|
&data->playback_buffers[i][j].stride);
|
||||||
|
|
||||||
data->return_record_buffers = current_settings.buffer_count;
|
data->return_record_buffers = current_settings.buffer_count;
|
||||||
data->return_record_channels = rchannels;
|
data->return_record_channels = rchannels;
|
||||||
data->return_record_buffer_size = current_settings.buffer_frames; /* frames */
|
data->return_record_buffer_size = current_settings.buffer_frames; /* frames */
|
||||||
|
|
||||||
bufcount = current_settings.buffer_count;
|
bufcount = current_settings.buffer_count;
|
||||||
if (bufcount > data->request_record_buffers)
|
if (bufcount > data->request_record_buffers)
|
||||||
bufcount = data->request_record_buffers;
|
bufcount = data->request_record_buffers;
|
||||||
|
|
||||||
for (i = 0; i < bufcount; i++)
|
for (i = 0; i < bufcount; i++)
|
||||||
for (j=0; j<rchannels; j++)
|
for (j=0; j<rchannels; j++)
|
||||||
auich_stream_get_nth_buffer(card->rstream, j, i,
|
auich_stream_get_nth_buffer(card->rstream, j, i,
|
||||||
&data->record_buffers[i][j].base,
|
&data->record_buffers[i][j].base,
|
||||||
&data->record_buffers[i][j].stride);
|
&data->record_buffers[i][j].stride);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -823,17 +823,17 @@ auich_play_inth(void* inthparams)
|
|||||||
{
|
{
|
||||||
auich_stream *stream = (auich_stream *)inthparams;
|
auich_stream *stream = (auich_stream *)inthparams;
|
||||||
//int32 count;
|
//int32 count;
|
||||||
|
|
||||||
acquire_spinlock(&slock);
|
acquire_spinlock(&slock);
|
||||||
stream->real_time = system_time();
|
stream->real_time = system_time();
|
||||||
stream->frames_count += current_settings.buffer_frames;
|
stream->frames_count += current_settings.buffer_frames;
|
||||||
stream->buffer_cycle = (stream->trigblk
|
stream->buffer_cycle = (stream->trigblk
|
||||||
+ stream->blkmod - 1) % stream->blkmod;
|
+ stream->blkmod - 1) % stream->blkmod;
|
||||||
stream->update_needed = true;
|
stream->update_needed = true;
|
||||||
release_spinlock(&slock);
|
release_spinlock(&slock);
|
||||||
|
|
||||||
TRACE(("auich_play_inth : cycle : %d\n", stream->buffer_cycle));
|
TRACE(("auich_play_inth : cycle : %d\n", stream->buffer_cycle));
|
||||||
|
|
||||||
//get_sem_count(stream->card->buffer_ready_sem, &count);
|
//get_sem_count(stream->card->buffer_ready_sem, &count);
|
||||||
//if (count <= 0)
|
//if (count <= 0)
|
||||||
release_sem_etc(stream->card->buffer_ready_sem, 1, B_DO_NOT_RESCHEDULE);
|
release_sem_etc(stream->card->buffer_ready_sem, 1, B_DO_NOT_RESCHEDULE);
|
||||||
@@ -845,30 +845,30 @@ auich_record_inth(void* inthparams)
|
|||||||
{
|
{
|
||||||
auich_stream *stream = (auich_stream *)inthparams;
|
auich_stream *stream = (auich_stream *)inthparams;
|
||||||
//int32 count;
|
//int32 count;
|
||||||
|
|
||||||
acquire_spinlock(&slock);
|
acquire_spinlock(&slock);
|
||||||
stream->real_time = system_time();
|
stream->real_time = system_time();
|
||||||
stream->frames_count += current_settings.buffer_frames;
|
stream->frames_count += current_settings.buffer_frames;
|
||||||
stream->buffer_cycle = (stream->trigblk
|
stream->buffer_cycle = (stream->trigblk
|
||||||
+ stream->blkmod - 1) % stream->blkmod;
|
+ stream->blkmod - 1) % stream->blkmod;
|
||||||
stream->update_needed = true;
|
stream->update_needed = true;
|
||||||
release_spinlock(&slock);
|
release_spinlock(&slock);
|
||||||
|
|
||||||
TRACE(("auich_record_inth : cycle : %d\n", stream->buffer_cycle));
|
TRACE(("auich_record_inth : cycle : %d\n", stream->buffer_cycle));
|
||||||
|
|
||||||
//get_sem_count(stream->card->buffer_ready_sem, &count);
|
//get_sem_count(stream->card->buffer_ready_sem, &count);
|
||||||
//if (count <= 0)
|
//if (count <= 0)
|
||||||
release_sem_etc(stream->card->buffer_ready_sem, 1, B_DO_NOT_RESCHEDULE);
|
release_sem_etc(stream->card->buffer_ready_sem, 1, B_DO_NOT_RESCHEDULE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auich_buffer_exchange(auich_dev *card, multi_buffer_info *data)
|
auich_buffer_exchange(auich_dev *card, multi_buffer_info *data)
|
||||||
{
|
{
|
||||||
cpu_status status;
|
cpu_status status;
|
||||||
auich_stream *pstream, *rstream;
|
auich_stream *pstream, *rstream;
|
||||||
multi_buffer_info buffer_info;
|
multi_buffer_info buffer_info;
|
||||||
|
|
||||||
#ifdef __HAIKU__
|
#ifdef __HAIKU__
|
||||||
if (user_memcpy(&buffer_info, data, sizeof(buffer_info)) < B_OK)
|
if (user_memcpy(&buffer_info, data, sizeof(buffer_info)) < B_OK)
|
||||||
return B_BAD_ADDRESS;
|
return B_BAD_ADDRESS;
|
||||||
@@ -877,48 +877,48 @@ auich_buffer_exchange(auich_dev *card, multi_buffer_info *data)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
buffer_info.flags = B_MULTI_BUFFER_PLAYBACK | B_MULTI_BUFFER_RECORD;
|
buffer_info.flags = B_MULTI_BUFFER_PLAYBACK | B_MULTI_BUFFER_RECORD;
|
||||||
|
|
||||||
if (!(card->pstream->state & AUICH_STATE_STARTED))
|
if (!(card->pstream->state & AUICH_STATE_STARTED))
|
||||||
auich_stream_start(card->pstream, auich_play_inth, card->pstream);
|
auich_stream_start(card->pstream, auich_play_inth, card->pstream);
|
||||||
|
|
||||||
if (!(card->rstream->state & AUICH_STATE_STARTED))
|
if (!(card->rstream->state & AUICH_STATE_STARTED))
|
||||||
auich_stream_start(card->rstream, auich_record_inth, card->rstream);
|
auich_stream_start(card->rstream, auich_record_inth, card->rstream);
|
||||||
|
|
||||||
if (acquire_sem_etc(card->buffer_ready_sem, 1, B_RELATIVE_TIMEOUT | B_CAN_INTERRUPT, 50000)
|
if (acquire_sem_etc(card->buffer_ready_sem, 1, B_RELATIVE_TIMEOUT | B_CAN_INTERRUPT, 50000)
|
||||||
== B_TIMED_OUT) {
|
== B_TIMED_OUT) {
|
||||||
LOG(("buffer_exchange timeout ff\n"));
|
LOG(("buffer_exchange timeout ff\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
status = lock();
|
status = lock();
|
||||||
|
|
||||||
LIST_FOREACH(pstream, &card->streams, next) {
|
LIST_FOREACH(pstream, &card->streams, next) {
|
||||||
if ((pstream->use & AUICH_USE_PLAY) == 0 ||
|
if ((pstream->use & AUICH_USE_PLAY) == 0 ||
|
||||||
(pstream->state & AUICH_STATE_STARTED) == 0)
|
(pstream->state & AUICH_STATE_STARTED) == 0)
|
||||||
continue;
|
continue;
|
||||||
if (pstream->update_needed)
|
if (pstream->update_needed)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
LIST_FOREACH(rstream, &card->streams, next) {
|
LIST_FOREACH(rstream, &card->streams, next) {
|
||||||
if ((rstream->use & AUICH_USE_RECORD) == 0 ||
|
if ((rstream->use & AUICH_USE_RECORD) == 0 ||
|
||||||
(rstream->state & AUICH_STATE_STARTED) == 0)
|
(rstream->state & AUICH_STATE_STARTED) == 0)
|
||||||
continue;
|
continue;
|
||||||
if (rstream->update_needed)
|
if (rstream->update_needed)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pstream)
|
if (!pstream)
|
||||||
pstream = card->pstream;
|
pstream = card->pstream;
|
||||||
if (!rstream)
|
if (!rstream)
|
||||||
rstream = card->rstream;
|
rstream = card->rstream;
|
||||||
|
|
||||||
/* do playback */
|
/* do playback */
|
||||||
buffer_info.playback_buffer_cycle = pstream->buffer_cycle;
|
buffer_info.playback_buffer_cycle = pstream->buffer_cycle;
|
||||||
buffer_info.played_real_time = pstream->real_time;
|
buffer_info.played_real_time = pstream->real_time;
|
||||||
buffer_info.played_frames_count = pstream->frames_count;
|
buffer_info.played_frames_count = pstream->frames_count;
|
||||||
buffer_info._reserved_0 = pstream->first_channel;
|
buffer_info._reserved_0 = pstream->first_channel;
|
||||||
pstream->update_needed = false;
|
pstream->update_needed = false;
|
||||||
|
|
||||||
/* do record */
|
/* do record */
|
||||||
buffer_info.record_buffer_cycle = rstream->buffer_cycle;
|
buffer_info.record_buffer_cycle = rstream->buffer_cycle;
|
||||||
buffer_info.recorded_frames_count = rstream->frames_count;
|
buffer_info.recorded_frames_count = rstream->frames_count;
|
||||||
@@ -933,13 +933,13 @@ auich_buffer_exchange(auich_dev *card, multi_buffer_info *data)
|
|||||||
#else
|
#else
|
||||||
memcpy(data, &buffer_info, sizeof(buffer_info));
|
memcpy(data, &buffer_info, sizeof(buffer_info));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//TRACE(("buffer_exchange ended\n"));
|
//TRACE(("buffer_exchange ended\n"));
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auich_buffer_force_stop(auich_dev *card)
|
auich_buffer_force_stop(auich_dev *card)
|
||||||
{
|
{
|
||||||
//auich_voice_halt(card->pvoice);
|
//auich_voice_halt(card->pvoice);
|
||||||
@@ -947,13 +947,13 @@ auich_buffer_force_stop(auich_dev *card)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auich_multi_control(void *cookie, uint32 op, void *data, size_t length)
|
auich_multi_control(void *cookie, uint32 op, void *data, size_t length)
|
||||||
{
|
{
|
||||||
auich_dev *card = (auich_dev *)cookie;
|
auich_dev *card = (auich_dev *)cookie;
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case B_MULTI_GET_DESCRIPTION:
|
case B_MULTI_GET_DESCRIPTION:
|
||||||
LOG(("B_MULTI_GET_DESCRIPTION\n"));
|
LOG(("B_MULTI_GET_DESCRIPTION\n"));
|
||||||
return auich_get_description(card, (multi_description *)data);
|
return auich_get_description(card, (multi_description *)data);
|
||||||
case B_MULTI_GET_EVENT_INFO:
|
case B_MULTI_GET_EVENT_INFO:
|
||||||
@@ -976,7 +976,7 @@ auich_multi_control(void *cookie, uint32 op, void *data, size_t length)
|
|||||||
return auich_get_global_format(card, (multi_format_info *)data);
|
return auich_get_global_format(card, (multi_format_info *)data);
|
||||||
case B_MULTI_SET_GLOBAL_FORMAT:
|
case B_MULTI_SET_GLOBAL_FORMAT:
|
||||||
LOG(("B_MULTI_SET_GLOBAL_FORMAT\n"));
|
LOG(("B_MULTI_SET_GLOBAL_FORMAT\n"));
|
||||||
return B_OK; /* XXX BUG! we *MUST* return B_OK, returning B_ERROR will prevent
|
return B_OK; /* XXX BUG! we *MUST* return B_OK, returning B_ERROR will prevent
|
||||||
* BeOS to accept the format returned in B_MULTI_GET_GLOBAL_FORMAT
|
* BeOS to accept the format returned in B_MULTI_GET_GLOBAL_FORMAT
|
||||||
*/
|
*/
|
||||||
case B_MULTI_GET_CHANNEL_FORMATS:
|
case B_MULTI_GET_CHANNEL_FORMATS:
|
||||||
@@ -1047,33 +1047,33 @@ auich_open(const char *name, uint32 flags, void** cookie)
|
|||||||
auich_dev *card = NULL;
|
auich_dev *card = NULL;
|
||||||
void *settings_handle;
|
void *settings_handle;
|
||||||
int ix;
|
int ix;
|
||||||
|
|
||||||
LOG(("open()\n"));
|
LOG(("open()\n"));
|
||||||
|
|
||||||
for (ix=0; ix<num_cards; ix++) {
|
for (ix=0; ix<num_cards; ix++) {
|
||||||
if (!strcmp(cards[ix].name, name)) {
|
if (!strcmp(cards[ix].name, name)) {
|
||||||
card = &cards[ix];
|
card = &cards[ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (card == NULL) {
|
if (card == NULL) {
|
||||||
LOG(("open() card not found %s\n", name));
|
LOG(("open() card not found %s\n", name));
|
||||||
for (ix=0; ix<num_cards; ix++) {
|
for (ix=0; ix<num_cards; ix++) {
|
||||||
LOG(("open() card available %s\n", cards[ix].name));
|
LOG(("open() card available %s\n", cards[ix].name));
|
||||||
}
|
}
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(("open() got card\n"));
|
LOG(("open() got card\n"));
|
||||||
|
|
||||||
if (card->pstream !=NULL)
|
if (card->pstream !=NULL)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
if (card->rstream !=NULL)
|
if (card->rstream !=NULL)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
*cookie = card;
|
*cookie = card;
|
||||||
card->multi.card = card;
|
card->multi.card = card;
|
||||||
|
|
||||||
// get driver settings
|
// get driver settings
|
||||||
settings_handle = load_driver_settings(AUICH_SETTINGS);
|
settings_handle = load_driver_settings(AUICH_SETTINGS);
|
||||||
if (settings_handle != NULL) {
|
if (settings_handle != NULL) {
|
||||||
@@ -1083,42 +1083,42 @@ auich_open(const char *name, uint32 flags, void** cookie)
|
|||||||
|
|
||||||
item = get_driver_parameter (settings_handle, "sample_rate", "48000", "48000");
|
item = get_driver_parameter (settings_handle, "sample_rate", "48000", "48000");
|
||||||
value = strtoul (item, &end, 0);
|
value = strtoul (item, &end, 0);
|
||||||
if (*end == '\0')
|
if (*end == '\0')
|
||||||
current_settings.sample_rate = value;
|
current_settings.sample_rate = value;
|
||||||
|
|
||||||
item = get_driver_parameter (settings_handle, "buffer_frames", "256", "256");
|
item = get_driver_parameter (settings_handle, "buffer_frames", "256", "256");
|
||||||
value = strtoul (item, &end, 0);
|
value = strtoul (item, &end, 0);
|
||||||
if (*end == '\0')
|
if (*end == '\0')
|
||||||
current_settings.buffer_frames = value;
|
current_settings.buffer_frames = value;
|
||||||
|
|
||||||
item = get_driver_parameter (settings_handle, "buffer_count", "4", "4");
|
item = get_driver_parameter (settings_handle, "buffer_count", "4", "4");
|
||||||
value = strtoul (item, &end, 0);
|
value = strtoul (item, &end, 0);
|
||||||
if (*end == '\0')
|
if (*end == '\0')
|
||||||
current_settings.buffer_count = value;
|
current_settings.buffer_count = value;
|
||||||
|
|
||||||
unload_driver_settings(settings_handle);
|
unload_driver_settings(settings_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(("stream_new\n"));
|
LOG(("stream_new\n"));
|
||||||
|
|
||||||
card->rstream = auich_stream_new(card, AUICH_USE_RECORD, current_settings.buffer_frames, current_settings.buffer_count);
|
card->rstream = auich_stream_new(card, AUICH_USE_RECORD, current_settings.buffer_frames, current_settings.buffer_count);
|
||||||
card->pstream = auich_stream_new(card, AUICH_USE_PLAY, current_settings.buffer_frames, current_settings.buffer_count);
|
card->pstream = auich_stream_new(card, AUICH_USE_PLAY, current_settings.buffer_frames, current_settings.buffer_count);
|
||||||
|
|
||||||
card->buffer_ready_sem = create_sem(0, "pbuffer ready");
|
card->buffer_ready_sem = create_sem(0, "pbuffer ready");
|
||||||
|
|
||||||
LOG(("stream_setaudio\n"));
|
LOG(("stream_setaudio\n"));
|
||||||
|
|
||||||
auich_stream_set_audioparms(card->pstream, 2, true, current_settings.sample_rate);
|
auich_stream_set_audioparms(card->pstream, 2, true, current_settings.sample_rate);
|
||||||
auich_stream_set_audioparms(card->rstream, 2, true, current_settings.sample_rate);
|
auich_stream_set_audioparms(card->rstream, 2, true, current_settings.sample_rate);
|
||||||
|
|
||||||
card->pstream->first_channel = 0;
|
card->pstream->first_channel = 0;
|
||||||
card->rstream->first_channel = 2;
|
card->rstream->first_channel = 2;
|
||||||
|
|
||||||
auich_stream_commit_parms(card->pstream);
|
auich_stream_commit_parms(card->pstream);
|
||||||
auich_stream_commit_parms(card->rstream);
|
auich_stream_commit_parms(card->rstream);
|
||||||
|
|
||||||
auich_create_channels_list(&card->multi);
|
auich_create_channels_list(&card->multi);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1128,7 +1128,7 @@ auich_close(void* cookie)
|
|||||||
{
|
{
|
||||||
//auich_dev *card = cookie;
|
//auich_dev *card = cookie;
|
||||||
LOG(("close()\n"));
|
LOG(("close()\n"));
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1139,21 +1139,21 @@ auich_free(void* cookie)
|
|||||||
auich_dev *card = cookie;
|
auich_dev *card = cookie;
|
||||||
auich_stream *stream;
|
auich_stream *stream;
|
||||||
LOG(("free()\n"));
|
LOG(("free()\n"));
|
||||||
|
|
||||||
if (card->buffer_ready_sem > B_OK)
|
if (card->buffer_ready_sem > B_OK)
|
||||||
delete_sem(card->buffer_ready_sem);
|
delete_sem(card->buffer_ready_sem);
|
||||||
|
|
||||||
LIST_FOREACH(stream, &card->streams, next) {
|
LIST_FOREACH(stream, &card->streams, next) {
|
||||||
auich_stream_halt(stream);
|
auich_stream_halt(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!LIST_EMPTY(&card->streams)) {
|
while (!LIST_EMPTY(&card->streams)) {
|
||||||
auich_stream_delete(LIST_FIRST(&card->streams));
|
auich_stream_delete(LIST_FIRST(&card->streams));
|
||||||
}
|
}
|
||||||
|
|
||||||
card->pstream = NULL;
|
card->pstream = NULL;
|
||||||
card->rstream = NULL;
|
card->rstream = NULL;
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,24 +7,24 @@
|
|||||||
* Copyright (c) 2002, Marcus Overhagen <marcus@overhagen.de>
|
* Copyright (c) 2002, Marcus Overhagen <marcus@overhagen.de>
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
* are permitted provided that the following conditions are met:
|
* are permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* - Redistributions of source code must retain the above copyright notice,
|
* - Redistributions of source code must retain the above copyright notice,
|
||||||
* this list of conditions and the following disclaimer.
|
* this list of conditions and the following disclaimer.
|
||||||
* - Redistributions in binary form must reproduce the above copyright notice,
|
* - Redistributions in binary form must reproduce the above copyright notice,
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
* and/or other materials provided with the distribution.
|
* and/or other materials provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -43,13 +43,13 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
auvia_ac97_get_mix(void *card, const void *cookie, int32 type, float *values) {
|
auvia_ac97_get_mix(void *card, const void *cookie, int32 type, float *values) {
|
||||||
auvia_dev *dev = (auvia_dev*)card;
|
auvia_dev *dev = (auvia_dev*)card;
|
||||||
ac97_source_info *info = (ac97_source_info *)cookie;
|
ac97_source_info *info = (ac97_source_info *)cookie;
|
||||||
uint16 value, mask;
|
uint16 value, mask;
|
||||||
float gain;
|
float gain;
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case B_MIX_GAIN:
|
case B_MIX_GAIN:
|
||||||
value = auvia_codec_read(&dev->config, info->reg);
|
value = auvia_codec_read(&dev->config, info->reg);
|
||||||
@@ -61,7 +61,7 @@ auvia_ac97_get_mix(void *card, const void *cookie, int32 type, float *values) {
|
|||||||
values[0] = info->max_gain - gain;
|
values[0] = info->max_gain - gain;
|
||||||
else
|
else
|
||||||
values[0] = gain - info->min_gain;
|
values[0] = gain - info->min_gain;
|
||||||
|
|
||||||
mask = ((1 << (info->bits + 1)) - 1);
|
mask = ((1 << (info->bits + 1)) - 1);
|
||||||
gain = (value & mask) * info->granularity;
|
gain = (value & mask) * info->granularity;
|
||||||
if(info->polarity == 1)
|
if(info->polarity == 1)
|
||||||
@@ -101,26 +101,26 @@ auvia_ac97_get_mix(void *card, const void *cookie, int32 type, float *values) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
auvia_ac97_set_mix(void *card, const void *cookie, int32 type, float *values) {
|
auvia_ac97_set_mix(void *card, const void *cookie, int32 type, float *values) {
|
||||||
auvia_dev *dev = (auvia_dev*)card;
|
auvia_dev *dev = (auvia_dev*)card;
|
||||||
ac97_source_info *info = (ac97_source_info *)cookie;
|
ac97_source_info *info = (ac97_source_info *)cookie;
|
||||||
uint16 value, mask;
|
uint16 value, mask;
|
||||||
float gain;
|
float gain;
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case B_MIX_GAIN:
|
case B_MIX_GAIN:
|
||||||
value = auvia_codec_read(&dev->config, info->reg);
|
value = auvia_codec_read(&dev->config, info->reg);
|
||||||
if(info->type & B_MIX_STEREO) {
|
if(info->type & B_MIX_STEREO) {
|
||||||
mask = ((1 << (info->bits + 1)) - 1) << 8;
|
mask = ((1 << (info->bits + 1)) - 1) << 8;
|
||||||
value &= ~mask;
|
value &= ~mask;
|
||||||
|
|
||||||
if(info->polarity == 1)
|
if(info->polarity == 1)
|
||||||
gain = info->max_gain - values[0];
|
gain = info->max_gain - values[0];
|
||||||
else
|
else
|
||||||
gain = values[0] - info->min_gain;
|
gain = values[0] - info->min_gain;
|
||||||
value |= ((uint16)(gain / info->granularity) << 8) & mask;
|
value |= ((uint16)(gain / info->granularity) << 8) & mask;
|
||||||
|
|
||||||
mask = ((1 << (info->bits + 1)) - 1);
|
mask = ((1 << (info->bits + 1)) - 1);
|
||||||
value &= ~mask;
|
value &= ~mask;
|
||||||
if(info->polarity == 1)
|
if(info->polarity == 1)
|
||||||
@@ -174,7 +174,7 @@ auvia_ac97_set_mix(void *card, const void *cookie, int32 type, float *values) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int32
|
static int32
|
||||||
auvia_create_group_control(multi_dev *multi, int32 *index, int32 parent,
|
auvia_create_group_control(multi_dev *multi, int32 *index, int32 parent,
|
||||||
int32 string, const char* name) {
|
int32 string, const char* name) {
|
||||||
int32 i = *index;
|
int32 i = *index;
|
||||||
(*index)++;
|
(*index)++;
|
||||||
@@ -185,7 +185,7 @@ auvia_create_group_control(multi_dev *multi, int32 *index, int32 parent,
|
|||||||
multi->controls[i].mix_control.string = string;
|
multi->controls[i].mix_control.string = string;
|
||||||
if(name)
|
if(name)
|
||||||
strcpy(multi->controls[i].mix_control.name, name);
|
strcpy(multi->controls[i].mix_control.name, name);
|
||||||
|
|
||||||
return multi->controls[i].mix_control.id;
|
return multi->controls[i].mix_control.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,15 +195,15 @@ auvia_create_controls_list(multi_dev *multi)
|
|||||||
uint32 i = 0, index = 0, count, id, parent, parent2, parent3;
|
uint32 i = 0, index = 0, count, id, parent, parent2, parent3;
|
||||||
auvia_dev *card = (auvia_dev*)multi->card;
|
auvia_dev *card = (auvia_dev*)multi->card;
|
||||||
const ac97_source_info *info;
|
const ac97_source_info *info;
|
||||||
|
|
||||||
parent = auvia_create_group_control(multi, &index, 0, 0, "Record");
|
parent = auvia_create_group_control(multi, &index, 0, 0, "Record");
|
||||||
|
|
||||||
/* AC97 Record */
|
/* AC97 Record */
|
||||||
info = &source_info[0];
|
info = &source_info[0];
|
||||||
PRINT(("name : %s\n", info->name));
|
PRINT(("name : %s\n", info->name));
|
||||||
|
|
||||||
parent2 = auvia_create_group_control(multi, &index, parent, 0, info->name);
|
parent2 = auvia_create_group_control(multi, &index, parent, 0, info->name);
|
||||||
|
|
||||||
if(info->type & B_MIX_GAIN) {
|
if(info->type & B_MIX_GAIN) {
|
||||||
if(info->type & B_MIX_MUTE) {
|
if(info->type & B_MIX_MUTE) {
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
@@ -217,7 +217,7 @@ auvia_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].set = &auvia_ac97_set_mix;
|
multi->controls[index].set = &auvia_ac97_set_mix;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
||||||
multi->controls[index].mix_control.master = EMU_MULTI_CONTROL_MASTERID;
|
multi->controls[index].mix_control.master = EMU_MULTI_CONTROL_MASTERID;
|
||||||
@@ -232,7 +232,7 @@ auvia_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].set = &auvia_ac97_set_mix;
|
multi->controls[index].set = &auvia_ac97_set_mix;
|
||||||
id = multi->controls[index].mix_control.id;
|
id = multi->controls[index].mix_control.id;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
if(info->type & B_MIX_STEREO) {
|
if(info->type & B_MIX_STEREO) {
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
||||||
@@ -248,19 +248,19 @@ auvia_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].set = &auvia_ac97_set_mix;
|
multi->controls[index].set = &auvia_ac97_set_mix;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(info->type & B_MIX_RECORDMUX) {
|
if(info->type & B_MIX_RECORDMUX) {
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX;
|
||||||
multi->controls[index].mix_control.parent = parent2;
|
multi->controls[index].mix_control.parent = parent2;
|
||||||
strcpy(multi->controls[index].mix_control.name, "Record Mux");
|
strcpy(multi->controls[index].mix_control.name, "Record mux");
|
||||||
multi->controls[index].cookie = info;
|
multi->controls[index].cookie = info;
|
||||||
multi->controls[index].type = B_MIX_MUX;
|
multi->controls[index].type = B_MIX_MUX;
|
||||||
multi->controls[index].get = &auvia_ac97_get_mix;
|
multi->controls[index].get = &auvia_ac97_get_mix;
|
||||||
multi->controls[index].set = &auvia_ac97_set_mix;
|
multi->controls[index].set = &auvia_ac97_set_mix;
|
||||||
parent3 = multi->controls[index].mix_control.id;
|
parent3 = multi->controls[index].mix_control.id;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
@@ -269,22 +269,22 @@ auvia_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
strcpy(multi->controls[index].mix_control.name, "CD In");
|
strcpy(multi->controls[index].mix_control.name, "CD in");
|
||||||
index++;
|
index++;
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
strcpy(multi->controls[index].mix_control.name, "Video In");
|
strcpy(multi->controls[index].mix_control.name, "Video in");
|
||||||
index++;
|
index++;
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
strcpy(multi->controls[index].mix_control.name, "Aux In");
|
strcpy(multi->controls[index].mix_control.name, "Aux in");
|
||||||
index++;
|
index++;
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
strcpy(multi->controls[index].mix_control.name, "Line In");
|
strcpy(multi->controls[index].mix_control.name, "Line in");
|
||||||
index++;
|
index++;
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
@@ -302,19 +302,19 @@ auvia_create_controls_list(multi_dev *multi)
|
|||||||
strcpy(multi->controls[index].mix_control.name, "TAD");
|
strcpy(multi->controls[index].mix_control.name, "TAD");
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parent = auvia_create_group_control(multi, &index, 0, 0, "AC97 Mixer");
|
parent = auvia_create_group_control(multi, &index, 0, 0, "AC97 mixer");
|
||||||
|
|
||||||
count = source_info_size;
|
count = source_info_size;
|
||||||
count--;
|
count--;
|
||||||
|
|
||||||
for(i = 1; i < count ; i++) {
|
for(i = 1; i < count ; i++) {
|
||||||
info = &source_info[i];
|
info = &source_info[i];
|
||||||
PRINT(("name : %s\n", info->name));
|
PRINT(("name : %s\n", info->name));
|
||||||
|
|
||||||
parent2 = auvia_create_group_control(multi, &index, parent, 0, info->name);
|
parent2 = auvia_create_group_control(multi, &index, parent, 0, info->name);
|
||||||
|
|
||||||
if(info->type & B_MIX_GAIN) {
|
if(info->type & B_MIX_GAIN) {
|
||||||
if(info->type & B_MIX_MUTE) {
|
if(info->type & B_MIX_MUTE) {
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
@@ -328,7 +328,7 @@ auvia_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].set = &auvia_ac97_set_mix;
|
multi->controls[index].set = &auvia_ac97_set_mix;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
||||||
multi->controls[index].mix_control.master = EMU_MULTI_CONTROL_MASTERID;
|
multi->controls[index].mix_control.master = EMU_MULTI_CONTROL_MASTERID;
|
||||||
@@ -343,7 +343,7 @@ auvia_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].set = &auvia_ac97_set_mix;
|
multi->controls[index].set = &auvia_ac97_set_mix;
|
||||||
id = multi->controls[index].mix_control.id;
|
id = multi->controls[index].mix_control.id;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
if(info->type & B_MIX_STEREO) {
|
if(info->type & B_MIX_STEREO) {
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
||||||
@@ -359,14 +359,14 @@ auvia_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].set = &auvia_ac97_set_mix;
|
multi->controls[index].set = &auvia_ac97_set_mix;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parent = auvia_create_group_control(multi, &index, 0, S_SETUP, NULL);
|
parent = auvia_create_group_control(multi, &index, 0, S_SETUP, NULL);
|
||||||
|
|
||||||
/* AC97 20db Boost Mic */
|
/* AC97 20db Boost Mic */
|
||||||
info = &source_info[6];
|
info = &source_info[6];
|
||||||
|
|
||||||
if(info->type & B_MIX_GAIN && info->type & B_MIX_MICBOOST) {
|
if(info->type & B_MIX_GAIN && info->type & B_MIX_MICBOOST) {
|
||||||
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_ENABLE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_ENABLE;
|
||||||
@@ -379,13 +379,13 @@ auvia_create_controls_list(multi_dev *multi)
|
|||||||
multi->controls[index].set = &auvia_ac97_set_mix;
|
multi->controls[index].set = &auvia_ac97_set_mix;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
multi->control_count = index;
|
multi->control_count = index;
|
||||||
PRINT(("multi->control_count %lu\n", multi->control_count));
|
PRINT(("multi->control_count %lu\n", multi->control_count));
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auvia_get_mix(auvia_dev *card, multi_mix_value_info * mmvi)
|
auvia_get_mix(auvia_dev *card, multi_mix_value_info * mmvi)
|
||||||
{
|
{
|
||||||
int32 i, id;
|
int32 i, id;
|
||||||
@@ -397,7 +397,7 @@ auvia_get_mix(auvia_dev *card, multi_mix_value_info * mmvi)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
control = &card->multi.controls[id];
|
control = &card->multi.controls[id];
|
||||||
|
|
||||||
if(control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
if(control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||||
if(control->get) {
|
if(control->get) {
|
||||||
float values[2];
|
float values[2];
|
||||||
@@ -406,15 +406,15 @@ auvia_get_mix(auvia_dev *card, multi_mix_value_info * mmvi)
|
|||||||
mmvi->values[i].u.gain = values[0];
|
mmvi->values[i].u.gain = values[0];
|
||||||
else
|
else
|
||||||
mmvi->values[i].u.gain = values[1];
|
mmvi->values[i].u.gain = values[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
if(control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(card, control->cookie, control->type, values);
|
control->get(card, control->cookie, control->type, values);
|
||||||
mmvi->values[i].u.enable = (values[0] == 1.0);
|
mmvi->values[i].u.enable = (values[0] == 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
if(control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(card, control->cookie, control->type, values);
|
control->get(card, control->cookie, control->type, values);
|
||||||
@@ -424,7 +424,7 @@ auvia_get_mix(auvia_dev *card, multi_mix_value_info * mmvi)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auvia_set_mix(auvia_dev *card, multi_mix_value_info * mmvi)
|
auvia_set_mix(auvia_dev *card, multi_mix_value_info * mmvi)
|
||||||
{
|
{
|
||||||
int32 i, id;
|
int32 i, id;
|
||||||
@@ -436,7 +436,7 @@ auvia_set_mix(auvia_dev *card, multi_mix_value_info * mmvi)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
control = &card->multi.controls[id];
|
control = &card->multi.controls[id];
|
||||||
|
|
||||||
if(control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
if(control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||||
multi_mixer_control *control2 = NULL;
|
multi_mixer_control *control2 = NULL;
|
||||||
if(i+1<mmvi->item_count) {
|
if(i+1<mmvi->item_count) {
|
||||||
@@ -459,27 +459,27 @@ auvia_set_mix(auvia_dev *card, multi_mix_value_info * mmvi)
|
|||||||
values[0] = mmvi->values[i].u.gain;
|
values[0] = mmvi->values[i].u.gain;
|
||||||
else
|
else
|
||||||
values[1] = mmvi->values[i].u.gain;
|
values[1] = mmvi->values[i].u.gain;
|
||||||
|
|
||||||
if(control2 && control2->mix_control.master != EMU_MULTI_CONTROL_MASTERID)
|
if(control2 && control2->mix_control.master != EMU_MULTI_CONTROL_MASTERID)
|
||||||
values[1] = mmvi->values[i+1].u.gain;
|
values[1] = mmvi->values[i+1].u.gain;
|
||||||
|
|
||||||
control->set(card, control->cookie, control->type, values);
|
control->set(card, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(control2)
|
if(control2)
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
if(control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
||||||
float values[1];
|
float values[1];
|
||||||
|
|
||||||
values[0] = mmvi->values[i].u.enable ? 1.0 : 0.0;
|
values[0] = mmvi->values[i].u.enable ? 1.0 : 0.0;
|
||||||
control->set(card, control->cookie, control->type, values);
|
control->set(card, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
if(control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||||
float values[1];
|
float values[1];
|
||||||
|
|
||||||
values[0] = (float)mmvi->values[i].u.mux;
|
values[0] = (float)mmvi->values[i].u.mux;
|
||||||
control->set(card, control->cookie, control->type, values);
|
control->set(card, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
@@ -487,33 +487,33 @@ auvia_set_mix(auvia_dev *card, multi_mix_value_info * mmvi)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auvia_list_mix_controls(auvia_dev *card, multi_mix_control_info * mmci)
|
auvia_list_mix_controls(auvia_dev *card, multi_mix_control_info * mmci)
|
||||||
{
|
{
|
||||||
multi_mix_control *mmc;
|
multi_mix_control *mmc;
|
||||||
int32 i;
|
int32 i;
|
||||||
|
|
||||||
mmc = mmci->controls;
|
mmc = mmci->controls;
|
||||||
if(mmci->control_count < 24)
|
if(mmci->control_count < 24)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
if(auvia_create_controls_list(&card->multi) < B_OK)
|
if(auvia_create_controls_list(&card->multi) < B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
for(i = 0; i < card->multi.control_count; i++) {
|
for(i = 0; i < card->multi.control_count; i++) {
|
||||||
mmc[i] = card->multi.controls[i].mix_control;
|
mmc[i] = card->multi.controls[i].mix_control;
|
||||||
}
|
}
|
||||||
|
|
||||||
mmci->control_count = card->multi.control_count;
|
mmci->control_count = card->multi.control_count;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auvia_list_mix_connections(auvia_dev *card, multi_mix_connection_info * data)
|
auvia_list_mix_connections(auvia_dev *card, multi_mix_connection_info * data)
|
||||||
{
|
{
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auvia_list_mix_channels(auvia_dev *card, multi_mix_channel_info *data)
|
auvia_list_mix_channels(auvia_dev *card, multi_mix_channel_info *data)
|
||||||
{
|
{
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
@@ -566,21 +566,21 @@ auvia_create_channels_list(multi_dev *multi)
|
|||||||
B_CHANNEL_CENTER,
|
B_CHANNEL_CENTER,
|
||||||
B_CHANNEL_SUB
|
B_CHANNEL_SUB
|
||||||
};
|
};
|
||||||
|
|
||||||
chans = multi->chans;
|
chans = multi->chans;
|
||||||
index = 0;
|
index = 0;
|
||||||
|
|
||||||
for(mode=AUVIA_USE_PLAY; mode!=-1;
|
for(mode=AUVIA_USE_PLAY; mode!=-1;
|
||||||
mode = (mode == AUVIA_USE_PLAY) ? AUVIA_USE_RECORD : -1) {
|
mode = (mode == AUVIA_USE_PLAY) ? AUVIA_USE_RECORD : -1) {
|
||||||
LIST_FOREACH(stream, &((auvia_dev*)multi->card)->streams, next) {
|
LIST_FOREACH(stream, &((auvia_dev*)multi->card)->streams, next) {
|
||||||
if ((stream->use & mode) == 0)
|
if ((stream->use & mode) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(stream->channels == 2)
|
if(stream->channels == 2)
|
||||||
designations = B_CHANNEL_STEREO_BUS;
|
designations = B_CHANNEL_STEREO_BUS;
|
||||||
else
|
else
|
||||||
designations = B_CHANNEL_SURROUND_BUS;
|
designations = B_CHANNEL_SURROUND_BUS;
|
||||||
|
|
||||||
for(i = 0; i < stream->channels; i++) {
|
for(i = 0; i < stream->channels; i++) {
|
||||||
chans[index].channel_id = index;
|
chans[index].channel_id = index;
|
||||||
chans[index].kind = (mode == AUVIA_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
chans[index].kind = (mode == AUVIA_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
||||||
@@ -589,49 +589,49 @@ auvia_create_channels_list(multi_dev *multi)
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mode==AUVIA_USE_PLAY) {
|
if(mode==AUVIA_USE_PLAY) {
|
||||||
multi->output_channel_count = index;
|
multi->output_channel_count = index;
|
||||||
} else {
|
} else {
|
||||||
multi->input_channel_count = index - multi->output_channel_count;
|
multi->input_channel_count = index - multi->output_channel_count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
chans[index].channel_id = index;
|
chans[index].channel_id = index;
|
||||||
chans[index].kind = B_MULTI_OUTPUT_BUS;
|
chans[index].kind = B_MULTI_OUTPUT_BUS;
|
||||||
chans[index].designations = B_CHANNEL_LEFT | B_CHANNEL_STEREO_BUS;
|
chans[index].designations = B_CHANNEL_LEFT | B_CHANNEL_STEREO_BUS;
|
||||||
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
chans[index].channel_id = index;
|
chans[index].channel_id = index;
|
||||||
chans[index].kind = B_MULTI_OUTPUT_BUS;
|
chans[index].kind = B_MULTI_OUTPUT_BUS;
|
||||||
chans[index].designations = B_CHANNEL_RIGHT | B_CHANNEL_STEREO_BUS;
|
chans[index].designations = B_CHANNEL_RIGHT | B_CHANNEL_STEREO_BUS;
|
||||||
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
multi->output_bus_channel_count = index - multi->output_channel_count
|
multi->output_bus_channel_count = index - multi->output_channel_count
|
||||||
- multi->input_channel_count;
|
- multi->input_channel_count;
|
||||||
|
|
||||||
chans[index].channel_id = index;
|
chans[index].channel_id = index;
|
||||||
chans[index].kind = B_MULTI_INPUT_BUS;
|
chans[index].kind = B_MULTI_INPUT_BUS;
|
||||||
chans[index].designations = B_CHANNEL_LEFT | B_CHANNEL_STEREO_BUS;
|
chans[index].designations = B_CHANNEL_LEFT | B_CHANNEL_STEREO_BUS;
|
||||||
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
chans[index].channel_id = index;
|
chans[index].channel_id = index;
|
||||||
chans[index].kind = B_MULTI_INPUT_BUS;
|
chans[index].kind = B_MULTI_INPUT_BUS;
|
||||||
chans[index].designations = B_CHANNEL_RIGHT | B_CHANNEL_STEREO_BUS;
|
chans[index].designations = B_CHANNEL_RIGHT | B_CHANNEL_STEREO_BUS;
|
||||||
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
multi->input_bus_channel_count = index - multi->output_channel_count
|
multi->input_bus_channel_count = index - multi->output_channel_count
|
||||||
- multi->input_channel_count - multi->output_bus_channel_count;
|
- multi->input_channel_count - multi->output_bus_channel_count;
|
||||||
|
|
||||||
multi->aux_bus_channel_count = 0;
|
multi->aux_bus_channel_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auvia_get_description(auvia_dev *card, multi_description *data)
|
auvia_get_description(auvia_dev *card, multi_description *data)
|
||||||
{
|
{
|
||||||
uint32 size;
|
uint32 size;
|
||||||
@@ -672,21 +672,21 @@ auvia_get_description(auvia_dev *card, multi_description *data)
|
|||||||
data->output_bus_channel_count = 2;
|
data->output_bus_channel_count = 2;
|
||||||
data->input_bus_channel_count = 2;
|
data->input_bus_channel_count = 2;
|
||||||
data->aux_bus_channel_count = 0;*/
|
data->aux_bus_channel_count = 0;*/
|
||||||
|
|
||||||
data->output_channel_count = card->multi.output_channel_count;
|
data->output_channel_count = card->multi.output_channel_count;
|
||||||
data->input_channel_count = card->multi.input_channel_count;
|
data->input_channel_count = card->multi.input_channel_count;
|
||||||
data->output_bus_channel_count = card->multi.output_bus_channel_count;
|
data->output_bus_channel_count = card->multi.output_bus_channel_count;
|
||||||
data->input_bus_channel_count = card->multi.input_bus_channel_count;
|
data->input_bus_channel_count = card->multi.input_bus_channel_count;
|
||||||
data->aux_bus_channel_count = card->multi.aux_bus_channel_count;
|
data->aux_bus_channel_count = card->multi.aux_bus_channel_count;
|
||||||
|
|
||||||
size = card->multi.output_channel_count + card->multi.input_channel_count
|
size = card->multi.output_channel_count + card->multi.input_channel_count
|
||||||
+ card->multi.output_bus_channel_count + card->multi.input_bus_channel_count
|
+ card->multi.output_bus_channel_count + card->multi.input_bus_channel_count
|
||||||
+ card->multi.aux_bus_channel_count;
|
+ card->multi.aux_bus_channel_count;
|
||||||
|
|
||||||
// for each channel, starting with the first output channel,
|
// for each channel, starting with the first output channel,
|
||||||
// then the second, third..., followed by the first input
|
// then the second, third..., followed by the first input
|
||||||
// channel, second, third, ..., followed by output bus
|
// channel, second, third, ..., followed by output bus
|
||||||
// channels and input bus channels and finally auxillary channels,
|
// channels and input bus channels and finally auxillary channels,
|
||||||
|
|
||||||
LOG(("request_channel_count = %d\n",data->request_channel_count));
|
LOG(("request_channel_count = %d\n",data->request_channel_count));
|
||||||
if (data->request_channel_count >= size) {
|
if (data->request_channel_count >= size) {
|
||||||
@@ -714,7 +714,7 @@ auvia_get_description(auvia_dev *card, multi_description *data)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auvia_get_enabled_channels(auvia_dev *card, multi_channel_enable *data)
|
auvia_get_enabled_channels(auvia_dev *card, multi_channel_enable *data)
|
||||||
{
|
{
|
||||||
B_SET_CHANNEL(data->enable_bits, 0, true);
|
B_SET_CHANNEL(data->enable_bits, 0, true);
|
||||||
@@ -731,7 +731,7 @@ auvia_get_enabled_channels(auvia_dev *card, multi_channel_enable *data)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auvia_set_enabled_channels(auvia_dev *card, multi_channel_enable *data)
|
auvia_set_enabled_channels(auvia_dev *card, multi_channel_enable *data)
|
||||||
{
|
{
|
||||||
PRINT(("set_enabled_channels 0 : %s\n", B_TEST_CHANNEL(data->enable_bits, 0) ? "enabled": "disabled"));
|
PRINT(("set_enabled_channels 0 : %s\n", B_TEST_CHANNEL(data->enable_bits, 0) ? "enabled": "disabled"));
|
||||||
@@ -741,7 +741,7 @@ auvia_set_enabled_channels(auvia_dev *card, multi_channel_enable *data)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auvia_get_global_format(auvia_dev *card, multi_format_info *data)
|
auvia_get_global_format(auvia_dev *card, multi_format_info *data)
|
||||||
{
|
{
|
||||||
data->output_latency = 0;
|
data->output_latency = 0;
|
||||||
@@ -762,11 +762,11 @@ auvia_get_global_format(auvia_dev *card, multi_format_info *data)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auvia_get_buffers(auvia_dev *card, multi_buffer_list *data)
|
auvia_get_buffers(auvia_dev *card, multi_buffer_list *data)
|
||||||
{
|
{
|
||||||
uint32 i, j, pchannels, rchannels;
|
uint32 i, j, pchannels, rchannels;
|
||||||
|
|
||||||
LOG(("flags = %#x\n",data->flags));
|
LOG(("flags = %#x\n",data->flags));
|
||||||
LOG(("request_playback_buffers = %#x\n",data->request_playback_buffers));
|
LOG(("request_playback_buffers = %#x\n",data->request_playback_buffers));
|
||||||
LOG(("request_playback_channels = %#x\n",data->request_playback_channels));
|
LOG(("request_playback_channels = %#x\n",data->request_playback_channels));
|
||||||
@@ -774,10 +774,10 @@ auvia_get_buffers(auvia_dev *card, multi_buffer_list *data)
|
|||||||
LOG(("request_record_buffers = %#x\n",data->request_record_buffers));
|
LOG(("request_record_buffers = %#x\n",data->request_record_buffers));
|
||||||
LOG(("request_record_channels = %#x\n",data->request_record_channels));
|
LOG(("request_record_channels = %#x\n",data->request_record_channels));
|
||||||
LOG(("request_record_buffer_size = %#x\n",data->request_record_buffer_size));
|
LOG(("request_record_buffer_size = %#x\n",data->request_record_buffer_size));
|
||||||
|
|
||||||
pchannels = card->pstream->channels;
|
pchannels = card->pstream->channels;
|
||||||
rchannels = card->rstream->channels;
|
rchannels = card->rstream->channels;
|
||||||
|
|
||||||
if (data->request_playback_buffers < BUFFER_COUNT ||
|
if (data->request_playback_buffers < BUFFER_COUNT ||
|
||||||
data->request_playback_channels < (pchannels) ||
|
data->request_playback_channels < (pchannels) ||
|
||||||
data->request_record_buffers < BUFFER_COUNT ||
|
data->request_record_buffers < BUFFER_COUNT ||
|
||||||
@@ -786,30 +786,30 @@ auvia_get_buffers(auvia_dev *card, multi_buffer_list *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(BUFFER_COUNT == 2);
|
ASSERT(BUFFER_COUNT == 2);
|
||||||
|
|
||||||
data->flags = B_MULTI_BUFFER_PLAYBACK | B_MULTI_BUFFER_RECORD; // XXX ???
|
data->flags = B_MULTI_BUFFER_PLAYBACK | B_MULTI_BUFFER_RECORD; // XXX ???
|
||||||
// data->flags = 0;
|
// data->flags = 0;
|
||||||
|
|
||||||
data->return_playback_buffers = BUFFER_COUNT; /* playback_buffers[b][] */
|
data->return_playback_buffers = BUFFER_COUNT; /* playback_buffers[b][] */
|
||||||
data->return_playback_channels = pchannels; /* playback_buffers[][c] */
|
data->return_playback_channels = pchannels; /* playback_buffers[][c] */
|
||||||
data->return_playback_buffer_size = BUFFER_FRAMES; /* frames */
|
data->return_playback_buffer_size = BUFFER_FRAMES; /* frames */
|
||||||
|
|
||||||
for(i = 0; i < BUFFER_COUNT; i++)
|
for(i = 0; i < BUFFER_COUNT; i++)
|
||||||
for(j=0; j<pchannels; j++)
|
for(j=0; j<pchannels; j++)
|
||||||
auvia_stream_get_nth_buffer(card->pstream, j, i,
|
auvia_stream_get_nth_buffer(card->pstream, j, i,
|
||||||
&data->playback_buffers[i][j].base,
|
&data->playback_buffers[i][j].base,
|
||||||
&data->playback_buffers[i][j].stride);
|
&data->playback_buffers[i][j].stride);
|
||||||
|
|
||||||
data->return_record_buffers = BUFFER_COUNT;
|
data->return_record_buffers = BUFFER_COUNT;
|
||||||
data->return_record_channels = rchannels;
|
data->return_record_channels = rchannels;
|
||||||
data->return_record_buffer_size = BUFFER_FRAMES; /* frames */
|
data->return_record_buffer_size = BUFFER_FRAMES; /* frames */
|
||||||
|
|
||||||
for(i = 0; i < BUFFER_COUNT; i++)
|
for(i = 0; i < BUFFER_COUNT; i++)
|
||||||
for(j=0; j<rchannels; j++)
|
for(j=0; j<rchannels; j++)
|
||||||
auvia_stream_get_nth_buffer(card->rstream, j, i,
|
auvia_stream_get_nth_buffer(card->rstream, j, i,
|
||||||
&data->record_buffers[i][j].base,
|
&data->record_buffers[i][j].base,
|
||||||
&data->record_buffers[i][j].stride);
|
&data->record_buffers[i][j].stride);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -819,17 +819,17 @@ auvia_play_inth(void* inthparams)
|
|||||||
{
|
{
|
||||||
auvia_stream *stream = (auvia_stream *)inthparams;
|
auvia_stream *stream = (auvia_stream *)inthparams;
|
||||||
//int32 count;
|
//int32 count;
|
||||||
|
|
||||||
//TRACE(("auvia_play_inth\n"));
|
//TRACE(("auvia_play_inth\n"));
|
||||||
|
|
||||||
acquire_spinlock(&slock);
|
acquire_spinlock(&slock);
|
||||||
stream->real_time = system_time();
|
stream->real_time = system_time();
|
||||||
stream->frames_count += BUFFER_FRAMES;
|
stream->frames_count += BUFFER_FRAMES;
|
||||||
stream->buffer_cycle = (stream->trigblk
|
stream->buffer_cycle = (stream->trigblk
|
||||||
+ stream->blkmod -1) % stream->blkmod;
|
+ stream->blkmod -1) % stream->blkmod;
|
||||||
stream->update_needed = true;
|
stream->update_needed = true;
|
||||||
release_spinlock(&slock);
|
release_spinlock(&slock);
|
||||||
|
|
||||||
//get_sem_count(stream->card->buffer_ready_sem, &count);
|
//get_sem_count(stream->card->buffer_ready_sem, &count);
|
||||||
//if (count <= 0)
|
//if (count <= 0)
|
||||||
release_sem_etc(stream->card->buffer_ready_sem, 1, B_DO_NOT_RESCHEDULE);
|
release_sem_etc(stream->card->buffer_ready_sem, 1, B_DO_NOT_RESCHEDULE);
|
||||||
@@ -840,29 +840,29 @@ auvia_record_inth(void* inthparams)
|
|||||||
{
|
{
|
||||||
auvia_stream *stream = (auvia_stream *)inthparams;
|
auvia_stream *stream = (auvia_stream *)inthparams;
|
||||||
//int32 count;
|
//int32 count;
|
||||||
|
|
||||||
//TRACE(("auvia_record_inth\n"));
|
//TRACE(("auvia_record_inth\n"));
|
||||||
|
|
||||||
acquire_spinlock(&slock);
|
acquire_spinlock(&slock);
|
||||||
stream->real_time = system_time();
|
stream->real_time = system_time();
|
||||||
stream->frames_count += BUFFER_FRAMES;
|
stream->frames_count += BUFFER_FRAMES;
|
||||||
stream->buffer_cycle = (stream->trigblk
|
stream->buffer_cycle = (stream->trigblk
|
||||||
+ stream->blkmod -1) % stream->blkmod;
|
+ stream->blkmod -1) % stream->blkmod;
|
||||||
stream->update_needed = true;
|
stream->update_needed = true;
|
||||||
release_spinlock(&slock);
|
release_spinlock(&slock);
|
||||||
|
|
||||||
//get_sem_count(stream->card->buffer_ready_sem, &count);
|
//get_sem_count(stream->card->buffer_ready_sem, &count);
|
||||||
//if (count <= 0)
|
//if (count <= 0)
|
||||||
release_sem_etc(stream->card->buffer_ready_sem, 1, B_DO_NOT_RESCHEDULE);
|
release_sem_etc(stream->card->buffer_ready_sem, 1, B_DO_NOT_RESCHEDULE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auvia_buffer_exchange(auvia_dev *card, multi_buffer_info *data)
|
auvia_buffer_exchange(auvia_dev *card, multi_buffer_info *data)
|
||||||
{
|
{
|
||||||
cpu_status status;
|
cpu_status status;
|
||||||
auvia_stream *pstream, *rstream;
|
auvia_stream *pstream, *rstream;
|
||||||
multi_buffer_info buffer_info;
|
multi_buffer_info buffer_info;
|
||||||
|
|
||||||
#ifdef __HAIKU__
|
#ifdef __HAIKU__
|
||||||
if (user_memcpy(&buffer_info, data, sizeof(buffer_info)) < B_OK)
|
if (user_memcpy(&buffer_info, data, sizeof(buffer_info)) < B_OK)
|
||||||
return B_BAD_ADDRESS;
|
return B_BAD_ADDRESS;
|
||||||
@@ -871,10 +871,10 @@ auvia_buffer_exchange(auvia_dev *card, multi_buffer_info *data)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
buffer_info.flags = B_MULTI_BUFFER_PLAYBACK | B_MULTI_BUFFER_RECORD;
|
buffer_info.flags = B_MULTI_BUFFER_PLAYBACK | B_MULTI_BUFFER_RECORD;
|
||||||
|
|
||||||
if (!(card->pstream->state & AUVIA_STATE_STARTED))
|
if (!(card->pstream->state & AUVIA_STATE_STARTED))
|
||||||
auvia_stream_start(card->pstream, auvia_play_inth, card->pstream);
|
auvia_stream_start(card->pstream, auvia_play_inth, card->pstream);
|
||||||
|
|
||||||
if (!(card->rstream->state & AUVIA_STATE_STARTED))
|
if (!(card->rstream->state & AUVIA_STATE_STARTED))
|
||||||
auvia_stream_start(card->rstream, auvia_record_inth, card->rstream);
|
auvia_stream_start(card->rstream, auvia_record_inth, card->rstream);
|
||||||
|
|
||||||
@@ -882,37 +882,37 @@ auvia_buffer_exchange(auvia_dev *card, multi_buffer_info *data)
|
|||||||
== B_TIMED_OUT) {
|
== B_TIMED_OUT) {
|
||||||
LOG(("buffer_exchange timeout ff\n"));
|
LOG(("buffer_exchange timeout ff\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
status = lock();
|
status = lock();
|
||||||
|
|
||||||
LIST_FOREACH(pstream, &card->streams, next) {
|
LIST_FOREACH(pstream, &card->streams, next) {
|
||||||
if ((pstream->use & AUVIA_USE_PLAY) == 0 ||
|
if ((pstream->use & AUVIA_USE_PLAY) == 0 ||
|
||||||
(pstream->state & AUVIA_STATE_STARTED) == 0)
|
(pstream->state & AUVIA_STATE_STARTED) == 0)
|
||||||
continue;
|
continue;
|
||||||
if(pstream->update_needed)
|
if(pstream->update_needed)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
LIST_FOREACH(rstream, &card->streams, next) {
|
LIST_FOREACH(rstream, &card->streams, next) {
|
||||||
if ((rstream->use & AUVIA_USE_RECORD) == 0 ||
|
if ((rstream->use & AUVIA_USE_RECORD) == 0 ||
|
||||||
(rstream->state & AUVIA_STATE_STARTED) == 0)
|
(rstream->state & AUVIA_STATE_STARTED) == 0)
|
||||||
continue;
|
continue;
|
||||||
if(rstream->update_needed)
|
if(rstream->update_needed)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!pstream)
|
if(!pstream)
|
||||||
pstream = card->pstream;
|
pstream = card->pstream;
|
||||||
if(!rstream)
|
if(!rstream)
|
||||||
rstream = card->rstream;
|
rstream = card->rstream;
|
||||||
|
|
||||||
/* do playback */
|
/* do playback */
|
||||||
buffer_info.playback_buffer_cycle = pstream->buffer_cycle;
|
buffer_info.playback_buffer_cycle = pstream->buffer_cycle;
|
||||||
buffer_info.played_real_time = pstream->real_time;
|
buffer_info.played_real_time = pstream->real_time;
|
||||||
buffer_info.played_frames_count = pstream->frames_count;
|
buffer_info.played_frames_count = pstream->frames_count;
|
||||||
buffer_info._reserved_0 = pstream->first_channel;
|
buffer_info._reserved_0 = pstream->first_channel;
|
||||||
pstream->update_needed = false;
|
pstream->update_needed = false;
|
||||||
|
|
||||||
/* do record */
|
/* do record */
|
||||||
buffer_info.record_buffer_cycle = rstream->buffer_cycle;
|
buffer_info.record_buffer_cycle = rstream->buffer_cycle;
|
||||||
buffer_info.recorded_frames_count = rstream->frames_count;
|
buffer_info.recorded_frames_count = rstream->frames_count;
|
||||||
@@ -932,20 +932,20 @@ auvia_buffer_exchange(auvia_dev *card, multi_buffer_info *data)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auvia_buffer_force_stop(auvia_dev *card)
|
auvia_buffer_force_stop(auvia_dev *card)
|
||||||
{
|
{
|
||||||
//auvia_voice_halt(card->pvoice);
|
//auvia_voice_halt(card->pvoice);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
auvia_multi_control(void *cookie, uint32 op, void *data, size_t length)
|
auvia_multi_control(void *cookie, uint32 op, void *data, size_t length)
|
||||||
{
|
{
|
||||||
auvia_dev *card = (auvia_dev *)cookie;
|
auvia_dev *card = (auvia_dev *)cookie;
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case B_MULTI_GET_DESCRIPTION:
|
case B_MULTI_GET_DESCRIPTION:
|
||||||
LOG(("B_MULTI_GET_DESCRIPTION\n"));
|
LOG(("B_MULTI_GET_DESCRIPTION\n"));
|
||||||
return auvia_get_description(card, (multi_description *)data);
|
return auvia_get_description(card, (multi_description *)data);
|
||||||
case B_MULTI_GET_EVENT_INFO:
|
case B_MULTI_GET_EVENT_INFO:
|
||||||
@@ -968,7 +968,7 @@ auvia_multi_control(void *cookie, uint32 op, void *data, size_t length)
|
|||||||
return auvia_get_global_format(card, (multi_format_info *)data);
|
return auvia_get_global_format(card, (multi_format_info *)data);
|
||||||
case B_MULTI_SET_GLOBAL_FORMAT:
|
case B_MULTI_SET_GLOBAL_FORMAT:
|
||||||
LOG(("B_MULTI_SET_GLOBAL_FORMAT\n"));
|
LOG(("B_MULTI_SET_GLOBAL_FORMAT\n"));
|
||||||
return B_OK; /* XXX BUG! we *MUST* return B_OK, returning B_ERROR will prevent
|
return B_OK; /* XXX BUG! we *MUST* return B_OK, returning B_ERROR will prevent
|
||||||
* BeOS to accept the format returned in B_MULTI_GET_GLOBAL_FORMAT
|
* BeOS to accept the format returned in B_MULTI_GET_GLOBAL_FORMAT
|
||||||
*/
|
*/
|
||||||
case B_MULTI_GET_CHANNEL_FORMATS:
|
case B_MULTI_GET_CHANNEL_FORMATS:
|
||||||
@@ -1037,53 +1037,53 @@ auvia_open(const char *name, uint32 flags, void** cookie)
|
|||||||
{
|
{
|
||||||
auvia_dev *card = NULL;
|
auvia_dev *card = NULL;
|
||||||
int ix;
|
int ix;
|
||||||
|
|
||||||
LOG(("open()\n"));
|
LOG(("open()\n"));
|
||||||
|
|
||||||
for (ix=0; ix<num_cards; ix++) {
|
for (ix=0; ix<num_cards; ix++) {
|
||||||
if (!strcmp(cards[ix].name, name)) {
|
if (!strcmp(cards[ix].name, name)) {
|
||||||
card = &cards[ix];
|
card = &cards[ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(card == NULL) {
|
if(card == NULL) {
|
||||||
LOG(("open() card not found %s\n", name));
|
LOG(("open() card not found %s\n", name));
|
||||||
for (ix=0; ix<num_cards; ix++) {
|
for (ix=0; ix<num_cards; ix++) {
|
||||||
LOG(("open() card available %s\n", cards[ix].name));
|
LOG(("open() card available %s\n", cards[ix].name));
|
||||||
}
|
}
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(("open() got card\n"));
|
LOG(("open() got card\n"));
|
||||||
|
|
||||||
if(card->pstream !=NULL)
|
if(card->pstream !=NULL)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
if(card->rstream !=NULL)
|
if(card->rstream !=NULL)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
*cookie = card;
|
*cookie = card;
|
||||||
card->multi.card = card;
|
card->multi.card = card;
|
||||||
|
|
||||||
LOG(("stream_new\n"));
|
LOG(("stream_new\n"));
|
||||||
|
|
||||||
card->rstream = auvia_stream_new(card, AUVIA_USE_RECORD, BUFFER_FRAMES, BUFFER_COUNT);
|
card->rstream = auvia_stream_new(card, AUVIA_USE_RECORD, BUFFER_FRAMES, BUFFER_COUNT);
|
||||||
card->pstream = auvia_stream_new(card, AUVIA_USE_PLAY, BUFFER_FRAMES, BUFFER_COUNT);
|
card->pstream = auvia_stream_new(card, AUVIA_USE_PLAY, BUFFER_FRAMES, BUFFER_COUNT);
|
||||||
|
|
||||||
card->buffer_ready_sem = create_sem(0, "pbuffer ready");
|
card->buffer_ready_sem = create_sem(0, "pbuffer ready");
|
||||||
|
|
||||||
LOG(("stream_setaudio\n"));
|
LOG(("stream_setaudio\n"));
|
||||||
|
|
||||||
auvia_stream_set_audioparms(card->pstream, 2, true, 48000);
|
auvia_stream_set_audioparms(card->pstream, 2, true, 48000);
|
||||||
auvia_stream_set_audioparms(card->rstream, 2, true, 48000);
|
auvia_stream_set_audioparms(card->rstream, 2, true, 48000);
|
||||||
|
|
||||||
card->pstream->first_channel = 0;
|
card->pstream->first_channel = 0;
|
||||||
card->rstream->first_channel = 2;
|
card->rstream->first_channel = 2;
|
||||||
|
|
||||||
auvia_stream_commit_parms(card->pstream);
|
auvia_stream_commit_parms(card->pstream);
|
||||||
auvia_stream_commit_parms(card->rstream);
|
auvia_stream_commit_parms(card->rstream);
|
||||||
|
|
||||||
auvia_create_channels_list(&card->multi);
|
auvia_create_channels_list(&card->multi);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1092,7 +1092,7 @@ auvia_close(void* cookie)
|
|||||||
{
|
{
|
||||||
//auvia_dev *card = cookie;
|
//auvia_dev *card = cookie;
|
||||||
LOG(("close()\n"));
|
LOG(("close()\n"));
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1102,21 +1102,21 @@ auvia_free(void* cookie)
|
|||||||
auvia_dev *card = cookie;
|
auvia_dev *card = cookie;
|
||||||
auvia_stream *stream;
|
auvia_stream *stream;
|
||||||
LOG(("free()\n"));
|
LOG(("free()\n"));
|
||||||
|
|
||||||
if (card->buffer_ready_sem > B_OK)
|
if (card->buffer_ready_sem > B_OK)
|
||||||
delete_sem(card->buffer_ready_sem);
|
delete_sem(card->buffer_ready_sem);
|
||||||
|
|
||||||
LIST_FOREACH(stream, &card->streams, next) {
|
LIST_FOREACH(stream, &card->streams, next) {
|
||||||
auvia_stream_halt(stream);
|
auvia_stream_halt(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
while(!LIST_EMPTY(&card->streams)) {
|
while(!LIST_EMPTY(&card->streams)) {
|
||||||
auvia_stream_delete(LIST_FIRST(&card->streams));
|
auvia_stream_delete(LIST_FIRST(&card->streams));
|
||||||
}
|
}
|
||||||
|
|
||||||
card->pstream = NULL;
|
card->pstream = NULL;
|
||||||
card->rstream = NULL;
|
card->rstream = NULL;
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -185,12 +185,12 @@ set_global_format(geode_controller* controller, multi_format_info* data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
geode_ac97_get_mix(geode_controller *controller, const void *cookie, int32 type, float *values) {
|
geode_ac97_get_mix(geode_controller *controller, const void *cookie, int32 type, float *values) {
|
||||||
ac97_source_info *info = (ac97_source_info *)cookie;
|
ac97_source_info *info = (ac97_source_info *)cookie;
|
||||||
uint16 value, mask;
|
uint16 value, mask;
|
||||||
float gain;
|
float gain;
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case B_MIX_GAIN:
|
case B_MIX_GAIN:
|
||||||
value = ac97_reg_cached_read(controller->ac97, info->reg);
|
value = ac97_reg_cached_read(controller->ac97, info->reg);
|
||||||
@@ -202,7 +202,7 @@ geode_ac97_get_mix(geode_controller *controller, const void *cookie, int32 type,
|
|||||||
values[0] = info->max_gain - gain;
|
values[0] = info->max_gain - gain;
|
||||||
else
|
else
|
||||||
values[0] = gain - info->min_gain;
|
values[0] = gain - info->min_gain;
|
||||||
|
|
||||||
mask = ((1 << (info->bits + 1)) - 1);
|
mask = ((1 << (info->bits + 1)) - 1);
|
||||||
gain = (value & mask) * info->granularity;
|
gain = (value & mask) * info->granularity;
|
||||||
if (info->polarity == 1)
|
if (info->polarity == 1)
|
||||||
@@ -243,25 +243,25 @@ geode_ac97_get_mix(geode_controller *controller, const void *cookie, int32 type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
geode_ac97_set_mix(geode_controller *controller, const void *cookie, int32 type, float *values) {
|
geode_ac97_set_mix(geode_controller *controller, const void *cookie, int32 type, float *values) {
|
||||||
ac97_source_info *info = (ac97_source_info *)cookie;
|
ac97_source_info *info = (ac97_source_info *)cookie;
|
||||||
uint16 value, mask;
|
uint16 value, mask;
|
||||||
float gain;
|
float gain;
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case B_MIX_GAIN:
|
case B_MIX_GAIN:
|
||||||
value = ac97_reg_cached_read(controller->ac97, info->reg);
|
value = ac97_reg_cached_read(controller->ac97, info->reg);
|
||||||
if (info->type & B_MIX_STEREO) {
|
if (info->type & B_MIX_STEREO) {
|
||||||
mask = ((1 << (info->bits + 1)) - 1) << 8;
|
mask = ((1 << (info->bits + 1)) - 1) << 8;
|
||||||
value &= ~mask;
|
value &= ~mask;
|
||||||
|
|
||||||
if (info->polarity == 1)
|
if (info->polarity == 1)
|
||||||
gain = info->max_gain - values[0];
|
gain = info->max_gain - values[0];
|
||||||
else
|
else
|
||||||
gain = values[0] - info->min_gain;
|
gain = values[0] - info->min_gain;
|
||||||
value |= ((uint16)(gain / info->granularity) << 8) & mask;
|
value |= ((uint16)(gain / info->granularity) << 8) & mask;
|
||||||
|
|
||||||
mask = ((1 << (info->bits + 1)) - 1);
|
mask = ((1 << (info->bits + 1)) - 1);
|
||||||
value &= ~mask;
|
value &= ~mask;
|
||||||
if (info->polarity == 1)
|
if (info->polarity == 1)
|
||||||
@@ -316,7 +316,7 @@ geode_ac97_set_mix(geode_controller *controller, const void *cookie, int32 type,
|
|||||||
|
|
||||||
|
|
||||||
static int32
|
static int32
|
||||||
create_group_control(geode_multi *multi, uint32 *index, uint32 parent,
|
create_group_control(geode_multi *multi, uint32 *index, uint32 parent,
|
||||||
strind_id string, const char* name) {
|
strind_id string, const char* name) {
|
||||||
int32 i = *index;
|
int32 i = *index;
|
||||||
(*index)++;
|
(*index)++;
|
||||||
@@ -327,7 +327,7 @@ create_group_control(geode_multi *multi, uint32 *index, uint32 parent,
|
|||||||
multi->controls[i].mix_control.string = string;
|
multi->controls[i].mix_control.string = string;
|
||||||
if (name)
|
if (name)
|
||||||
strcpy(multi->controls[i].mix_control.name, name);
|
strcpy(multi->controls[i].mix_control.name, name);
|
||||||
|
|
||||||
return multi->controls[i].mix_control.id;
|
return multi->controls[i].mix_control.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,17 +339,17 @@ create_controls_list(geode_multi *multi)
|
|||||||
const ac97_source_info *info;
|
const ac97_source_info *info;
|
||||||
|
|
||||||
/* AC97 Mixer */
|
/* AC97 Mixer */
|
||||||
parent = create_group_control(multi, &index, 0, S_null, "AC97 Mixer");
|
parent = create_group_control(multi, &index, 0, S_null, "AC97 mixer");
|
||||||
|
|
||||||
count = source_info_size;
|
count = source_info_size;
|
||||||
//Note that we ignore first item in source_info
|
//Note that we ignore first item in source_info
|
||||||
//It's for recording, but do match this with ac97.c's source_info
|
//It's for recording, but do match this with ac97.c's source_info
|
||||||
for (i = 1; i < count ; i++) {
|
for (i = 1; i < count ; i++) {
|
||||||
info = &source_info[i];
|
info = &source_info[i];
|
||||||
TRACE("name : %s\n", info->name);
|
TRACE("name : %s\n", info->name);
|
||||||
|
|
||||||
parent2 = create_group_control(multi, &index, parent, S_null, info->name);
|
parent2 = create_group_control(multi, &index, parent, S_null, info->name);
|
||||||
|
|
||||||
if (info->type & B_MIX_GAIN) {
|
if (info->type & B_MIX_GAIN) {
|
||||||
if (info->type & B_MIX_MUTE) {
|
if (info->type & B_MIX_MUTE) {
|
||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
@@ -363,7 +363,7 @@ create_controls_list(geode_multi *multi)
|
|||||||
multi->controls[index].set = &geode_ac97_set_mix;
|
multi->controls[index].set = &geode_ac97_set_mix;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
||||||
multi->controls[index].mix_control.master = MULTI_CONTROL_MASTERID;
|
multi->controls[index].mix_control.master = MULTI_CONTROL_MASTERID;
|
||||||
@@ -378,7 +378,7 @@ create_controls_list(geode_multi *multi)
|
|||||||
multi->controls[index].set = &geode_ac97_set_mix;
|
multi->controls[index].set = &geode_ac97_set_mix;
|
||||||
id = multi->controls[index].mix_control.id;
|
id = multi->controls[index].mix_control.id;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
if (info->type & B_MIX_STEREO) {
|
if (info->type & B_MIX_STEREO) {
|
||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
||||||
@@ -394,7 +394,7 @@ create_controls_list(geode_multi *multi)
|
|||||||
multi->controls[index].set = &geode_ac97_set_mix;
|
multi->controls[index].set = &geode_ac97_set_mix;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->type & B_MIX_MICBOOST) {
|
if (info->type & B_MIX_MICBOOST) {
|
||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_ENABLE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_ENABLE;
|
||||||
@@ -412,12 +412,12 @@ create_controls_list(geode_multi *multi)
|
|||||||
|
|
||||||
/* AC97 Record */
|
/* AC97 Record */
|
||||||
parent = create_group_control(multi, &index, 0, S_null, "Recording");
|
parent = create_group_control(multi, &index, 0, S_null, "Recording");
|
||||||
|
|
||||||
info = &source_info[0];
|
info = &source_info[0];
|
||||||
TRACE("name : %s\n", info->name);
|
TRACE("name : %s\n", info->name);
|
||||||
|
|
||||||
parent2 = create_group_control(multi, &index, parent, S_null, info->name);
|
parent2 = create_group_control(multi, &index, parent, S_null, info->name);
|
||||||
|
|
||||||
if (info->type & B_MIX_GAIN) {
|
if (info->type & B_MIX_GAIN) {
|
||||||
if (info->type & B_MIX_MUTE) {
|
if (info->type & B_MIX_MUTE) {
|
||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
@@ -431,7 +431,7 @@ create_controls_list(geode_multi *multi)
|
|||||||
multi->controls[index].set = &geode_ac97_set_mix;
|
multi->controls[index].set = &geode_ac97_set_mix;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
||||||
multi->controls[index].mix_control.master = MULTI_CONTROL_MASTERID;
|
multi->controls[index].mix_control.master = MULTI_CONTROL_MASTERID;
|
||||||
@@ -446,7 +446,7 @@ create_controls_list(geode_multi *multi)
|
|||||||
multi->controls[index].set = &geode_ac97_set_mix;
|
multi->controls[index].set = &geode_ac97_set_mix;
|
||||||
id = multi->controls[index].mix_control.id;
|
id = multi->controls[index].mix_control.id;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
if (info->type & B_MIX_STEREO) {
|
if (info->type & B_MIX_STEREO) {
|
||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_GAIN;
|
||||||
@@ -462,19 +462,19 @@ create_controls_list(geode_multi *multi)
|
|||||||
multi->controls[index].set = &geode_ac97_set_mix;
|
multi->controls[index].set = &geode_ac97_set_mix;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->type & B_MIX_RECORDMUX) {
|
if (info->type & B_MIX_RECORDMUX) {
|
||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX;
|
||||||
multi->controls[index].mix_control.parent = parent2;
|
multi->controls[index].mix_control.parent = parent2;
|
||||||
strcpy(multi->controls[index].mix_control.name, "Record Mux");
|
strcpy(multi->controls[index].mix_control.name, "Record mux");
|
||||||
multi->controls[index].cookie = info;
|
multi->controls[index].cookie = info;
|
||||||
multi->controls[index].type = B_MIX_MUX;
|
multi->controls[index].type = B_MIX_MUX;
|
||||||
multi->controls[index].get = &geode_ac97_get_mix;
|
multi->controls[index].get = &geode_ac97_get_mix;
|
||||||
multi->controls[index].set = &geode_ac97_set_mix;
|
multi->controls[index].set = &geode_ac97_set_mix;
|
||||||
parent3 = multi->controls[index].mix_control.id;
|
parent3 = multi->controls[index].mix_control.id;
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
@@ -483,22 +483,22 @@ create_controls_list(geode_multi *multi)
|
|||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
strcpy(multi->controls[index].mix_control.name, "CD In");
|
strcpy(multi->controls[index].mix_control.name, "CD in");
|
||||||
index++;
|
index++;
|
||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
strcpy(multi->controls[index].mix_control.name, "Video In");
|
strcpy(multi->controls[index].mix_control.name, "Video in");
|
||||||
index++;
|
index++;
|
||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
strcpy(multi->controls[index].mix_control.name, "Aux In");
|
strcpy(multi->controls[index].mix_control.name, "Aux in");
|
||||||
index++;
|
index++;
|
||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
multi->controls[index].mix_control.parent = parent3;
|
multi->controls[index].mix_control.parent = parent3;
|
||||||
strcpy(multi->controls[index].mix_control.name, "Line In");
|
strcpy(multi->controls[index].mix_control.name, "Line in");
|
||||||
index++;
|
index++;
|
||||||
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
multi->controls[index].mix_control.id = MULTI_CONTROL_FIRSTID + index;
|
||||||
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
multi->controls[index].mix_control.flags = B_MULTI_MIX_MUX_VALUE;
|
||||||
@@ -516,8 +516,8 @@ create_controls_list(geode_multi *multi)
|
|||||||
strcpy(multi->controls[index].mix_control.name, "TAD");
|
strcpy(multi->controls[index].mix_control.name, "TAD");
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
multi->control_count = index;
|
multi->control_count = index;
|
||||||
TRACE("multi->control_count %lu\n", multi->control_count);
|
TRACE("multi->control_count %lu\n", multi->control_count);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -530,14 +530,14 @@ list_mix_controls(geode_controller* controller, multi_mix_control_info* mmci)
|
|||||||
multi_mix_control* mmc = mmci->controls;
|
multi_mix_control* mmc = mmci->controls;
|
||||||
if (mmci->control_count < 24)
|
if (mmci->control_count < 24)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
if (create_controls_list(controller->multi) < B_OK)
|
if (create_controls_list(controller->multi) < B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
for (uint32 i = 0; i < controller->multi->control_count; i++) {
|
for (uint32 i = 0; i < controller->multi->control_count; i++) {
|
||||||
mmc[i] = controller->multi->controls[i].mix_control;
|
mmc[i] = controller->multi->controls[i].mix_control;
|
||||||
}
|
}
|
||||||
|
|
||||||
mmci->control_count = controller->multi->control_count;
|
mmci->control_count = controller->multi->control_count;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -558,7 +558,7 @@ list_mix_channels(geode_controller* controller, multi_mix_channel_info *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
get_mix(geode_controller *controller, multi_mix_value_info * mmvi)
|
get_mix(geode_controller *controller, multi_mix_value_info * mmvi)
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < mmvi->item_count; i++) {
|
for (int32 i = 0; i < mmvi->item_count; i++) {
|
||||||
@@ -568,7 +568,7 @@ get_mix(geode_controller *controller, multi_mix_value_info * mmvi)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
multi_mixer_control *control = &controller->multi->controls[id];
|
multi_mixer_control *control = &controller->multi->controls[id];
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||||
if (control->get) {
|
if (control->get) {
|
||||||
float values[2];
|
float values[2];
|
||||||
@@ -577,15 +577,15 @@ get_mix(geode_controller *controller, multi_mix_value_info * mmvi)
|
|||||||
mmvi->values[i].gain = values[0];
|
mmvi->values[i].gain = values[0];
|
||||||
else
|
else
|
||||||
mmvi->values[i].gain = values[1];
|
mmvi->values[i].gain = values[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(controller, control->cookie, control->type, values);
|
control->get(controller, control->cookie, control->type, values);
|
||||||
mmvi->values[i].enable = (values[0] == 1.0);
|
mmvi->values[i].enable = (values[0] == 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(controller, control->cookie, control->type, values);
|
control->get(controller, control->cookie, control->type, values);
|
||||||
@@ -596,7 +596,7 @@ get_mix(geode_controller *controller, multi_mix_value_info * mmvi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
set_mix(geode_controller *controller, multi_mix_value_info * mmvi)
|
set_mix(geode_controller *controller, multi_mix_value_info * mmvi)
|
||||||
{
|
{
|
||||||
geode_multi *multi = controller->multi;
|
geode_multi *multi = controller->multi;
|
||||||
@@ -607,7 +607,7 @@ set_mix(geode_controller *controller, multi_mix_value_info * mmvi)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
multi_mixer_control *control = &multi->controls[id];
|
multi_mixer_control *control = &multi->controls[id];
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||||
multi_mixer_control *control2 = NULL;
|
multi_mixer_control *control2 = NULL;
|
||||||
if (i+1<mmvi->item_count) {
|
if (i+1<mmvi->item_count) {
|
||||||
@@ -630,27 +630,27 @@ set_mix(geode_controller *controller, multi_mix_value_info * mmvi)
|
|||||||
values[0] = mmvi->values[i].gain;
|
values[0] = mmvi->values[i].gain;
|
||||||
else
|
else
|
||||||
values[1] = mmvi->values[i].gain;
|
values[1] = mmvi->values[i].gain;
|
||||||
|
|
||||||
if (control2 && control2->mix_control.master != MULTI_CONTROL_MASTERID)
|
if (control2 && control2->mix_control.master != MULTI_CONTROL_MASTERID)
|
||||||
values[1] = mmvi->values[i+1].gain;
|
values[1] = mmvi->values[i+1].gain;
|
||||||
|
|
||||||
control->set(controller, control->cookie, control->type, values);
|
control->set(controller, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control2)
|
if (control2)
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
||||||
float values[1];
|
float values[1];
|
||||||
|
|
||||||
values[0] = mmvi->values[i].enable ? 1.0 : 0.0;
|
values[0] = mmvi->values[i].enable ? 1.0 : 0.0;
|
||||||
control->set(controller, control->cookie, control->type, values);
|
control->set(controller, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||||
float values[1];
|
float values[1];
|
||||||
|
|
||||||
values[0] = (float)mmvi->values[i].mux;
|
values[0] = (float)mmvi->values[i].mux;
|
||||||
control->set(controller, control->cookie, control->type, values);
|
control->set(controller, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
@@ -673,7 +673,7 @@ get_buffers(geode_controller* controller, multi_buffer_list* data)
|
|||||||
|
|
||||||
data->return_playback_buffers = data->request_playback_buffers;
|
data->return_playback_buffers = data->request_playback_buffers;
|
||||||
data->return_playback_channels = data->request_playback_channels;
|
data->return_playback_channels = data->request_playback_channels;
|
||||||
data->return_playback_buffer_size = data->request_playback_buffer_size;
|
data->return_playback_buffer_size = data->request_playback_buffer_size;
|
||||||
data->return_record_buffers = data->request_record_buffers;
|
data->return_record_buffers = data->request_record_buffers;
|
||||||
data->return_record_channels = data->request_record_channels;
|
data->return_record_channels = data->request_record_channels;
|
||||||
data->return_record_buffer_size = data->request_record_buffer_size;
|
data->return_record_buffer_size = data->request_record_buffer_size;
|
||||||
@@ -776,7 +776,7 @@ buffer_exchange(geode_controller* controller, multi_buffer_info* data)
|
|||||||
cpu_status status;
|
cpu_status status;
|
||||||
status_t err;
|
status_t err;
|
||||||
multi_buffer_info buffer_info;
|
multi_buffer_info buffer_info;
|
||||||
|
|
||||||
if (controller->playback_stream == NULL)
|
if (controller->playback_stream == NULL)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
@@ -828,7 +828,7 @@ buffer_exchange(geode_controller* controller, multi_buffer_info* data)
|
|||||||
#else
|
#else
|
||||||
memcpy(data, &buffer_info, sizeof(buffer_info));
|
memcpy(data, &buffer_info, sizeof(buffer_info));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
debug_buffers_exchanged++;
|
debug_buffers_exchanged++;
|
||||||
if (((debug_buffers_exchanged % 100) == 1) && (debug_buffers_exchanged < 1111)) {
|
if (((debug_buffers_exchanged % 100) == 1) && (debug_buffers_exchanged < 1111)) {
|
||||||
dprintf("%s: %d buffers processed\n", __func__, debug_buffers_exchanged);
|
dprintf("%s: %d buffers processed\n", __func__, debug_buffers_exchanged);
|
||||||
@@ -846,8 +846,8 @@ buffer_force_stop(geode_controller* controller)
|
|||||||
}
|
}
|
||||||
if (controller->record_stream != NULL) {
|
if (controller->record_stream != NULL) {
|
||||||
geode_stream_stop(controller->record_stream);
|
geode_stream_stop(controller->record_stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -910,7 +910,7 @@ multi_audio_control(geode_controller* controller, uint32 op, void* arg, size_t l
|
|||||||
return get_mix(controller, (multi_mix_value_info *)arg);
|
return get_mix(controller, (multi_mix_value_info *)arg);
|
||||||
case B_MULTI_SET_MIX:
|
case B_MULTI_SET_MIX:
|
||||||
return set_mix(controller, (multi_mix_value_info *)arg);
|
return set_mix(controller, (multi_mix_value_info *)arg);
|
||||||
|
|
||||||
case B_MULTI_GET_BUFFERS:
|
case B_MULTI_GET_BUFFERS:
|
||||||
return get_buffers(controller, (multi_buffer_list*)arg);
|
return get_buffers(controller, (multi_buffer_list*)arg);
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Please read the readme file first!
|
|||||||
It contains recovery instructions, which you will need if your computer crashes, freezes or fails to start.
|
It contains recovery instructions, which you will need if your computer crashes, freezes or fails to start.
|
||||||
|
|
||||||
|
|
||||||
Do you really want to install the ICH AC97 driver now?" "No" "Yes"`
|
Do you really want to install the ICH AC97 driver now?" "No" "Yes"`
|
||||||
|
|
||||||
|
|
||||||
if [ $answer == "No" ]
|
if [ $answer == "No" ]
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ pci_id_table_t ichaudio_id_table[] = {
|
|||||||
{ 0x1022, 0x7445, -1, -1, -1, -1, -1, "AMD AMD768 AC97 audio" },
|
{ 0x1022, 0x7445, -1, -1, -1, -1, -1, "AMD AMD768 AC97 audio" },
|
||||||
{ 0x1103, 0x0004, -1, -1, -1, -1, -1, "Highpoint HPT372 RAID" },
|
{ 0x1103, 0x0004, -1, -1, -1, -1, -1, "Highpoint HPT372 RAID" },
|
||||||
{ 0x1095, 0x3112, -1, -1, -1, -1, -1, "Silicon Image SATA Si3112" },
|
{ 0x1095, 0x3112, -1, -1, -1, -1, -1, "Silicon Image SATA Si3112" },
|
||||||
{ 0x8086, 0x244b, -1, -1, -1, -1, -1, "Intel IDE Controller" },
|
{ 0x8086, 0x244b, -1, -1, -1, -1, -1, "Intel IDE controller" },
|
||||||
{ 0x8979, 0x6456, -1, -1, -1, -1, -1, "does not exist" },
|
{ 0x8979, 0x6456, -1, -1, -1, -1, -1, "does not exist" },
|
||||||
{ /* empty = end */}
|
{ /* empty = end */}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -43,11 +43,11 @@ typedef struct {
|
|||||||
} mux_info;
|
} mux_info;
|
||||||
|
|
||||||
const mux_info the_muxes[] = {
|
const mux_info the_muxes[] = {
|
||||||
{ 0, 1, 1, 7, 5, 0xe0, "Sampling Input" },
|
{ 0, 1, 1, 7, 5, 0xe0, "Sampling input" },
|
||||||
{ 0, -1, 0, 1, 4, 0x10, "Mic +20dB Selection" },
|
{ 0, -1, 0, 1, 4, 0x10, "Mic +20dB selection" },
|
||||||
{ 0x2a, -1, 0, 1, 0, 0x01, "MIDI Output To Synth" },
|
{ 0x2a, -1, 0, 1, 0, 0x01, "MIDI output to synth" },
|
||||||
{ 0x2a, -1, 0, 1, 1, 0x02, "MIDI Input To Synth" },
|
{ 0x2a, -1, 0, 1, 1, 0x02, "MIDI input to synth" },
|
||||||
{ 0x2a, -1, 0, 1, 2, 0x04, "MIDI Output To Port" },
|
{ 0x2a, -1, 0, 1, 2, 0x04, "MIDI output to port" },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uchar unmap_input[] = {
|
static const uchar unmap_input[] = {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
const char * stereo_enhancement_technique[] =
|
const char * stereo_enhancement_technique[] =
|
||||||
{
|
{
|
||||||
"No 3D Stereo Enhancement",
|
"No 3D stereo enhancement",
|
||||||
"Analog Devices",
|
"Analog Devices",
|
||||||
"Creative Technology",
|
"Creative Technology",
|
||||||
"National Semiconductor",
|
"National Semiconductor",
|
||||||
@@ -278,13 +278,13 @@ const ac97_source_info source_info[] = {
|
|||||||
{ "Record", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO|B_MIX_RECORDMUX, 100, AC97_RECORD_GAIN, 0x8000, 4, 0, 1, 0, 0.0, 22.5, 1.5 },
|
{ "Record", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO|B_MIX_RECORDMUX, 100, AC97_RECORD_GAIN, 0x8000, 4, 0, 1, 0, 0.0, 22.5, 1.5 },
|
||||||
{ "Master", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 101, AC97_MASTER_VOLUME, 0x8000, 5, 0, 1, 1,-46.5, 0.0, 1.5 },
|
{ "Master", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 101, AC97_MASTER_VOLUME, 0x8000, 5, 0, 1, 1,-46.5, 0.0, 1.5 },
|
||||||
//{ "Bass/Trebble", B_MIX_GAIN|B_MIX_STEREO, 102, AC97_MASTER_TONE, 0x0f0f, 4, 0, 1, 1,-12.0, 10.5, 1.5 },
|
//{ "Bass/Trebble", B_MIX_GAIN|B_MIX_STEREO, 102, AC97_MASTER_TONE, 0x0f0f, 4, 0, 1, 1,-12.0, 10.5, 1.5 },
|
||||||
//{ "Aux Out", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 103, AC97_AUX_OUT_VOLUME, 0x8000, 5, 0, 1, 1,-46.5, 0.0, 1.5 },
|
//{ "Aux out", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 103, AC97_AUX_OUT_VOLUME, 0x8000, 5, 0, 1, 1,-46.5, 0.0, 1.5 },
|
||||||
{ "PCM Out", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 104, AC97_PCM_OUT_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
{ "PCM out", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 104, AC97_PCM_OUT_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
||||||
{ "CD", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 105, AC97_CD_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
{ "CD", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 105, AC97_CD_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
||||||
{ "Aux In", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 106, AC97_AUX_IN_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
{ "Aux in", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 106, AC97_AUX_IN_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
||||||
{ "TAD", B_MIX_GAIN|B_MIX_MUTE|B_MIX_MONO, 107, AC97_PHONE_VOLUME, 0x8008, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
{ "TAD", B_MIX_GAIN|B_MIX_MUTE|B_MIX_MONO, 107, AC97_PHONE_VOLUME, 0x8008, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
||||||
{ "Mic", B_MIX_GAIN|B_MIX_MUTE|B_MIX_MONO|B_MIX_MICBOOST, 108, AC97_MIC_VOLUME, 0x8008, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
{ "Mic", B_MIX_GAIN|B_MIX_MUTE|B_MIX_MONO|B_MIX_MICBOOST, 108, AC97_MIC_VOLUME, 0x8008, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
||||||
{ "Line In", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 109, AC97_LINE_IN_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
{ "Line in", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 109, AC97_LINE_IN_VOLUME, 0x8808, 5, 0, 1, 1,-34.5, 12.0, 1.5 },
|
||||||
//{ "Center/Lfe", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 111, AC97_CENTER_LFE_VOLUME, 0x8080, 5, 0, 1, 1,-46.5, 0.0, 1.5 },
|
//{ "Center/Lfe", B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 111, AC97_CENTER_LFE_VOLUME, 0x8080, 5, 0, 1, 1,-46.5, 0.0, 1.5 },
|
||||||
{ "Center/Lfe" /* should be "Surround" but no */, B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 110, AC97_SURROUND_VOLUME, 0x8080, 5, 0, 1, 1,-46.5, 0.0, 1.5 }
|
{ "Center/Lfe" /* should be "Surround" but no */, B_MIX_GAIN|B_MIX_MUTE|B_MIX_STEREO, 110, AC97_SURROUND_VOLUME, 0x8080, 5, 0, 1, 1,-46.5, 0.0, 1.5 }
|
||||||
};
|
};
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -55,15 +55,15 @@ static const char* kPortConnector[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const char* kDefaultDevice[] = {
|
static const char* kDefaultDevice[] = {
|
||||||
"Line Out", "Speaker", "HP Out", "CD", "SPDIF out", "Digital Other Out",
|
"Line out", "Speaker", "HP out", "CD", "SPDIF out", "Digital other out",
|
||||||
"Modem Line Side", "Modem Hand Side", "Line In", "AUX", "Mic In",
|
"Modem line side", "Modem hand side", "Line in", "AUX", "Mic in",
|
||||||
"Telephony", "SPDIF In", "Digital Other In", "Reserved", "Other"
|
"Telephony", "SPDIF in", "Digital other in", "Reserved", "Other"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char* kConnectionType[] = {
|
static const char* kConnectionType[] = {
|
||||||
"N/A", "1/8\"", "1/4\"", "ATAPI internal", "RCA", "Optical",
|
"N/A", "1/8\"", "1/4\"", "ATAPI internal", "RCA", "Optical",
|
||||||
"Other Digital", "Other Analog", "Multichannel Analog (DIN)",
|
"Other digital", "Other analog", "Multichannel analog (DIN)",
|
||||||
"XLR/Professional", "RJ-11 (Modem)", "Combination", "-", "-", "-", "Other"
|
"XLR/Professional", "RJ-11 (modem)", "Combination", "-", "-", "-", "Other"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char* kJackColor[] = {
|
static const char* kJackColor[] = {
|
||||||
@@ -77,23 +77,23 @@ get_widget_type_name(hda_widget_type type)
|
|||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case WT_AUDIO_OUTPUT:
|
case WT_AUDIO_OUTPUT:
|
||||||
return "Audio Output";
|
return "Audio output";
|
||||||
case WT_AUDIO_INPUT:
|
case WT_AUDIO_INPUT:
|
||||||
return "Audio Input";
|
return "Audio input";
|
||||||
case WT_AUDIO_MIXER:
|
case WT_AUDIO_MIXER:
|
||||||
return "Audio Mixer";
|
return "Audio mixer";
|
||||||
case WT_AUDIO_SELECTOR:
|
case WT_AUDIO_SELECTOR:
|
||||||
return "Audio Selector";
|
return "Audio selector";
|
||||||
case WT_PIN_COMPLEX:
|
case WT_PIN_COMPLEX:
|
||||||
return "Pin Complex";
|
return "Pin complex";
|
||||||
case WT_POWER:
|
case WT_POWER:
|
||||||
return "Power";
|
return "Power";
|
||||||
case WT_VOLUME_KNOB:
|
case WT_VOLUME_KNOB:
|
||||||
return "Volume Knob";
|
return "Volume knob";
|
||||||
case WT_BEEP_GENERATOR:
|
case WT_BEEP_GENERATOR:
|
||||||
return "Beep Generator";
|
return "Beep generator";
|
||||||
case WT_VENDOR_DEFINED:
|
case WT_VENDOR_DEFINED:
|
||||||
return "Vendor Defined";
|
return "Vendor defined";
|
||||||
default:
|
default:
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
@@ -158,17 +158,17 @@ dump_widget_audio_capabilities(uint32 capabilities)
|
|||||||
uint32 flag;
|
uint32 flag;
|
||||||
const char* name;
|
const char* name;
|
||||||
} kFlags[] = {
|
} kFlags[] = {
|
||||||
{AUDIO_CAP_LEFT_RIGHT_SWAP, "L-R Swap"},
|
{AUDIO_CAP_LEFT_RIGHT_SWAP, "L-R swap"},
|
||||||
{AUDIO_CAP_POWER_CONTROL, "Power"},
|
{AUDIO_CAP_POWER_CONTROL, "Power"},
|
||||||
{AUDIO_CAP_DIGITAL, "Digital"},
|
{AUDIO_CAP_DIGITAL, "Digital"},
|
||||||
{AUDIO_CAP_CONNECTION_LIST, "Conn. List"},
|
{AUDIO_CAP_CONNECTION_LIST, "Conn. list"},
|
||||||
{AUDIO_CAP_UNSOLICITED_RESPONSES, "Unsol. Responses"},
|
{AUDIO_CAP_UNSOLICITED_RESPONSES, "Unsol. responses"},
|
||||||
{AUDIO_CAP_PROCESSING_CONTROLS, "Proc Widget"},
|
{AUDIO_CAP_PROCESSING_CONTROLS, "Proc widget"},
|
||||||
{AUDIO_CAP_STRIPE, "Stripe"},
|
{AUDIO_CAP_STRIPE, "Stripe"},
|
||||||
{AUDIO_CAP_FORMAT_OVERRIDE, "Format Override"},
|
{AUDIO_CAP_FORMAT_OVERRIDE, "Format override"},
|
||||||
{AUDIO_CAP_AMPLIFIER_OVERRIDE, "Amplifier Override"},
|
{AUDIO_CAP_AMPLIFIER_OVERRIDE, "Amplifier override"},
|
||||||
{AUDIO_CAP_OUTPUT_AMPLIFIER, "Out Amplifier"},
|
{AUDIO_CAP_OUTPUT_AMPLIFIER, "Out amplifier"},
|
||||||
{AUDIO_CAP_INPUT_AMPLIFIER, "In Amplifier"},
|
{AUDIO_CAP_INPUT_AMPLIFIER, "In amplifier"},
|
||||||
{AUDIO_CAP_STEREO, "Stereo"},
|
{AUDIO_CAP_STEREO, "Stereo"},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007-2008, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007-2009, Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -224,13 +224,13 @@ hda_find_multi_custom_string(hda_widget& widget, char* custom, uint32 size)
|
|||||||
const char* device = NULL;
|
const char* device = NULL;
|
||||||
switch (CONF_DEFAULT_DEVICE(widget.d.pin.config)) {
|
switch (CONF_DEFAULT_DEVICE(widget.d.pin.config)) {
|
||||||
case PIN_DEV_LINE_IN:
|
case PIN_DEV_LINE_IN:
|
||||||
device = "Line In";
|
device = "Line in";
|
||||||
case PIN_DEV_LINE_OUT:
|
case PIN_DEV_LINE_OUT:
|
||||||
if (device == NULL)
|
if (device == NULL)
|
||||||
device = "Line Out";
|
device = "Line out";
|
||||||
case PIN_DEV_MIC_IN:
|
case PIN_DEV_MIC_IN:
|
||||||
if (device == NULL)
|
if (device == NULL)
|
||||||
device = "Mic In";
|
device = "Mic in";
|
||||||
switch (CONF_DEFAULT_COLOR(widget.d.pin.config)) {
|
switch (CONF_DEFAULT_COLOR(widget.d.pin.config)) {
|
||||||
case 1:
|
case 1:
|
||||||
device = "Rear";
|
device = "Rear";
|
||||||
@@ -239,7 +239,7 @@ hda_find_multi_custom_string(hda_widget& widget, char* custom, uint32 size)
|
|||||||
device = "Side";
|
device = "Side";
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
device = "Line In";
|
device = "Line in";
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
device = "Front";
|
device = "Front";
|
||||||
@@ -248,15 +248,15 @@ hda_find_multi_custom_string(hda_widget& widget, char* custom, uint32 size)
|
|||||||
device = "Center/Sub";
|
device = "Center/Sub";
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
device = "Mic In";
|
device = "Mic in";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PIN_DEV_SPDIF_IN:
|
case PIN_DEV_SPDIF_IN:
|
||||||
device = "SPDIF In";
|
device = "SPDIF in";
|
||||||
break;
|
break;
|
||||||
case PIN_DEV_SPDIF_OUT:
|
case PIN_DEV_SPDIF_OUT:
|
||||||
device = "SPDIF Out";
|
device = "SPDIF out";
|
||||||
break;
|
break;
|
||||||
case PIN_DEV_CD:
|
case PIN_DEV_CD:
|
||||||
device = "CD";
|
device = "CD";
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ ice1712_get_description(ice1712 *card, multi_description *data)
|
|||||||
strncpy(data->friendly_name, "VX 442", 32);
|
strncpy(data->friendly_name, "VX 442", 32);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
strncpy(data->friendly_name, "Unknow Device", 32);
|
strncpy(data->friendly_name, "Unknow device", 32);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007 Haiku Inc. All rights reserved.
|
* Copyright 2007-2009, Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -51,7 +51,7 @@ get_description(void* cookie, multi_description* data)
|
|||||||
data->interface_version = B_CURRENT_INTERFACE_VERSION;
|
data->interface_version = B_CURRENT_INTERFACE_VERSION;
|
||||||
data->interface_minimum = B_CURRENT_INTERFACE_VERSION;
|
data->interface_minimum = B_CURRENT_INTERFACE_VERSION;
|
||||||
|
|
||||||
strcpy(data->friendly_name,"Virtual Audio (null_audio)");
|
strcpy(data->friendly_name,"Virtual audio (null_audio)");
|
||||||
strcpy(data->vendor_info,"Host/Haiku");
|
strcpy(data->vendor_info,"Host/Haiku");
|
||||||
|
|
||||||
data->output_channel_count = 2;
|
data->output_channel_count = 2;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* This file is a part of SiS 7018 BeOS driver project.
|
* This file is a part of SiS 7018 BeOS driver project.
|
||||||
* Copyright (c) 2002-2003 by Siarzuk Zharski <imker@gmx.li>
|
* Copyright (c) 2002-2003 by Siarzuk Zharski <imker@gmx.li>
|
||||||
* Portional Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
|
* Portional Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
|
||||||
*
|
*
|
||||||
* This file may be used under the terms of the BSD License
|
* This file may be used under the terms of the BSD License
|
||||||
* See the file "License" for details.
|
* See the file "License" for details.
|
||||||
*/
|
*/
|
||||||
@@ -69,7 +69,7 @@ static struct ac97_codecid
|
|||||||
};
|
};
|
||||||
|
|
||||||
static char *ac97enhancement[] = {
|
static char *ac97enhancement[] = {
|
||||||
"no 3D Stereo Enhancement",
|
"No 3D Stereo Enhancement",
|
||||||
"Analog Devices Phat Stereo",
|
"Analog Devices Phat Stereo",
|
||||||
"Creative Stereo Enhancement",
|
"Creative Stereo Enhancement",
|
||||||
"National Semi 3D Stereo Enhancement",
|
"National Semi 3D Stereo Enhancement",
|
||||||
@@ -139,7 +139,7 @@ int ac97read(sis7018_dev *dev, int regno)
|
|||||||
int i, j, reg, rw;
|
int i, j, reg, rw;
|
||||||
if(b_trace_ac97)
|
if(b_trace_ac97)
|
||||||
TRACE(" ac97read: regno=%x\n", regno);
|
TRACE(" ac97read: regno=%x\n", regno);
|
||||||
|
|
||||||
switch (dev->type->ids.chip_id){
|
switch (dev->type->ids.chip_id){
|
||||||
case SPA_PCI_ID:
|
case SPA_PCI_ID:
|
||||||
reg=SPA_REG_CODECRD;
|
reg=SPA_REG_CODECRD;
|
||||||
@@ -151,7 +151,7 @@ int ac97read(sis7018_dev *dev, int regno)
|
|||||||
else
|
else
|
||||||
reg=TDX_REG_CODECRD;
|
reg=TDX_REG_CODECRD;
|
||||||
rw=TDX_CDC_RWSTAT;
|
rw=TDX_CDC_RWSTAT;
|
||||||
break;
|
break;
|
||||||
case TDX_PCI_ID:
|
case TDX_PCI_ID:
|
||||||
case xDX_PCI_ID:
|
case xDX_PCI_ID:
|
||||||
reg=TDX_REG_CODECRD;
|
reg=TDX_REG_CODECRD;
|
||||||
@@ -165,7 +165,7 @@ int ac97read(sis7018_dev *dev, int regno)
|
|||||||
TRACE("ac97read defaulted !!!\n");
|
TRACE("ac97read defaulted !!!\n");
|
||||||
return ENODEV;
|
return ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
cp = disable_interrupts();
|
cp = disable_interrupts();
|
||||||
acquire_spinlock(&dev->hardware);
|
acquire_spinlock(&dev->hardware);
|
||||||
|
|
||||||
@@ -183,18 +183,18 @@ int ac97read(sis7018_dev *dev, int regno)
|
|||||||
c2 = hw_read(dev, 0xc8, 4);
|
c2 = hw_read(dev, 0xc8, 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(dev->type->ids.chip_id != ALI_PCI_ID || i > 0){
|
if(dev->type->ids.chip_id != ALI_PCI_ID || i > 0){
|
||||||
hw_write(dev, reg, regno | rw, 4);
|
hw_write(dev, reg, regno | rw, 4);
|
||||||
j=rw;
|
j=rw;
|
||||||
for (i=TR_TIMEOUT_CDC; (i > 0) && (j & rw); i--){
|
for (i=TR_TIMEOUT_CDC; (i > 0) && (j & rw); i--){
|
||||||
j=hw_read(dev, reg, 4);
|
j=hw_read(dev, reg, 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
release_spinlock(&dev->hardware);
|
release_spinlock(&dev->hardware);
|
||||||
restore_interrupts(cp);
|
restore_interrupts(cp);
|
||||||
|
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
TRACE_ALWAYS("ac97 codec timeout during read of register %x\n", regno);
|
TRACE_ALWAYS("ac97 codec timeout during read of register %x\n", regno);
|
||||||
if(b_trace_ac97)
|
if(b_trace_ac97)
|
||||||
@@ -206,10 +206,10 @@ status_t ac97write(sis7018_dev *dev, int regno, uint32 data)
|
|||||||
{
|
{
|
||||||
cpu_status cp;
|
cpu_status cp;
|
||||||
int i, j, reg, rw;
|
int i, j, reg, rw;
|
||||||
|
|
||||||
if(b_trace_ac97)
|
if(b_trace_ac97)
|
||||||
TRACE("\nac97write: regno=%x, data=%lx\n", regno, data);
|
TRACE("\nac97write: regno=%x, data=%lx\n", regno, data);
|
||||||
|
|
||||||
switch (dev->type->ids.chip_id){
|
switch (dev->type->ids.chip_id){
|
||||||
case SPA_PCI_ID:
|
case SPA_PCI_ID:
|
||||||
reg=SPA_REG_CODECWR;
|
reg=SPA_REG_CODECWR;
|
||||||
@@ -229,11 +229,11 @@ status_t ac97write(sis7018_dev *dev, int regno, uint32 data)
|
|||||||
TRACE("ac97write defaulted !!!");
|
TRACE("ac97write defaulted !!!");
|
||||||
return ENODEV;
|
return ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
regno &= 0x7f;
|
regno &= 0x7f;
|
||||||
if(b_trace_ac97)
|
if(b_trace_ac97)
|
||||||
TRACE("ac97write: reg %x was %x\n", regno, ac97read(dev, regno));
|
TRACE("ac97write: reg %x was %x\n", regno, ac97read(dev, regno));
|
||||||
|
|
||||||
cp = disable_interrupts();
|
cp = disable_interrupts();
|
||||||
acquire_spinlock(&dev->hardware);
|
acquire_spinlock(&dev->hardware);
|
||||||
j=rw;
|
j=rw;
|
||||||
@@ -248,7 +248,7 @@ status_t ac97write(sis7018_dev *dev, int regno, uint32 data)
|
|||||||
for (i = TR_TIMEOUT_CDC; (i > 0) && (c1 == c2); i--)
|
for (i = TR_TIMEOUT_CDC; (i > 0) && (c1 == c2); i--)
|
||||||
c2 = hw_read(dev, 0xc8, 4);
|
c2 = hw_read(dev, 0xc8, 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(dev->type->ids.chip_id != ALI_PCI_ID || i > 0){
|
if(dev->type->ids.chip_id != ALI_PCI_ID || i > 0){
|
||||||
for(i=TR_TIMEOUT_CDC; (i>0) && (j & rw); i--){
|
for(i=TR_TIMEOUT_CDC; (i>0) && (j & rw); i--){
|
||||||
j=hw_read(dev, reg, 4);
|
j=hw_read(dev, reg, 4);
|
||||||
@@ -279,7 +279,7 @@ status_t ac97init(sis7018_dev *card)
|
|||||||
/* old manner
|
/* old manner
|
||||||
err |= ac97write(card, AC97_REG_POWER, 0);
|
err |= ac97write(card, AC97_REG_POWER, 0);
|
||||||
err |= ac97write(card, AC97_REG_RESET, 0);
|
err |= ac97write(card, AC97_REG_RESET, 0);
|
||||||
|
|
||||||
err |= ac97write(card, AC97_MIX_PCM, 0x707);
|
err |= ac97write(card, AC97_MIX_PCM, 0x707);
|
||||||
err |= ac97write(card, AC97_MIX_BEEP, 0x06);
|
err |= ac97write(card, AC97_MIX_BEEP, 0x06);
|
||||||
err |= ac97write(card, AC97_MIX_MIC, 0x8000);
|
err |= ac97write(card, AC97_MIX_MIC, 0x8000);
|
||||||
@@ -287,7 +287,7 @@ status_t ac97init(sis7018_dev *card)
|
|||||||
err |= ac97write(card, AC97_MIX_PHONES, 0x707);
|
err |= ac97write(card, AC97_MIX_PHONES, 0x707);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//BSD init manner
|
//BSD init manner
|
||||||
err |= ac97write(card, AC97_REG_POWER, 0x0000);
|
err |= ac97write(card, AC97_REG_POWER, 0x0000);
|
||||||
err |= ac97write(card, AC97_REG_RESET, 0);
|
err |= ac97write(card, AC97_REG_RESET, 0);
|
||||||
snooze(100000);
|
snooze(100000);
|
||||||
@@ -337,15 +337,15 @@ status_t ac97init(sis7018_dev *card)
|
|||||||
TRACE("ac97 codec initializatin error\n");
|
TRACE("ac97 codec initializatin error\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("ac97 codec features:\n");
|
TRACE("ac97 codec features:\n");
|
||||||
|
|
||||||
for (i = 0; i < 10; i++)
|
for (i = 0; i < 10; i++)
|
||||||
if (caps & (1 << i))
|
if (caps & (1 << i))
|
||||||
TRACE("> %s\n", ac97feature[i]);
|
TRACE("> %s\n", ac97feature[i]);
|
||||||
TRACE("> %s\n", ac97enhancement[se]);
|
TRACE("> %s\n", ac97enhancement[se]);
|
||||||
TRACE("\n");
|
TRACE("\n");
|
||||||
|
|
||||||
extcaps = 0;
|
extcaps = 0;
|
||||||
extid = 0;
|
extid = 0;
|
||||||
extstat = 0;
|
extstat = 0;
|
||||||
@@ -364,14 +364,14 @@ status_t ac97init(sis7018_dev *card)
|
|||||||
for (i = 0; i < 14; i++)
|
for (i = 0; i < 14; i++)
|
||||||
if (extcaps & (1 << i))
|
if (extcaps & (1 << i))
|
||||||
TRACE("> %s\n", ac97extfeature[i]);
|
TRACE("> %s\n", ac97extfeature[i]);
|
||||||
TRACE("\n");
|
TRACE("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ac97read(card, AC97_REG_POWER) & 2) == 0)
|
if ((ac97read(card, AC97_REG_POWER) & 2) == 0)
|
||||||
TRACE("ac97 codec reports dac not ready\n");
|
TRACE("ac97 codec reports dac not ready\n");
|
||||||
|
|
||||||
// some addition
|
// some addition
|
||||||
|
|
||||||
reg = ac97read(card, AC97_MIX_MASTER);
|
reg = ac97read(card, AC97_MIX_MASTER);
|
||||||
err |= ac97write(card, AC97_MIX_MASTER, 0x3f3f);
|
err |= ac97write(card, AC97_MIX_MASTER, 0x3f3f);
|
||||||
if(0x3f3f == ac97read(card, AC97_MIX_MASTER)){
|
if(0x3f3f == ac97read(card, AC97_MIX_MASTER)){
|
||||||
@@ -379,7 +379,7 @@ status_t ac97init(sis7018_dev *card)
|
|||||||
card->ac97.wide_main_gain = true;
|
card->ac97.wide_main_gain = true;
|
||||||
}
|
}
|
||||||
err |= ac97write(card, AC97_MIX_MASTER, reg);
|
err |= ac97write(card, AC97_MIX_MASTER, reg);
|
||||||
|
|
||||||
// BSD manner
|
// BSD manner
|
||||||
err |= ac97write(card, AC97_MIX_PCM, 0x707);
|
err |= ac97write(card, AC97_MIX_PCM, 0x707);
|
||||||
// err |= ac97write(card, AC97_MIX_BEEP, 0x06);
|
// err |= ac97write(card, AC97_MIX_BEEP, 0x06);
|
||||||
@@ -398,12 +398,12 @@ status_t ac97get_params(sis7018_dev *dev, sound_setup *sound)
|
|||||||
{
|
{
|
||||||
uint16 reg = 0;
|
uint16 reg = 0;
|
||||||
int main_gain_multiplier = dev->ac97.wide_main_gain ? 1 : 2;
|
int main_gain_multiplier = dev->ac97.wide_main_gain ? 1 : 2;
|
||||||
|
|
||||||
sound->sample_rate = kHz_48_0;
|
sound->sample_rate = kHz_48_0;
|
||||||
sound->dither_enable = false;
|
sound->dither_enable = false;
|
||||||
sound->output_boost = 0;
|
sound->output_boost = 0;
|
||||||
sound->highpass_enable = 0;
|
sound->highpass_enable = 0;
|
||||||
|
|
||||||
reg=ac97read(dev, AC97_MIX_MONO);
|
reg=ac97read(dev, AC97_MIX_MONO);
|
||||||
sound->mono_gain = (char)reg;
|
sound->mono_gain = (char)reg;
|
||||||
sound->mono_mute = (char)(reg & AC97_MUTE) ? 1 : 0;
|
sound->mono_mute = (char)(reg & AC97_MUTE) ? 1 : 0;
|
||||||
@@ -415,7 +415,7 @@ status_t ac97get_params(sis7018_dev *dev, sound_setup *sound)
|
|||||||
case 0: sound->right.adc_source = mic; break;
|
case 0: sound->right.adc_source = mic; break;
|
||||||
default: sound->right.adc_source = loopback; break;
|
default: sound->right.adc_source = loopback; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ((reg >> 8) & 0x07){
|
switch ((reg >> 8) & 0x07){
|
||||||
case 4: sound->left.adc_source = line; break;
|
case 4: sound->left.adc_source = line; break;
|
||||||
case 3: sound->left.adc_source = aux1; break;
|
case 3: sound->left.adc_source = aux1; break;
|
||||||
@@ -426,38 +426,38 @@ status_t ac97get_params(sis7018_dev *dev, sound_setup *sound)
|
|||||||
reg = ac97read(dev, AC97_MIX_MIC);
|
reg = ac97read(dev, AC97_MIX_MIC);
|
||||||
sound->loop_attn = (reg & 0x1f)*2;
|
sound->loop_attn = (reg & 0x1f)*2;
|
||||||
sound->loop_enable = (reg & AC97_MUTE) ? 0 : 1;
|
sound->loop_enable = (reg & AC97_MUTE) ? 0 : 1;
|
||||||
sound->left.mic_gain_enable =
|
sound->left.mic_gain_enable =
|
||||||
sound->right.mic_gain_enable = (reg >> 6) & 0x01;
|
sound->right.mic_gain_enable = (reg >> 6) & 0x01;
|
||||||
|
|
||||||
reg = ac97read(dev, AC97_MIX_RGAIN);
|
reg = ac97read(dev, AC97_MIX_RGAIN);
|
||||||
sound->left.adc_gain = (reg >> 0x8) & 0xf;
|
sound->left.adc_gain = (reg >> 0x8) & 0xf;
|
||||||
sound->right.adc_gain = reg & 0xf;
|
sound->right.adc_gain = reg & 0xf;
|
||||||
|
|
||||||
reg = ac97read(dev, AC97_MIX_CD);
|
reg = ac97read(dev, AC97_MIX_CD);
|
||||||
sound->left.aux1_mix_gain = ((reg >> 8) & 0x1f);
|
sound->left.aux1_mix_gain = ((reg >> 8) & 0x1f);
|
||||||
sound->right.aux1_mix_gain = (reg & 0x1f);
|
sound->right.aux1_mix_gain = (reg & 0x1f);
|
||||||
sound->left.aux1_mix_mute =
|
sound->left.aux1_mix_mute =
|
||||||
sound->right.aux1_mix_mute = (reg & AC97_MUTE) ? 1 : 0;
|
sound->right.aux1_mix_mute = (reg & AC97_MUTE) ? 1 : 0;
|
||||||
|
|
||||||
reg = ac97read(dev, AC97_MIX_AUX);
|
reg = ac97read(dev, AC97_MIX_AUX);
|
||||||
sound->left.aux2_mix_gain = ((reg >> 8) & 0x1f);
|
sound->left.aux2_mix_gain = ((reg >> 8) & 0x1f);
|
||||||
sound->right.aux2_mix_gain = (reg & 0x1f);
|
sound->right.aux2_mix_gain = (reg & 0x1f);
|
||||||
sound->left.aux2_mix_mute =
|
sound->left.aux2_mix_mute =
|
||||||
sound->right.aux2_mix_mute = (reg & AC97_MUTE) ? 1 : 0;
|
sound->right.aux2_mix_mute = (reg & AC97_MUTE) ? 1 : 0;
|
||||||
|
|
||||||
|
|
||||||
reg = ac97read(dev, AC97_MIX_LINE);
|
reg = ac97read(dev, AC97_MIX_LINE);
|
||||||
sound->left.line_mix_gain = ((reg >> 8) & 0x1f);
|
sound->left.line_mix_gain = ((reg >> 8) & 0x1f);
|
||||||
sound->right.line_mix_gain = (reg & 0x1f);
|
sound->right.line_mix_gain = (reg & 0x1f);
|
||||||
sound->left.line_mix_mute =
|
sound->left.line_mix_mute =
|
||||||
sound->right.line_mix_mute = (reg & AC97_MUTE) ? 1 : 0;
|
sound->right.line_mix_mute = (reg & AC97_MUTE) ? 1 : 0;
|
||||||
|
|
||||||
reg = ac97read(dev, AC97_MIX_MASTER);
|
reg = ac97read(dev, AC97_MIX_MASTER);
|
||||||
sound->left.dac_attn = ((reg >> 8) & 0x1f) * main_gain_multiplier;
|
sound->left.dac_attn = ((reg >> 8) & 0x1f) * main_gain_multiplier;
|
||||||
sound->right.dac_attn = (reg & 0x1f) * main_gain_multiplier;
|
sound->right.dac_attn = (reg & 0x1f) * main_gain_multiplier;
|
||||||
sound->left.dac_mute =
|
sound->left.dac_mute =
|
||||||
sound->right.dac_mute = (reg & AC97_MUTE) ? 1 : 0;
|
sound->right.dac_mute = (reg & AC97_MUTE) ? 1 : 0;
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -498,30 +498,30 @@ status_t ac97set_params(sis7018_dev *dev, sound_setup * sound)
|
|||||||
sound->output_boost = 0;
|
sound->output_boost = 0;
|
||||||
sound->highpass_enable = 0;
|
sound->highpass_enable = 0;
|
||||||
|
|
||||||
reg = sound->mono_gain | ((sound->mono_mute) ? AC97_MUTE : 0);
|
reg = sound->mono_gain | ((sound->mono_mute) ? AC97_MUTE : 0);
|
||||||
err |= ac97write(dev, AC97_MIX_MONO, reg);
|
err |= ac97write(dev, AC97_MIX_MONO, reg);
|
||||||
|
|
||||||
reg = sound->loop_attn / 2;
|
reg = sound->loop_attn / 2;
|
||||||
reg |= ((sound->left.mic_gain_enable || sound->right.mic_gain_enable) ? 0x01 : 0x00) << 6;
|
reg |= ((sound->left.mic_gain_enable || sound->right.mic_gain_enable) ? 0x01 : 0x00) << 6;
|
||||||
reg |= (sound->loop_enable) ? 0 : AC97_MUTE;
|
reg |= (sound->loop_enable) ? 0 : AC97_MUTE;
|
||||||
err |= ac97write(dev, AC97_MIX_MIC, reg);
|
err |= ac97write(dev, AC97_MIX_MIC, reg);
|
||||||
|
|
||||||
reg = 0;
|
reg = 0;
|
||||||
switch(sound->left.adc_source){
|
switch(sound->left.adc_source){
|
||||||
case line: reg = 4; break;
|
case line: reg = 4; break;
|
||||||
case aux1: reg = 3; break;
|
case aux1: reg = 3; break;
|
||||||
case mic: reg = 0; break;
|
case mic: reg = 0; break;
|
||||||
default: reg = 0; break;
|
default: reg = 0; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
reg <<= 8;
|
reg <<= 8;
|
||||||
switch(sound->right.adc_source){
|
switch(sound->right.adc_source){
|
||||||
case line: reg |= 4; break;
|
case line: reg |= 4; break;
|
||||||
case aux1: reg |= 3; break;
|
case aux1: reg |= 3; break;
|
||||||
case mic: reg |= 0; break;
|
case mic: reg |= 0; break;
|
||||||
default: reg |= 0; break;
|
default: reg |= 0; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
err |= ac97write(dev, AC97_REG_RECSEL, reg);
|
err |= ac97write(dev, AC97_REG_RECSEL, reg);
|
||||||
|
|
||||||
reg = (sound->left.adc_gain) << 8;
|
reg = (sound->left.adc_gain) << 8;
|
||||||
@@ -530,25 +530,25 @@ status_t ac97set_params(sis7018_dev *dev, sound_setup * sound)
|
|||||||
|
|
||||||
reg = (sound->left.aux1_mix_gain) << 0x08;
|
reg = (sound->left.aux1_mix_gain) << 0x08;
|
||||||
reg |= sound->right.aux1_mix_gain;
|
reg |= sound->right.aux1_mix_gain;
|
||||||
reg |= (sound->left.aux1_mix_mute || sound->right.aux1_mix_mute) ? AC97_MUTE : 0 ;
|
reg |= (sound->left.aux1_mix_mute || sound->right.aux1_mix_mute) ? AC97_MUTE : 0 ;
|
||||||
err |= ac97write(dev, AC97_MIX_CD, reg);
|
err |= ac97write(dev, AC97_MIX_CD, reg);
|
||||||
|
|
||||||
reg = (sound->left.aux2_mix_gain) << 0x08;
|
reg = (sound->left.aux2_mix_gain) << 0x08;
|
||||||
reg |= sound->right.aux2_mix_gain;
|
reg |= sound->right.aux2_mix_gain;
|
||||||
reg |= (sound->left.aux2_mix_mute || sound->right.aux2_mix_mute) ? AC97_MUTE : 0 ;
|
reg |= (sound->left.aux2_mix_mute || sound->right.aux2_mix_mute) ? AC97_MUTE : 0 ;
|
||||||
err |= ac97write(dev, AC97_MIX_AUX, reg);
|
err |= ac97write(dev, AC97_MIX_AUX, reg);
|
||||||
|
|
||||||
reg = (sound->left.line_mix_gain) << 0x08;
|
reg = (sound->left.line_mix_gain) << 0x08;
|
||||||
reg |= sound->right.line_mix_gain;
|
reg |= sound->right.line_mix_gain;
|
||||||
reg |= (sound->left.line_mix_mute || sound->right.line_mix_mute) ? AC97_MUTE : 0 ;
|
reg |= (sound->left.line_mix_mute || sound->right.line_mix_mute) ? AC97_MUTE : 0 ;
|
||||||
err |= ac97write(dev, AC97_MIX_LINE, reg);
|
err |= ac97write(dev, AC97_MIX_LINE, reg);
|
||||||
|
|
||||||
reg = ((sound->left.dac_attn) / main_gain_divider) << 0x08;
|
reg = ((sound->left.dac_attn) / main_gain_divider) << 0x08;
|
||||||
reg |= (sound->right.dac_attn) / main_gain_divider;
|
reg |= (sound->right.dac_attn) / main_gain_divider;
|
||||||
reg |= (sound->left.dac_mute || sound->right.dac_mute) ? AC97_MUTE : 0 ;
|
reg |= (sound->left.dac_mute || sound->right.dac_mute) ? AC97_MUTE : 0 ;
|
||||||
err |= ac97write(dev, AC97_MIX_MASTER, reg);
|
err |= ac97write(dev, AC97_MIX_MASTER, reg);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t ac97init_default(sis7018_dev *dev, bool bOn)
|
status_t ac97init_default(sis7018_dev *dev, bool bOn)
|
||||||
@@ -578,20 +578,20 @@ status_t ac97init_CS4299(sis7018_dev *dev, bool bOn)
|
|||||||
static struct
|
static struct
|
||||||
{
|
{
|
||||||
int16 reg;
|
int16 reg;
|
||||||
char name[DEVNAME];
|
char name[DEVNAME];
|
||||||
} ac97_regs[]=
|
} ac97_regs[]=
|
||||||
{
|
{
|
||||||
{AC97_REG_RESET, "Reset"}, {AC97_MIX_MASTER, "Master Volume"},
|
{AC97_REG_RESET, "Reset"}, {AC97_MIX_MASTER, "Master volume"},
|
||||||
{AC97_MIX_PHONES, "AUX Out volume"}, {AC97_MIX_MONO, "Mono Volume"},
|
{AC97_MIX_PHONES, "AUX out volume"}, {AC97_MIX_MONO, "Mono volume"},
|
||||||
{AC97_MIX_TONE, "Master Tone"}, {AC97_MIX_BEEP, "PC Beep"},
|
{AC97_MIX_TONE, "Master tone"}, {AC97_MIX_BEEP, "PC beep"},
|
||||||
{AC97_MIX_PHONE, "Phone volume"}, {AC97_MIX_MIC, "Mio Volume"},
|
{AC97_MIX_PHONE, "Phone volume"}, {AC97_MIX_MIC, "Mic volume"},
|
||||||
{AC97_MIX_LINE, "Line In Volume"}, {AC97_MIX_CD, "CD Volume"},
|
{AC97_MIX_LINE, "Line in volume"}, {AC97_MIX_CD, "CD volume"},
|
||||||
{AC97_MIX_VIDEO, "Video Volume"}, {AC97_MIX_AUX, "AUX In Volume"},
|
{AC97_MIX_VIDEO, "Video volume"}, {AC97_MIX_AUX, "AUX in volume"},
|
||||||
{AC97_MIX_PCM, "PCM Out Volume"}, {AC97_REG_RECSEL, "Record Select"},
|
{AC97_MIX_PCM, "PCM out volume"}, {AC97_REG_RECSEL, "Record select"},
|
||||||
{AC97_MIX_RGAIN, "Record Gain"}, {AC97_MIX_MGAIN, "Record Gain Mio"},
|
{AC97_MIX_RGAIN, "Record gain"}, {AC97_MIX_MGAIN, "Record gain Mic"},
|
||||||
{AC97_REG_GEN, "General Purpose"}, {AC97_REG_3D, "3D Control"},
|
{AC97_REG_GEN, "General purpose"}, {AC97_REG_3D, "3D control"},
|
||||||
{0x24, "Audio Int & Paging"}, {AC97_REG_POWER, "Powerdown Ctrl/Stat"},
|
{0x24, "Audio int & paging"}, {AC97_REG_POWER, "Powerdown ctrl/stat"},
|
||||||
{AC97_REG_ID1, "Vendor ID1"}, {AC97_REG_ID2, "VendorID 2"},
|
{AC97_REG_ID1, "VendorID 1"}, {AC97_REG_ID2, "VendorID 2"},
|
||||||
};
|
};
|
||||||
|
|
||||||
void ac97dump(int card_id)
|
void ac97dump(int card_id)
|
||||||
|
|||||||
@@ -1685,11 +1685,11 @@ AudioMixer::UpdateParameterWeb()
|
|||||||
MixerOutput *out;
|
MixerOutput *out;
|
||||||
char buf[50];
|
char buf[50];
|
||||||
|
|
||||||
top = web->MakeGroup("Gain Controls");
|
top = web->MakeGroup("Gain controls");
|
||||||
|
|
||||||
out = fCore->Output();
|
out = fCore->Output();
|
||||||
group = top->MakeGroup("");
|
group = top->MakeGroup("");
|
||||||
group->MakeNullParameter(PARAM_STR1(0), B_MEDIA_RAW_AUDIO, "Master Output", B_WEB_BUFFER_INPUT);
|
group->MakeNullParameter(PARAM_STR1(0), B_MEDIA_RAW_AUDIO, "Master output", B_WEB_BUFFER_INPUT);
|
||||||
if (!out) {
|
if (!out) {
|
||||||
group->MakeNullParameter(PARAM_STR2(0), B_MEDIA_RAW_AUDIO, "not connected", B_GENERIC);
|
group->MakeNullParameter(PARAM_STR2(0), B_MEDIA_RAW_AUDIO, "not connected", B_GENERIC);
|
||||||
} else {
|
} else {
|
||||||
@@ -1704,7 +1704,7 @@ AudioMixer::UpdateParameterWeb()
|
|||||||
group->MakeContinuousParameter(PARAM_GAIN(0), B_MEDIA_RAW_AUDIO, "Gain", B_MASTER_GAIN, "dB", DB_MIN, DB_MAX, 0.1)
|
group->MakeContinuousParameter(PARAM_GAIN(0), B_MEDIA_RAW_AUDIO, "Gain", B_MASTER_GAIN, "dB", DB_MIN, DB_MAX, 0.1)
|
||||||
->SetChannelCount(out->GetOutputChannelCount());
|
->SetChannelCount(out->GetOutputChannelCount());
|
||||||
}
|
}
|
||||||
group->MakeNullParameter(PARAM_STR3(0), B_MEDIA_RAW_AUDIO, "To Output", B_WEB_BUFFER_OUTPUT);
|
group->MakeNullParameter(PARAM_STR3(0), B_MEDIA_RAW_AUDIO, "To output", B_WEB_BUFFER_OUTPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; (in = fCore->Input(i)); i++) {
|
for (int i = 0; (in = fCore->Input(i)); i++) {
|
||||||
@@ -1737,16 +1737,16 @@ AudioMixer::UpdateParameterWeb()
|
|||||||
->SetChannelCount(in->GetMixerChannelCount());
|
->SetChannelCount(in->GetMixerChannelCount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
group->MakeNullParameter(PARAM_STR3(in->ID()), B_MEDIA_RAW_AUDIO, "To Master", B_WEB_BUFFER_OUTPUT);
|
group->MakeNullParameter(PARAM_STR3(in->ID()), B_MEDIA_RAW_AUDIO, "To master", B_WEB_BUFFER_OUTPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fCore->Settings()->AllowOutputChannelRemapping()) {
|
if (fCore->Settings()->AllowOutputChannelRemapping()) {
|
||||||
top = web->MakeGroup("Output Mapping"); // top level group
|
top = web->MakeGroup("Output mapping"); // top level group
|
||||||
outputchannels = top->MakeGroup("");
|
outputchannels = top->MakeGroup("");
|
||||||
outputchannels->MakeNullParameter(PARAM_STR4(0), B_MEDIA_RAW_AUDIO, "Output Channel Sources", B_GENERIC);
|
outputchannels->MakeNullParameter(PARAM_STR4(0), B_MEDIA_RAW_AUDIO, "Output channel sources", B_GENERIC);
|
||||||
|
|
||||||
group = outputchannels->MakeGroup("");
|
group = outputchannels->MakeGroup("");
|
||||||
group->MakeNullParameter(PARAM_STR5(0), B_MEDIA_RAW_AUDIO, "Master Output", B_GENERIC);
|
group->MakeNullParameter(PARAM_STR5(0), B_MEDIA_RAW_AUDIO, "Master output", B_GENERIC);
|
||||||
group = group->MakeGroup("");
|
group = group->MakeGroup("");
|
||||||
if (!out) {
|
if (!out) {
|
||||||
group->MakeNullParameter(PARAM_STR6(0), B_MEDIA_RAW_AUDIO, "not connected", B_GENERIC);
|
group->MakeNullParameter(PARAM_STR6(0), B_MEDIA_RAW_AUDIO, "not connected", B_GENERIC);
|
||||||
@@ -1771,9 +1771,9 @@ AudioMixer::UpdateParameterWeb()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fCore->Settings()->AllowInputChannelRemapping()) {
|
if (fCore->Settings()->AllowInputChannelRemapping()) {
|
||||||
top = web->MakeGroup("Input Mapping"); // top level group
|
top = web->MakeGroup("Input mapping"); // top level group
|
||||||
inputchannels = top->MakeGroup("");
|
inputchannels = top->MakeGroup("");
|
||||||
inputchannels->MakeNullParameter(PARAM_STR7(0), B_MEDIA_RAW_AUDIO, "Input Channel Destinations", B_GENERIC);
|
inputchannels->MakeNullParameter(PARAM_STR7(0), B_MEDIA_RAW_AUDIO, "Input channel destinations", B_GENERIC);
|
||||||
|
|
||||||
for (int i = 0; (in = fCore->Input(i)); i++) {
|
for (int i = 0; (in = fCore->Input(i)); i++) {
|
||||||
group = inputchannels->MakeGroup("");
|
group = inputchannels->MakeGroup("");
|
||||||
|
|||||||
Reference in New Issue
Block a user