hda: fix 64-bit warnings.
This commit is contained in:
@@ -181,12 +181,15 @@ stream_handle_interrupt(hda_controller* controller, hda_stream* stream,
|
||||
stream->Write8(HDAC_STREAM_STATUS, status);
|
||||
|
||||
if ((status & STATUS_FIFO_ERROR) != 0)
|
||||
dprintf("hda: stream fifo error (id:%ld)\n", stream->id);
|
||||
if ((status & STATUS_DESCRIPTOR_ERROR) != 0)
|
||||
dprintf("hda: stream descriptor error (id:%ld)\n", stream->id);
|
||||
dprintf("hda: stream fifo error (id:%" B_PRIu32 ")\n", stream->id);
|
||||
if ((status & STATUS_DESCRIPTOR_ERROR) != 0) {
|
||||
dprintf("hda: stream descriptor error (id:%" B_PRIu32 ")\n",
|
||||
stream->id);
|
||||
}
|
||||
|
||||
if ((status & STATUS_BUFFER_COMPLETED) == 0) {
|
||||
dprintf("hda: stream buffer not completed (id:%ld)\n", stream->id);
|
||||
dprintf("hda: stream buffer not completed (id:%" B_PRIu32 ")\n",
|
||||
stream->id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -196,8 +199,8 @@ stream_handle_interrupt(hda_controller* controller, hda_stream* stream,
|
||||
// DMA position for recording and behind for playback streams, but just
|
||||
// for determining the currently active buffer, it should be good enough.
|
||||
if (stream->use_dma_position && stream->incorrect_position_count >= 32) {
|
||||
dprintf("hda: DMA position for stream (id:%ld) seems to be broken. "
|
||||
"Switching to using LPIB.\n", stream->id);
|
||||
dprintf("hda: DMA position for stream (id:%" B_PRIu32 ") seems to be "
|
||||
"broken. Switching to using LPIB.\n", stream->id);
|
||||
stream->use_dma_position = false;
|
||||
}
|
||||
|
||||
@@ -282,14 +285,15 @@ hda_interrupt_handler(hda_controller* controller)
|
||||
hda_codec* codec = controller->codecs[cad];
|
||||
|
||||
if (codec == NULL) {
|
||||
dprintf("hda: Response for unknown codec %ld: "
|
||||
"%08lx/%08lx\n", cad, response, responseFlags);
|
||||
dprintf("hda: Response for unknown codec %" B_PRIu32
|
||||
": %08" B_PRIx32 "/%08" B_PRIx32 "\n", cad,
|
||||
response, responseFlags);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((responseFlags & RESPONSE_FLAGS_UNSOLICITED) != 0) {
|
||||
dprintf("hda: Unsolicited response: %08lx/%08lx\n",
|
||||
response, responseFlags);
|
||||
dprintf("hda: Unsolicited response: %08" B_PRIx32
|
||||
"/%08" B_PRIx32 "\n", response, responseFlags);
|
||||
codec->unsol_responses[codec->unsol_response_write++] =
|
||||
response;
|
||||
codec->unsol_response_write %= MAX_CODEC_UNSOL_RESPONSES;
|
||||
@@ -299,8 +303,9 @@ hda_interrupt_handler(hda_controller* controller)
|
||||
continue;
|
||||
}
|
||||
if (codec->response_count >= MAX_CODEC_RESPONSES) {
|
||||
dprintf("hda: too many responses received for codec %ld"
|
||||
": %08lx/%08lx!\n", cad, response, responseFlags);
|
||||
dprintf("hda: too many responses received for codec %"
|
||||
B_PRIu32 ": %08" B_PRIx32 "/%08" B_PRIx32 "!\n",
|
||||
cad, response, responseFlags);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -334,7 +339,7 @@ hda_interrupt_handler(hda_controller* controller)
|
||||
}
|
||||
} else {
|
||||
dprintf("hda: Stream interrupt for unconfigured stream "
|
||||
"%ld!\n", index);
|
||||
"%" B_PRIu32 "!\n", index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -679,7 +684,7 @@ hda_stream_new(hda_audio_group* audioGroup, int type)
|
||||
status_t
|
||||
hda_stream_start(hda_controller* controller, hda_stream* stream)
|
||||
{
|
||||
dprintf("hda_stream_start() offset %lx\n", stream->offset);
|
||||
dprintf("hda_stream_start() offset %" B_PRIx32 "\n", stream->offset);
|
||||
|
||||
stream->frames_count = 0;
|
||||
stream->last_link_frame_position = 0;
|
||||
@@ -739,7 +744,7 @@ hda_stream_setup_buffers(hda_audio_group* audioGroup, hda_stream* stream,
|
||||
case B_FMT_32BIT: format |= FORMAT_32BIT; stream->bps = 32; break;
|
||||
|
||||
default:
|
||||
dprintf("hda: Invalid sample format: 0x%lx\n",
|
||||
dprintf("hda: Invalid sample format: 0x%" B_PRIx32 "\n",
|
||||
stream->sample_format);
|
||||
break;
|
||||
}
|
||||
@@ -756,11 +761,12 @@ hda_stream_setup_buffers(hda_audio_group* audioGroup, hda_stream* stream,
|
||||
stream->buffer_size = ALIGN(stream->buffer_length * stream->num_channels
|
||||
* stream->sample_size, 128);
|
||||
|
||||
dprintf("hda: sample size %ld, num channels %ld, buffer length %ld\n",
|
||||
stream->sample_size, stream->num_channels, stream->buffer_length);
|
||||
dprintf("hda: %s: setup stream %ld: SR=%ld, SF=%ld F=0x%x (0x%lx)\n",
|
||||
__func__, stream->id, stream->rate, stream->bps, format,
|
||||
stream->sample_format);
|
||||
dprintf("hda: sample size %" B_PRIu32 ", num channels %" B_PRIu32 ", "
|
||||
"buffer length %" B_PRIu32 "\n", stream->sample_size,
|
||||
stream->num_channels, stream->buffer_length);
|
||||
dprintf("hda: %s: setup stream %" B_PRIu32 ": SR=%" B_PRIu32 ", SF=%"
|
||||
B_PRIu32 " F=0x%x (0x%" B_PRIx32 ")\n", __func__, stream->id,
|
||||
stream->rate, stream->bps, format, stream->sample_format);
|
||||
|
||||
// Calculate total size of all buffers (aligned to size of B_PAGE_SIZE)
|
||||
uint32 alloc = stream->buffer_size * stream->num_buffers;
|
||||
@@ -788,8 +794,8 @@ hda_stream_setup_buffers(hda_audio_group* audioGroup, hda_stream* stream,
|
||||
bufferPhysicalAddress, B_MTR_UC);
|
||||
}
|
||||
|
||||
dprintf("hda: %s(%s): Allocated %lu bytes for %ld buffers\n", __func__, desc,
|
||||
alloc, stream->num_buffers);
|
||||
dprintf("hda: %s(%s): Allocated %" B_PRIu32 " bytes for %" B_PRIu32
|
||||
" buffers\n", __func__, desc, alloc, stream->num_buffers);
|
||||
|
||||
// Store pointers (both virtual/physical)
|
||||
for (uint32 index = 0; index < stream->num_buffers; index++) {
|
||||
@@ -827,8 +833,8 @@ hda_stream_setup_buffers(hda_audio_group* audioGroup, hda_stream* stream,
|
||||
stream->physical_buffer_descriptors, B_MTR_UC);
|
||||
}
|
||||
|
||||
dprintf("hda: %s(%s): Allocated %ld bytes for %ld BDLEs\n", __func__, desc,
|
||||
alloc, bdlCount);
|
||||
dprintf("hda: %s(%s): Allocated %" B_PRIu32 " bytes for %" B_PRIu32
|
||||
" BDLEs\n", __func__, desc, alloc, bdlCount);
|
||||
|
||||
// Setup buffer descriptor list (BDL) entries
|
||||
uint32 fragments = 0;
|
||||
@@ -859,8 +865,9 @@ hda_stream_setup_buffers(hda_audio_group* audioGroup, hda_stream* stream,
|
||||
stream->controller->Read32(HDAC_DMA_POSITION_BASE_LOWER)
|
||||
| DMA_POSITION_ENABLED);
|
||||
|
||||
dprintf("hda: stream: %ld fifo size: %d num_io_widgets: %ld\n", stream->id,
|
||||
stream->Read16(HDAC_STREAM_FIFO_SIZE), stream->num_io_widgets);
|
||||
dprintf("hda: stream: %" B_PRIu32 " fifo size: %d num_io_widgets: %"
|
||||
B_PRIu32 "\n", stream->id, stream->Read16(HDAC_STREAM_FIFO_SIZE),
|
||||
stream->num_io_widgets);
|
||||
dprintf("hda: widgets: ");
|
||||
|
||||
hda_codec* codec = audioGroup->codec;
|
||||
@@ -880,7 +887,7 @@ hda_stream_setup_buffers(hda_audio_group* audioGroup, hda_stream* stream,
|
||||
uint32 response[2];
|
||||
hda_send_verbs(codec, verb, response, 2);
|
||||
//channelNum += 2; // TODO stereo widget ? Every output gets the same stream for now
|
||||
dprintf("%ld ", stream->io_widgets[i]);
|
||||
dprintf("%" B_PRIu32 " ", stream->io_widgets[i]);
|
||||
|
||||
hda_widget* widget = hda_audio_group_get_widget(audioGroup,
|
||||
stream->io_widgets[i]);
|
||||
@@ -1075,7 +1082,8 @@ hda_hw_init(hda_controller* controller)
|
||||
controller->num_bidir_streams = GLOBAL_CAP_BIDIR_STREAMS(capabilities);
|
||||
|
||||
// show some hw features
|
||||
dprintf("hda: HDA v%d.%d, O:%ld/I:%ld/B:%ld, #SDO:%d, 64bit:%s\n",
|
||||
dprintf("hda: HDA v%d.%d, O:%" B_PRIu32 "/I:%" B_PRIu32 "/B:%" B_PRIu32
|
||||
", #SDO:%d, 64bit:%s\n",
|
||||
controller->Read8(HDAC_VERSION_MAJOR),
|
||||
controller->Read8(HDAC_VERSION_MINOR),
|
||||
controller->num_output_streams, controller->num_input_streams,
|
||||
@@ -1163,7 +1171,7 @@ no_irq:
|
||||
controller->regs = NULL;
|
||||
|
||||
error:
|
||||
dprintf("hda: ERROR: %s(%ld)\n", strerror(status), status);
|
||||
dprintf("hda: ERROR: %s(%" B_PRIx32 ")\n", strerror(status), status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ get_description(hda_audio_group* audioGroup, multi_description* data)
|
||||
data->input_bus_channel_count = inChannels;
|
||||
data->aux_bus_channel_count = 0;
|
||||
|
||||
TRACE("%s: request_channel_count: %ld\n", __func__,
|
||||
TRACE("%s: request_channel_count: %" B_PRId32 "\n", __func__,
|
||||
data->request_channel_count);
|
||||
|
||||
if (data->request_channel_count >= (int)(sizeof(sChannels)
|
||||
@@ -235,8 +235,8 @@ hda_find_multi_string(hda_widget& widget)
|
||||
case PIN_DEV_HEAD_PHONE_OUT:
|
||||
return S_HEADPHONE;
|
||||
}
|
||||
ERROR("couln't find a string for widget %ld in hda_find_multi_string()\n",
|
||||
widget.node_id);
|
||||
ERROR("couln't find a string for widget %" B_PRIu32 " in "
|
||||
"hda_find_multi_string()\n", widget.node_id);
|
||||
return S_null;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ hda_find_multi_custom_string(hda_widget& widget, char* custom, uint32 size)
|
||||
break;
|
||||
}
|
||||
if (device == NULL) {
|
||||
ERROR("couldn't find a string for widget %ld in "
|
||||
ERROR("couldn't find a string for widget %" B_PRIu32 " in "
|
||||
"hda_find_multi_custom_string()\n", widget.node_id);
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ hda_create_channel_control(hda_multi* multi, uint32* index, int32 parent,
|
||||
control.mix_control.string = S_MUTE;
|
||||
control.type = B_MIX_MUTE;
|
||||
multi->controls[i++] = control;
|
||||
TRACE("control nid %ld mute\n", control.nid);
|
||||
TRACE("control nid %" B_PRIu32 " mute\n", control.nid);
|
||||
mute = false;
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ hda_create_channel_control(hda_multi* multi, uint32* index, int32 parent,
|
||||
control.mix_control.id = MULTI_CONTROL_FIRSTID + i;
|
||||
control.mix_control.master = id;
|
||||
multi->controls[i++] = control;
|
||||
TRACE("control nid %ld %f min %f max %f\n", control.nid,
|
||||
TRACE("control nid %" B_PRIu32 " %f min %f max %f\n", control.nid,
|
||||
control.mix_control.gain.granularity,
|
||||
control.mix_control.gain.min_gain,
|
||||
control.mix_control.gain.max_gain);
|
||||
@@ -444,7 +444,7 @@ hda_create_control_for_complex(hda_multi* multi, uint32* index, uint32 parent,
|
||||
if ((widget.flags & WIDGET_FLAG_WIDGET_PATH) != 0)
|
||||
return;
|
||||
|
||||
TRACE(" create widget nid %lu\n", widget.node_id);
|
||||
TRACE(" create widget nid %" B_PRIu32 "\n", widget.node_id);
|
||||
hda_create_channel_control(multi, index, parent, 0,
|
||||
widget, false, widget.capabilities.output_amplifier, 0, gain, mute);
|
||||
|
||||
@@ -492,7 +492,7 @@ hda_create_controls_list(hda_multi* multi)
|
||||
if ((complex.flags & WIDGET_FLAG_OUTPUT_PATH) == 0)
|
||||
continue;
|
||||
|
||||
TRACE("create complex nid %lu\n", complex.node_id);
|
||||
TRACE("create complex nid %" B_PRIu32 "\n", complex.node_id);
|
||||
hda_find_multi_custom_string(complex, name, sizeof(name));
|
||||
parent2 = hda_create_group_control(multi, &index, parent, S_null, name);
|
||||
bool gain = true, mute = true;
|
||||
@@ -509,7 +509,7 @@ hda_create_controls_list(hda_multi* multi)
|
||||
if ((widget.flags & WIDGET_FLAG_WIDGET_PATH) != 0)
|
||||
continue;
|
||||
|
||||
TRACE("create widget nid %lu\n", widget.node_id);
|
||||
TRACE("create widget nid %" B_PRIu32 "\n", widget.node_id);
|
||||
|
||||
if (AMP_CAP_NUM_STEPS(widget.capabilities.input_amplifier) >= 1) {
|
||||
for (uint32 j = 0; j < widget.num_inputs; j++) {
|
||||
@@ -522,7 +522,8 @@ hda_create_controls_list(hda_multi* multi)
|
||||
continue;
|
||||
if ((complex->flags & WIDGET_FLAG_OUTPUT_PATH) != 0)
|
||||
continue;
|
||||
TRACE(" create widget input nid %lu\n", widget.inputs[j]);
|
||||
TRACE(" create widget input nid %" B_PRIu32 "\n",
|
||||
widget.inputs[j]);
|
||||
hda_find_multi_custom_string(*complex, name, sizeof(name));
|
||||
parent2 = hda_create_group_control(multi, &index,
|
||||
parent, S_null, name);
|
||||
@@ -554,7 +555,7 @@ hda_create_controls_list(hda_multi* multi)
|
||||
widget, true, capabilities, 0, gain, mute);
|
||||
|
||||
if (widget.num_inputs > 1) {
|
||||
TRACE(" create mux for nid %lu\n", widget.node_id);
|
||||
TRACE(" create mux for nid %" B_PRIu32 "\n", widget.node_id);
|
||||
hda_create_mux_control(multi, &index, parent2, widget);
|
||||
continue;
|
||||
}
|
||||
@@ -563,12 +564,12 @@ hda_create_controls_list(hda_multi* multi)
|
||||
widget.inputs[0]);
|
||||
if (mixer->type != WT_AUDIO_MIXER && mixer->type != WT_AUDIO_SELECTOR)
|
||||
continue;
|
||||
TRACE(" create mixer nid %lu\n", mixer->node_id);
|
||||
TRACE(" create mixer nid %" B_PRIu32 "\n", mixer->node_id);
|
||||
hda_create_mux_control(multi, &index, parent2, *mixer);
|
||||
}
|
||||
|
||||
multi->control_count = index;
|
||||
TRACE("multi->control_count %lu\n", multi->control_count);
|
||||
TRACE("multi->control_count %" B_PRIu32 "\n", multi->control_count);
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@@ -633,8 +634,9 @@ get_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
hda_multi_mixer_control *control = NULL;
|
||||
for (int32 i = 0; i < mmvi->item_count; i++) {
|
||||
id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= audioGroup->multi->control_count) {
|
||||
dprintf("hda: get_mix : invalid control id requested : %li\n", id);
|
||||
if (id < 0 || id >= (int32)audioGroup->multi->control_count) {
|
||||
dprintf("hda: get_mix : invalid control id requested : %" B_PRId32
|
||||
"\n", id);
|
||||
continue;
|
||||
}
|
||||
control = &audioGroup->multi->controls[id];
|
||||
@@ -645,7 +647,7 @@ get_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
get_control_gain_mute(audioGroup, control, resp);
|
||||
if ((control->mix_control.flags & B_MULTI_MIX_ENABLE) != 0) {
|
||||
mmvi->values[i].enable = (resp[0] & AMP_MUTE) != 0;
|
||||
TRACE("get_mix: %ld mute: %d\n", control->nid,
|
||||
TRACE("get_mix: %" B_PRId32 " mute: %d\n", control->nid,
|
||||
mmvi->values[i].enable);
|
||||
} else if ((control->mix_control.flags & B_MULTI_MIX_GAIN) != 0) {
|
||||
uint32 value;
|
||||
@@ -655,7 +657,8 @@ get_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
value = resp[1] & AMP_GAIN_MASK;
|
||||
mmvi->values[i].gain = (0.0 + value - AMP_CAP_OFFSET(control->capabilities))
|
||||
* AMP_CAP_STEP_SIZE(control->capabilities);
|
||||
TRACE("get_mix: %ld gain: %f (%ld)\n", control->nid, mmvi->values[i].gain, value);
|
||||
TRACE("get_mix: %" B_PRId32 " gain: %f (%" B_PRIu32 ")\n",
|
||||
control->nid, mmvi->values[i].gain, value);
|
||||
}
|
||||
|
||||
} else if ((control->mix_control.flags & B_MIX_MUX_MIXER) != 0) {
|
||||
@@ -668,7 +671,8 @@ get_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
| AMP_GET_LEFT_CHANNEL | AMP_GET_INPUT_INDEX(j));
|
||||
uint32 resp;
|
||||
if (hda_send_verbs(audioGroup->codec, &verb, &resp, 1) == B_OK) {
|
||||
TRACE("get_mix: %ld mixer %ld is %smute\n", control->nid,
|
||||
TRACE("get_mix: %" B_PRId32 " mixer %" B_PRIu32
|
||||
" is %smute\n", control->nid,
|
||||
j, (resp & AMP_MUTE) != 0 ? "" : "un");
|
||||
if ((resp & AMP_MUTE) == 0) {
|
||||
mmvi->values[i].mux = j;
|
||||
@@ -678,16 +682,16 @@ get_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
}
|
||||
}
|
||||
}
|
||||
TRACE("get_mix: %ld mixer: %ld\n", control->nid,
|
||||
mmvi->values[i].mux);
|
||||
TRACE("get_mix: %" B_PRId32 " mixer: %" B_PRIu32 "\n",
|
||||
control->nid, mmvi->values[i].mux);
|
||||
} else if ((control->mix_control.flags & B_MIX_MUX_SELECTOR) != 0) {
|
||||
uint32 verb = MAKE_VERB(audioGroup->codec->addr, control->nid,
|
||||
VID_GET_CONNECTION_SELECT, 0);
|
||||
uint32 resp;
|
||||
if (hda_send_verbs(audioGroup->codec, &verb, &resp, 1) == B_OK)
|
||||
mmvi->values[i].mux = resp & 0xff;
|
||||
TRACE("get_mix: %ld selector: %ld\n", control->nid,
|
||||
mmvi->values[i].mux);
|
||||
TRACE("get_mix: %" B_PRId32 " selector: %" B_PRIu32 "\n",
|
||||
control->nid, mmvi->values[i].mux);
|
||||
}
|
||||
}
|
||||
return B_OK;
|
||||
@@ -701,15 +705,17 @@ set_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
hda_multi_mixer_control *control = NULL;
|
||||
for (int32 i = 0; i < mmvi->item_count; i++) {
|
||||
id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= audioGroup->multi->control_count) {
|
||||
dprintf("set_mix : invalid control id requested : %li\n", id);
|
||||
if (id < 0 || id >= (int32)audioGroup->multi->control_count) {
|
||||
dprintf("set_mix : invalid control id requested : %" B_PRId32 "\n",
|
||||
id);
|
||||
continue;
|
||||
}
|
||||
control = &audioGroup->multi->controls[id];
|
||||
|
||||
if ((control->mix_control.flags & B_MULTI_MIX_ENABLE) != 0) {
|
||||
control->mute = (mmvi->values[i].enable ? AMP_MUTE : 0);
|
||||
TRACE("set_mix: %ld mute: %lx\n", control->nid, control->mute);
|
||||
TRACE("set_mix: %" B_PRId32 " mute: %" B_PRIx32 "\n", control->nid,
|
||||
control->mute);
|
||||
uint32 resp[2];
|
||||
get_control_gain_mute(audioGroup, control, resp);
|
||||
|
||||
@@ -722,7 +728,8 @@ set_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
| AMP_SET_INPUT_INDEX(control->index)
|
||||
| control->mute
|
||||
| (resp[0] & AMP_GAIN_MASK));
|
||||
TRACE("set_mix: sending verb to %ld: %lx %lx %x %lx\n", control->nid,
|
||||
TRACE("set_mix: sending verb to %" B_PRId32 ": %" B_PRIx32 " %"
|
||||
B_PRIx32 " %x %lx\n", control->nid,
|
||||
control->mute, resp[0] & AMP_GAIN_MASK, control->input,
|
||||
(control->input ? AMP_SET_INPUT : AMP_SET_OUTPUT)
|
||||
| AMP_SET_LEFT_CHANNEL
|
||||
@@ -737,15 +744,17 @@ set_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
| AMP_SET_INPUT_INDEX(control->index)
|
||||
| control->mute
|
||||
| (resp[1] & AMP_GAIN_MASK));
|
||||
TRACE("set_mix: ctrl2 sending verb to %ld: %lx %lx %x\n", control->nid,
|
||||
control->mute, resp[1] & AMP_GAIN_MASK, control->input);
|
||||
TRACE("set_mix: ctrl2 sending verb to %" B_PRId32 ": %" B_PRIx32
|
||||
" %" B_PRIx32 " %x\n", control->nid, control->mute,
|
||||
resp[1] & AMP_GAIN_MASK, control->input);
|
||||
hda_send_verbs(audioGroup->codec, verb, NULL, 2);
|
||||
} else if ((control->mix_control.flags & B_MULTI_MIX_GAIN) != 0) {
|
||||
hda_multi_mixer_control *control2 = NULL;
|
||||
if (i+1<mmvi->item_count) {
|
||||
id = mmvi->values[i + 1].id - MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= audioGroup->multi->control_count) {
|
||||
dprintf("set_mix : invalid control id requested : %li\n", id);
|
||||
if (id < 0 || id >= (int32)audioGroup->multi->control_count) {
|
||||
dprintf("set_mix : invalid control id requested : %"
|
||||
B_PRId32 "\n", id);
|
||||
} else {
|
||||
control2 = &audioGroup->multi->controls[id];
|
||||
if (control2->mix_control.master != control->mix_control.id)
|
||||
@@ -765,8 +774,9 @@ set_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
/ AMP_CAP_STEP_SIZE(control2->capabilities)
|
||||
+ AMP_CAP_OFFSET(control2->capabilities));
|
||||
}
|
||||
TRACE("set_mix: %ld gain: %lx and %ld gain: %lx\n",
|
||||
control->nid, control->gain, control2->nid, control2->gain);
|
||||
TRACE("set_mix: %" B_PRId32 " gain: %" B_PRIx32 " and %" B_PRId32
|
||||
" gain: %" B_PRIx32 "\n", control->nid, control->gain,
|
||||
control2->nid, control2->gain);
|
||||
uint32 resp[2];
|
||||
get_control_gain_mute(audioGroup, control, resp);
|
||||
control->mute = resp[0] & AMP_MUTE;
|
||||
@@ -782,7 +792,8 @@ set_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
| AMP_SET_INPUT_INDEX(control->index)
|
||||
| (control->mute & AMP_MUTE)
|
||||
| (control->gain & AMP_GAIN_MASK));
|
||||
TRACE("set_mix: sending verb to %ld: %lx %lx %x %lx\n", control->nid,
|
||||
TRACE("set_mix: sending verb to %" B_PRId32 ": %" B_PRIx32 " %"
|
||||
B_PRIx32 " %x %lx\n", control->nid,
|
||||
control->mute, control->gain, control->input,
|
||||
(control->input ? AMP_SET_INPUT : AMP_SET_OUTPUT)
|
||||
| AMP_SET_LEFT_CHANNEL
|
||||
@@ -798,16 +809,17 @@ set_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
| AMP_SET_INPUT_INDEX(control->index)
|
||||
| (control2->mute & AMP_MUTE)
|
||||
| (control2->gain & AMP_GAIN_MASK));
|
||||
TRACE("set_mix: ctrl2 sending verb to %ld: %lx %lx %x\n",
|
||||
control2->nid, control2->mute, control2->gain,
|
||||
control2->input);
|
||||
TRACE("set_mix: ctrl2 sending verb to %" B_PRId32 ": %"
|
||||
B_PRIx32 " %" B_PRIx32 " %x\n", control2->nid,
|
||||
control2->mute, control2->gain, control2->input);
|
||||
}
|
||||
hda_send_verbs(audioGroup->codec, verb, NULL, control2 ? 2 : 1);
|
||||
|
||||
if (control2)
|
||||
i++;
|
||||
} else if ((control->mix_control.flags & B_MIX_MUX_MIXER) != 0) {
|
||||
TRACE("set_mix: %ld mixer: %ld\n", control->nid, mmvi->values[i].mux);
|
||||
TRACE("set_mix: %" B_PRId32 " mixer: %" B_PRIu32 "\n",
|
||||
control->nid, mmvi->values[i].mux);
|
||||
hda_widget *mixer = hda_audio_group_get_widget(audioGroup,
|
||||
control->nid);
|
||||
uint32 verb[mixer->num_inputs];
|
||||
@@ -817,22 +829,24 @@ set_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
| AMP_SET_LEFT_CHANNEL | AMP_SET_RIGHT_CHANNEL
|
||||
| AMP_SET_INPUT_INDEX(j)
|
||||
| ((mmvi->values[i].mux == j) ? 0 : AMP_MUTE));
|
||||
TRACE("set_mix: %ld mixer %smuting %ld (%lx)\n", control->nid,
|
||||
TRACE("set_mix: %" B_PRId32 " mixer %smuting %" B_PRIu32 " (%"
|
||||
B_PRIu32 ")\n", control->nid,
|
||||
(mmvi->values[i].mux == j) ? "un" : "", j, verb[j]);
|
||||
}
|
||||
if (hda_send_verbs(audioGroup->codec, verb, NULL, mixer->num_inputs)
|
||||
!= B_OK)
|
||||
dprintf("hda: Setting mixer %ld failed on widget %ld!\n",
|
||||
mmvi->values[i].mux, control->nid);
|
||||
dprintf("hda: Setting mixer %" B_PRId32 " failed on widget %"
|
||||
B_PRIu32 "!\n", mmvi->values[i].mux, control->nid);
|
||||
} else if ((control->mix_control.flags & B_MIX_MUX_SELECTOR) != 0) {
|
||||
uint32 verb = MAKE_VERB(audioGroup->codec->addr, control->nid,
|
||||
VID_SET_CONNECTION_SELECT, mmvi->values[i].mux);
|
||||
if (hda_send_verbs(audioGroup->codec, &verb, NULL, 1) != B_OK) {
|
||||
dprintf("hda: Setting output selector %ld failed on widget "
|
||||
"%ld!\n", mmvi->values[i].mux, control->nid);
|
||||
dprintf("hda: Setting output selector %" B_PRId32 " failed on "
|
||||
"widget %" B_PRIu32 "!\n", mmvi->values[i].mux,
|
||||
control->nid);
|
||||
}
|
||||
TRACE("set_mix: %ld selector: %ld\n", control->nid,
|
||||
mmvi->values[i].mux);
|
||||
TRACE("set_mix: %" B_PRId32 " selector: %" B_PRIu32 "\n",
|
||||
control->nid, mmvi->values[i].mux);
|
||||
}
|
||||
}
|
||||
return B_OK;
|
||||
@@ -876,12 +890,12 @@ default_buffer_length_for_rate(uint32 rate)
|
||||
static status_t
|
||||
get_buffers(hda_audio_group* audioGroup, multi_buffer_list* data)
|
||||
{
|
||||
TRACE("playback: %ld buffers, %ld channels, %ld samples\n",
|
||||
data->request_playback_buffers, data->request_playback_channels,
|
||||
data->request_playback_buffer_size);
|
||||
TRACE("record: %ld buffers, %ld channels, %ld samples\n",
|
||||
data->request_record_buffers, data->request_record_channels,
|
||||
data->request_record_buffer_size);
|
||||
TRACE("playback: %" B_PRId32 " buffers, %" B_PRId32 " channels, %" B_PRIu32
|
||||
" samples\n", data->request_playback_buffers,
|
||||
data->request_playback_channels, data->request_playback_buffer_size);
|
||||
TRACE("record: %" B_PRId32 " buffers, %" B_PRId32 " channels, %" B_PRIu32
|
||||
" samples\n", data->request_record_buffers,
|
||||
data->request_record_channels, data->request_record_buffer_size);
|
||||
|
||||
/* Determine what buffers we return given the request */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user