Internal routing management for ice1712 audio driver

* internal chip routing management.
* style cleanup.
This commit is contained in:
Jerome Leveque
2011-11-18 19:20:25 +01:00
committed by Jérôme Duval
parent 8a5fb91c07
commit 8519dc0f22
6 changed files with 232 additions and 159 deletions
@@ -9,6 +9,7 @@
* Distributed under the terms of the MIT license. * Distributed under the terms of the MIT license.
*/ */
#include <KernelExport.h> #include <KernelExport.h>
#include <Drivers.h> #include <Drivers.h>
#include <Errors.h> #include <Errors.h>
@@ -67,7 +68,8 @@ int32 api_version = B_CUR_DRIVER_API_VERSION;
//------------------------------------------------------ //------------------------------------------------------
//------------------------------------------------------ //------------------------------------------------------
status_t init_hardware(void) status_t
init_hardware(void)
{ {
int ix = 0; int ix = 0;
pci_info info; pci_info info;
@@ -137,6 +139,7 @@ ice1712_setup(ice1712 *ice)
int result, i; int result, i;
status_t status = B_OK; status_t status = B_OK;
uint8 reg8 = 0; uint8 reg8 = 0;
uint16 mute;
ice->irq = ice->info.u.h0.interrupt_line; ice->irq = ice->info.u.h0.interrupt_line;
ice->Controller = ice->info.u.h0.base_registers[0]; ice->Controller = ice->info.u.h0.base_registers[0];
@@ -325,9 +328,10 @@ ice1712_setup(ice1712 *ice)
//Set the rampe volume to a faster one //Set the rampe volume to a faster one
write_mt_uint16(ice, MT_VOLUME_CONTROL_RATE, 0x01); write_mt_uint16(ice, MT_VOLUME_CONTROL_RATE, 0x01);
//Digital Mixer To DAC 0 and SPDIF Out //All Analog outputs from DMA
write_mt_uint16(ice, MT_ROUTING_CONTROL_PSDOUT, 0x0101); write_mt_uint16(ice, MT_ROUTING_CONTROL_PSDOUT, 0x0000);
// write_mt_uint16(ice, MT_ROUTING_CONTROL_SPDOUT, 0x0005); //All Digital output from DMA
write_mt_uint16(ice, MT_ROUTING_CONTROL_SPDOUT, 0x0000);
//Just to route all input to all output //Just to route all input to all output
// write_mt_uint16(ice, MT_ROUTING_CONTROL_PSDOUT, 0xAAAA); // write_mt_uint16(ice, MT_ROUTING_CONTROL_PSDOUT, 0xAAAA);
@@ -338,12 +342,12 @@ ice1712_setup(ice1712 *ice)
// write_mt_uint32(ice, MT_CAPTURED_DATA, 0x76543280); // write_mt_uint32(ice, MT_CAPTURED_DATA, 0x76543280);
//Mute all input //Mute all input
/* for (i = 0; i < 20; i++) mute = (ICE1712_MUTE_VALUE << 0) | (ICE1712_MUTE_VALUE << 8);
{ for (i = 0; i < 2 * MAX_HARDWARE_VOLUME; i++) {
write_mt_uint8(ice, MT_VOLUME_CONTROL_CHANNEL_INDEX, i); write_mt_uint8(ice, MT_VOLUME_CONTROL_CHANNEL_INDEX, i);
write_mt_uint16(ice, MT_VOLUME_CONTROL_CHANNEL_INDEX, 0x7F7F); write_mt_uint16(ice, MT_VOLUME_CONTROL_CHANNEL_INDEX, mute);
} }
*/
//Unmask Interrupt //Unmask Interrupt
write_ccs_uint8(ice, CCS_CONTROL_STATUS, 0x41); write_ccs_uint8(ice, CCS_CONTROL_STATUS, 0x41);
@@ -696,13 +700,12 @@ find_device(const char * name)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#define ICE1712_MUTE_VALUE (0x7F)
status_t status_t
applySettings(ice1712 *card) applySettings(ice1712 *card)
{ {
int i; int i;
uint16 val; uint16 val, mt30 = 0;
uint32 mt34 = 0;
for (i = 0; i < MAX_HARDWARE_VOLUME; i++) { for (i = 0; i < MAX_HARDWARE_VOLUME; i++) {
//Select the channel //Select the channel
@@ -747,7 +750,58 @@ applySettings(ice1712 *card)
TRACE_VV("Apply Settings %d : 0x%x\n", i, val); TRACE_VV("Apply Settings %d : 0x%x\n", i, val);
} }
//Output selection //Analog output selection
for (i = 0; i < 4; i++) {
uint8 out = card->settings.Output[i];
if (out == 0) {
TRACE_VV("Output %d is haiku output\n", i);
//Nothing to do
} else if (out <= (card->nb_ADC / 2)) {
uint8 mt34_c;
out--;
TRACE_VV("Output %d is input %d\n", i, out);
mt34_c = (out * 2);
mt34_c |= (out * 2 + 1) << 4;
mt30 |= 0x0202 << (2*i);
mt30 |= mt34_c << (8*i);
} else if (out == ((card->nb_ADC / 2) + 1)
&& (card->spdif_config & YES_IN_NO_OUT) != 0) {
TRACE_VV("Output %d is digital input\n", i);
mt30 |= 0x0303 << (2*i);
mt34 |= 0x80 << (8*i);
} else {
TRACE_VV("Output %d is digital Mixer\n", i);
mt30 |= 0x0101;
}
}
write_mt_uint16(card, MT_ROUTING_CONTROL_PSDOUT, mt30);
write_mt_uint32(card, MT_CAPTURED_DATA, mt34);
//Digital output
if ((card->spdif_config & NO_IN_YES_OUT) != 0) {
uint16 mt32 = 0;
uint8 out = card->settings.Output[4];
if (out == 0) {
TRACE_VV("Digital output is haiku output\n");
//Nothing to do
} else if (out <= (card->nb_ADC / 2)) {
out--;
TRACE_VV("Digital output is input %d\n", out);
mt32 |= 0x0202;
mt32 |= (out * 2) << 8;
mt32 |= (out * 2 + 1) << 12;
} else if (out == ((card->nb_ADC / 2) + 1)
&& (card->spdif_config & YES_IN_NO_OUT) != 0) {
TRACE_VV("Digital output is digital input\n");
mt32 |= 0x800F;
} else {
TRACE_VV("Digital output is digital Mixer\n");
mt32 |= 0x0005;
}
write_mt_uint16(card, MT_ROUTING_CONTROL_SPDOUT, mt32);
}
return B_OK; return B_OK;
} }
@@ -8,10 +8,10 @@
* All rights reserved * All rights reserved
* Distributed under the terms of the MIT license. * Distributed under the terms of the MIT license.
*/ */
#ifndef _ICE1712_H_ #ifndef _ICE1712_H_
#define _ICE1712_H_ #define _ICE1712_H_
#include <PCI.h> #include <PCI.h>
#include "hmulti_audio.h" #include "hmulti_audio.h"
@@ -41,6 +41,7 @@ typedef enum product_t {
#define MAX_BUFFER_FRAMES 2048 #define MAX_BUFFER_FRAMES 2048
#define MAX_HARDWARE_VOLUME 10 #define MAX_HARDWARE_VOLUME 10
#define ICE1712_MUTE_VALUE 0x7F
#define PLAYBACK_BUFFER_SIZE (MAX_BUFFER_FRAMES * MAX_DAC * SAMPLE_SIZE) #define PLAYBACK_BUFFER_SIZE (MAX_BUFFER_FRAMES * MAX_DAC * SAMPLE_SIZE)
#define RECORD_BUFFER_SIZE (MAX_BUFFER_FRAMES * MAX_ADC * SAMPLE_SIZE) #define RECORD_BUFFER_SIZE (MAX_BUFFER_FRAMES * MAX_ADC * SAMPLE_SIZE)
@@ -192,8 +192,8 @@ read_ds_channel_data(ice1712 *ice, uint8 channel, ds8_register index)
void void
write_ds_channel_data(ice1712 *ice, uint8 channel, write_ds_channel_data(ice1712 *ice, uint8 channel, ds8_register index,
ds8_register index, uint32 data) uint32 data)
{ {
uint8 ds8_channel_index = channel << 4 | index; uint8 ds8_channel_index = channel << 4 | index;
@@ -9,6 +9,7 @@
* Distributed under the terms of the MIT license. * Distributed under the terms of the MIT license.
*/ */
#include "ice1712_reg.h" #include "ice1712_reg.h"
#include "io.h" #include "io.h"
#include "multi.h" #include "multi.h"
@@ -24,6 +25,7 @@
#define MAX_CONTROL 32 #define MAX_CONTROL 32
static void static void
start_DMA(ice1712 *card) start_DMA(ice1712 *card)
{ {
@@ -103,6 +105,7 @@ start_DMA(ice1712 *card)
write_mt_uint8(card, MT_PROF_PB_CONTROL, 5); write_mt_uint8(card, MT_PROF_PB_CONTROL, 5);
} }
status_t status_t
ice1712_get_description(ice1712 *card, multi_description *data) ice1712_get_description(ice1712 *card, multi_description *data)
{ {
@@ -150,11 +153,9 @@ ice1712_get_description(ice1712 *card, multi_description *data)
data->input_bus_channel_count = 0; data->input_bus_channel_count = 0;
data->aux_bus_channel_count = 0; data->aux_bus_channel_count = 0;
size = data->output_channel_count + size = data->output_channel_count + data->input_channel_count
data->input_channel_count + + data->output_bus_channel_count + data->input_bus_channel_count
data->output_bus_channel_count + + data->aux_bus_channel_count;
data->input_bus_channel_count +
data->aux_bus_channel_count;
TRACE_VV("request_channel_count = %ld\n", data->request_channel_count); TRACE_VV("request_channel_count = %ld\n", data->request_channel_count);
@@ -232,7 +233,8 @@ ice1712_get_description(ice1712 *card, multi_description *data)
TRACE("input_bus_channel_count = %ld\n", data->input_bus_channel_count); TRACE("input_bus_channel_count = %ld\n", data->input_bus_channel_count);
data->output_rates = data->input_rates = AUTHORIZED_RATE; data->output_rates = data->input_rates = AUTHORIZED_RATE;
data->min_cvsr_rate = data->max_cvsr_rate = 0; data->min_cvsr_rate = 44100;
data->max_cvsr_rate = 96000;
data->output_formats = data->input_formats = AUTHORIZED_SAMPLE_SIZE; data->output_formats = data->input_formats = AUTHORIZED_SAMPLE_SIZE;
data->lock_sources = B_MULTI_LOCK_INTERNAL | B_MULTI_LOCK_SPDIF; data->lock_sources = B_MULTI_LOCK_INTERNAL | B_MULTI_LOCK_SPDIF;
@@ -360,6 +362,7 @@ ice1712_set_global_format(ice1712 *card, multi_format_info *data)
return B_OK; return B_OK;
} }
static uint32 static uint32
get_combo_cb(ice1712 *card, uint32 index) get_combo_cb(ice1712 *card, uint32 index)
{ {
@@ -392,6 +395,7 @@ get_combo_cb(ice1712 *card, uint32 index)
return value; return value;
} }
static void static void
set_combo_cb(ice1712 *card, uint32 index, uint32 value) set_combo_cb(ice1712 *card, uint32 index, uint32 value)
{ {
@@ -429,6 +433,7 @@ set_combo_cb(ice1712 *card, uint32 index, uint32 value)
} }
} }
static uint32 static uint32
get_output_cb(ice1712 *card, uint32 index) get_output_cb(ice1712 *card, uint32 index)
{ {
@@ -442,6 +447,7 @@ get_output_cb(ice1712 *card, uint32 index)
return value; return value;
} }
static void static void
set_output_cb(ice1712 *card, uint32 index, uint32 value) set_output_cb(ice1712 *card, uint32 index, uint32 value)
{ {
@@ -451,6 +457,7 @@ set_output_cb(ice1712 *card, uint32 index, uint32 value)
TRACE_VV(" set_output_cb: %ld, %ld\n", index, value); TRACE_VV(" set_output_cb: %ld, %ld\n", index, value);
} }
static void static void
get_volume_cb(ice1712 *card, multi_mix_value *mmv) get_volume_cb(ice1712 *card, multi_mix_value *mmv)
{ {
@@ -471,7 +478,7 @@ get_volume_cb(ice1712 *card, multi_mix_value *mmv)
switch (ICE1712_MULTI_GET_INDEX(mmv->id)) { switch (ICE1712_MULTI_GET_INDEX(mmv->id)) {
case 0: //Mute case 0: //Mute
mmv->u.enable = vol[chan].Mute | vol[chan + 1].Mute; mmv->u.enable = vol[chan].Mute | vol[chan + 1].Mute;
TRACE_VV(" Get mute %d for channel %d or %d\n", TRACE_VV("\tGet mute %d for channel %d or %d\n",
mmv->u.enable, (int)chan, (int)chan + 1); mmv->u.enable, (int)chan, (int)chan + 1);
break; break;
@@ -480,12 +487,13 @@ get_volume_cb(ice1712 *card, multi_mix_value *mmv)
//No break //No break
case 1: //Left channel case 1: //Left channel
mmv->u.gain = vol[chan].Volume; mmv->u.gain = vol[chan].Volume;
TRACE_VV(" Get Volume %f for channel %d\n", TRACE_VV("\tGet Volume %f for channel %d\n",
mmv->u.gain, (int)chan); mmv->u.gain, (int)chan);
break; break;
} }
} }
static void static void
set_volume_cb(ice1712 *card, multi_mix_value *mmv) set_volume_cb(ice1712 *card, multi_mix_value *mmv)
{ {
@@ -507,7 +515,7 @@ set_volume_cb(ice1712 *card, multi_mix_value *mmv)
case 0: //Mute case 0: //Mute
vol[chan].Mute = mmv->u.enable; vol[chan].Mute = mmv->u.enable;
vol[chan + 1].Mute = mmv->u.enable; vol[chan + 1].Mute = mmv->u.enable;
TRACE_VV(" Change mute to %d for channel %d and %d\n", TRACE_VV("\tChange mute to %d for channel %d and %d\n",
mmv->u.enable, (int)chan, (int)chan + 1); mmv->u.enable, (int)chan, (int)chan + 1);
break; break;
@@ -516,12 +524,13 @@ set_volume_cb(ice1712 *card, multi_mix_value *mmv)
//No break //No break
case 1: //Left channel case 1: //Left channel
vol[chan].Volume = mmv->u.gain; vol[chan].Volume = mmv->u.gain;
TRACE_VV(" Change Volume to %f for channel %d\n", TRACE_VV("\tChange Volume to %f for channel %d\n",
mmv->u.gain, (int)chan); mmv->u.gain, (int)chan);
break; break;
} }
} }
status_t status_t
ice1712_get_mix(ice1712 *card, multi_mix_value_info *data) ice1712_get_mix(ice1712 *card, multi_mix_value_info *data)
{ {
@@ -555,6 +564,7 @@ ice1712_get_mix(ice1712 *card, multi_mix_value_info *data)
return B_OK; return B_OK;
} }
status_t status_t
ice1712_set_mix(ice1712 *card, multi_mix_value_info *data) ice1712_set_mix(ice1712 *card, multi_mix_value_info *data)
{ {
@@ -592,7 +602,8 @@ ice1712_set_mix(ice1712 *card, multi_mix_value_info *data)
status_t status_t
ice1712_list_mix_channels(ice1712 *card, multi_mix_channel_info *data) ice1712_list_mix_channels(ice1712 *card, multi_mix_channel_info *data)
{//Not Implemented {
//Not Implemented
return B_OK; return B_OK;
} }
@@ -682,6 +693,7 @@ static const char *string_list[] = {
static int32 nb_control_created; static int32 nb_control_created;
//This will create a Tab //This will create a Tab
static int32 static int32
create_group_control(multi_mix_control **p_mmc, int32 index, int32 parent, create_group_control(multi_mix_control **p_mmc, int32 index, int32 parent,
@@ -711,6 +723,7 @@ create_group_control(multi_mix_control **p_mmc, int32 index, int32 parent,
return group; return group;
} }
//This will create a Slider with a "Mute" CheckBox //This will create a Slider with a "Mute" CheckBox
static void static void
create_channel_control(multi_mix_control **p_mmc, int32 channel, int32 parent, create_channel_control(multi_mix_control **p_mmc, int32 channel, int32 parent,
@@ -762,6 +775,7 @@ create_channel_control(multi_mix_control **p_mmc, int32 channel, int32 parent,
(*p_mmc) = mmc; (*p_mmc) = mmc;
} }
static void static void
create_combo_control(multi_mix_control **p_mmc, const char *values[], create_combo_control(multi_mix_control **p_mmc, const char *values[],
int32 parent, int32 nb_combo, const char *name) int32 parent, int32 nb_combo, const char *name)
@@ -799,6 +813,7 @@ create_combo_control(multi_mix_control **p_mmc, const char *values[],
(*p_mmc) = mmc; (*p_mmc) = mmc;
} }
//This will create all possible value for the output //This will create all possible value for the output
//output 0 -> 3 (physical stereo output) 4 is the Digital //output 0 -> 3 (physical stereo output) 4 is the Digital
static void static void
@@ -871,6 +886,7 @@ create_output_choice(ice1712 *card, multi_mix_control **p_mmc,
(*p_mmc) = mmc; (*p_mmc) = mmc;
} }
status_t status_t
ice1712_list_mix_controls(ice1712 *card, multi_mix_control_info *mmci) ice1712_list_mix_controls(ice1712 *card, multi_mix_control_info *mmci)
{ {
@@ -969,19 +985,19 @@ ice1712_get_buffers(ice1712 *card, multi_buffer_list *data)
{ {
int buff, chan_i = 0, chan_o = 0; int buff, chan_i = 0, chan_o = 0;
TRACE_VV("flags = %#x\n", (int)data->flags); TRACE_VV("flags = %#lx\n", data->flags);
TRACE_VV("request_playback_buffers = %d\n", TRACE_VV("request_playback_buffers = %ld\n",
(int)data->request_playback_buffers); data->request_playback_buffers);
TRACE_VV("request_playback_channels = %d\n", TRACE_VV("request_playback_channels = %ld\n",
(int)data->request_playback_channels); data->request_playback_channels);
TRACE_VV("request_playback_buffer_size = %#x\n", TRACE_VV("request_playback_buffer_size = %lx\n",
(int)data->request_playback_buffer_size); data->request_playback_buffer_size);
TRACE_VV("request_record_buffers = %d\n", TRACE_VV("request_record_buffers = %ld\n",
(int)data->request_record_buffers); data->request_record_buffers);
TRACE_VV("request_record_channels = %d\n", TRACE_VV("request_record_channels = %ld\n",
(int)data->request_record_channels); data->request_record_channels);
TRACE_VV("request_record_buffer_size = %#x\n", TRACE_VV("request_record_buffer_size = %lx\n",
(int)data->request_record_buffer_size); data->request_record_buffer_size);
for (buff = 0; buff < SWAPPING_BUFFERS; buff++) { for (buff = 0; buff < SWAPPING_BUFFERS; buff++) {
uint32 stride_o = MAX_DAC * SAMPLE_SIZE; uint32 stride_o = MAX_DAC * SAMPLE_SIZE;
@@ -995,8 +1011,8 @@ ice1712_get_buffers(ice1712 *card, multi_buffer_list *data)
data->playback_buffers[buff][chan_o].base = card->log_addr_pb data->playback_buffers[buff][chan_o].base = card->log_addr_pb
+ buf_o * buff + SAMPLE_SIZE * chan_o; + buf_o * buff + SAMPLE_SIZE * chan_o;
data->playback_buffers[buff][chan_o].stride = stride_o; data->playback_buffers[buff][chan_o].stride = stride_o;
TRACE_VV("pb_buffer[%d][%d] = %#x\n", (int)buff, (int)chan_o, TRACE_VV("pb_buffer[%ld][%ld] = %p\n", buff, chan_o,
(int)data->playback_buffers[buff][chan_o].base); data->playback_buffers[buff][chan_o].base);
} }
if (card->spdif_config & NO_IN_YES_OUT) { if (card->spdif_config & NO_IN_YES_OUT) {
@@ -1004,15 +1020,15 @@ ice1712_get_buffers(ice1712 *card, multi_buffer_list *data)
data->playback_buffers[buff][chan_o].base = card->log_addr_pb data->playback_buffers[buff][chan_o].base = card->log_addr_pb
+ buf_o * buff + SAMPLE_SIZE * SPDIF_LEFT; + buf_o * buff + SAMPLE_SIZE * SPDIF_LEFT;
data->playback_buffers[buff][chan_o].stride = stride_o; data->playback_buffers[buff][chan_o].stride = stride_o;
TRACE_VV("pb_buffer[%d][%d] = %#x\n", (int)buff, (int)chan_o, TRACE_VV("pb_buffer[%ld][%ld] = %p\n", buff, chan_o,
(int)data->playback_buffers[buff][chan_o].base); data->playback_buffers[buff][chan_o].base);
chan_o++; chan_o++;
data->playback_buffers[buff][chan_o].base = card->log_addr_pb data->playback_buffers[buff][chan_o].base = card->log_addr_pb
+ buf_o * buff + SAMPLE_SIZE * SPDIF_RIGHT; + buf_o * buff + SAMPLE_SIZE * SPDIF_RIGHT;
data->playback_buffers[buff][chan_o].stride = stride_o; data->playback_buffers[buff][chan_o].stride = stride_o;
TRACE_VV("pb_buffer[%d][%d] = %#x\n", (int)buff, (int)chan_o, TRACE_VV("pb_buffer[%ld][%ld] = %p\n", buff, chan_o,
(int)data->playback_buffers[buff][chan_o].base); data->playback_buffers[buff][chan_o].base);
chan_o++; chan_o++;
} }
} }
@@ -1023,8 +1039,8 @@ ice1712_get_buffers(ice1712 *card, multi_buffer_list *data)
data->record_buffers[buff][chan_i].base = card->log_addr_rec data->record_buffers[buff][chan_i].base = card->log_addr_rec
+ buf_i * buff + SAMPLE_SIZE * chan_i; + buf_i * buff + SAMPLE_SIZE * chan_i;
data->record_buffers[buff][chan_i].stride = stride_i; data->record_buffers[buff][chan_i].stride = stride_i;
TRACE_VV("rec_buffer[%d][%d] = %#x\n", (int)buff, (int)chan_i, TRACE_VV("rec_buffer[%ld][%ld] = %p\n", buff, chan_i,
(int)data->record_buffers[buff][chan_i].base); data->record_buffers[buff][chan_i].base);
} }
if (card->spdif_config & YES_IN_NO_OUT) { if (card->spdif_config & YES_IN_NO_OUT) {
@@ -1032,15 +1048,15 @@ ice1712_get_buffers(ice1712 *card, multi_buffer_list *data)
data->record_buffers[buff][chan_i].base = card->log_addr_rec data->record_buffers[buff][chan_i].base = card->log_addr_rec
+ buf_i * buff + SAMPLE_SIZE * SPDIF_LEFT; + buf_i * buff + SAMPLE_SIZE * SPDIF_LEFT;
data->record_buffers[buff][chan_i].stride = stride_i; data->record_buffers[buff][chan_i].stride = stride_i;
TRACE_VV("rec_buffer[%d][%d] = %#x\n", (int)buff, (int)chan_i, TRACE_VV("rec_buffer[%ld][%ld] = %p\n", buff, chan_i,
(int)data->record_buffers[buff][chan_i].base); data->record_buffers[buff][chan_i].base);
chan_i++; chan_i++;
data->record_buffers[buff][chan_i].base = card->log_addr_rec data->record_buffers[buff][chan_i].base = card->log_addr_rec
+ buf_i * buff + SAMPLE_SIZE * SPDIF_RIGHT; + buf_i * buff + SAMPLE_SIZE * SPDIF_RIGHT;
data->record_buffers[buff][chan_i].stride = stride_i; data->record_buffers[buff][chan_i].stride = stride_i;
TRACE_VV("rec_buffer[%d][%d] = %#x\n", (int)buff, (int)chan_i, TRACE_VV("rec_buffer[%ld][%ld] = %p\n", buff, chan_i,
(int)data->record_buffers[buff][chan_i].base); data->record_buffers[buff][chan_i].base);
chan_i++; chan_i++;
} }
@@ -1048,15 +1064,15 @@ ice1712_get_buffers(ice1712 *card, multi_buffer_list *data)
data->record_buffers[buff][chan_i].base = card->log_addr_rec data->record_buffers[buff][chan_i].base = card->log_addr_rec
+ buf_i * buff + SAMPLE_SIZE * MIXER_OUT_LEFT; + buf_i * buff + SAMPLE_SIZE * MIXER_OUT_LEFT;
data->record_buffers[buff][chan_i].stride = stride_i; data->record_buffers[buff][chan_i].stride = stride_i;
TRACE_VV("rec_buffer[%d][%d] = %#x\n", (int)buff, (int)chan_i, TRACE_VV("rec_buffer[%ld][%ld] = %p\n", buff, chan_i,
(int)data->record_buffers[buff][chan_i].base); data->record_buffers[buff][chan_i].base);
chan_i++; chan_i++;
data->record_buffers[buff][chan_i].base = card->log_addr_rec data->record_buffers[buff][chan_i].base = card->log_addr_rec
+ buf_i * buff + SAMPLE_SIZE * MIXER_OUT_RIGHT; + buf_i * buff + SAMPLE_SIZE * MIXER_OUT_RIGHT;
data->record_buffers[buff][chan_i].stride = stride_i; data->record_buffers[buff][chan_i].stride = stride_i;
TRACE_VV("rec_buffer[%d][%d] = %#x\n", (int)buff, (int)chan_i, TRACE_VV("rec_buffer[%ld][%ld] = %p\n", buff, chan_i,
(int)data->record_buffers[buff][chan_i].base); data->record_buffers[buff][chan_i].base);
chan_i++; chan_i++;
} }
} }
@@ -1065,22 +1081,20 @@ ice1712_get_buffers(ice1712 *card, multi_buffer_list *data)
data->return_playback_channels = card->total_output_channels; data->return_playback_channels = card->total_output_channels;
data->return_playback_buffer_size = card->buffer_size; data->return_playback_buffer_size = card->buffer_size;
TRACE("return_playback_buffers = %d\n", TRACE("return_playback_buffers = %ld\n", data->return_playback_buffers);
(int)data->return_playback_buffers); TRACE("return_playback_channels = %ld\n", data->return_playback_channels);
TRACE("return_playback_channels = %d\n", TRACE("return_playback_buffer_size = %ld\n",
(int)data->return_playback_channels); data->return_playback_buffer_size);
TRACE("return_playback_buffer_size = %d\n",
(int)data->return_playback_buffer_size);
data->return_record_buffers = SWAPPING_BUFFERS; data->return_record_buffers = SWAPPING_BUFFERS;
data->return_record_channels = card->total_input_channels; data->return_record_channels = card->total_input_channels;
data->return_record_channels = chan_i; data->return_record_channels = chan_i;
data->return_record_buffer_size = card->buffer_size; data->return_record_buffer_size = card->buffer_size;
TRACE("return_record_buffers = %d\n",(int)data->return_record_buffers); TRACE("return_record_buffers = %ld\n", data->return_record_buffers);
TRACE("return_record_channels = %d\n", (int)data->return_record_channels); TRACE("return_record_channels = %ld\n", data->return_record_channels);
TRACE("return_record_buffer_size = %d\n", TRACE("return_record_buffer_size = %ld\n",
(int)data->return_record_buffer_size); data->return_record_buffer_size);
start_DMA(card); start_DMA(card);
@@ -1116,12 +1130,14 @@ ice1712_buffer_exchange(ice1712 *card, multi_buffer_info *data)
buffer_info.played_frames_count = card->frames_count; buffer_info.played_frames_count = card->frames_count;
buffer_info.playback_buffer_cycle = (card->buffer - 1) buffer_info.playback_buffer_cycle = (card->buffer - 1)
% SWAPPING_BUFFERS; //Buffer played % SWAPPING_BUFFERS; //Buffer played
buffer_info._reserved_0 = 0;
// Record buffers info // Record buffers info
buffer_info.recorded_real_time = card->played_time; buffer_info.recorded_real_time = card->played_time;
buffer_info.recorded_frames_count = card->frames_count; buffer_info.recorded_frames_count = card->frames_count;
buffer_info.record_buffer_cycle = (card->buffer - 1) buffer_info.record_buffer_cycle = (card->buffer - 1)
% SWAPPING_BUFFERS; //Buffer filled % SWAPPING_BUFFERS; //Buffer filled
buffer_info._reserved_1 = card->total_output_channels;
unlock(cpu_status); unlock(cpu_status);
@@ -70,4 +70,6 @@ status_t ice1712_get_buffers(ice1712 *card, multi_buffer_list *data);
status_t ice1712_buffer_exchange(ice1712 *card, multi_buffer_info *data); status_t ice1712_buffer_exchange(ice1712 *card, multi_buffer_info *data);
status_t ice1712_buffer_force_stop(ice1712 *card); status_t ice1712_buffer_force_stop(ice1712 *card);
#endif //_ICE1712_MULTI_H_ #endif //_ICE1712_MULTI_H_