try to align the offset to be more compliant
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33047 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -119,13 +119,6 @@ stream_handle_interrupt(hda_controller* controller, hda_stream* stream)
|
|||||||
stream->frames_count += stream->buffer_length;
|
stream->frames_count += stream->buffer_length;
|
||||||
stream->buffer_cycle = position / bufferSize;
|
stream->buffer_cycle = position / bufferSize;
|
||||||
|
|
||||||
// playback interrupts come early, offsets don't work on non intel
|
|
||||||
// TODO find out why
|
|
||||||
if (stream->type == STREAM_PLAYBACK
|
|
||||||
&& stream->controller->pci_info.vendor_id != INTEL_VENDORID) {
|
|
||||||
stream->buffer_cycle++;
|
|
||||||
}
|
|
||||||
|
|
||||||
release_spinlock(&stream->lock);
|
release_spinlock(&stream->lock);
|
||||||
|
|
||||||
release_sem_etc(controller->buffer_ready_sem, 1, B_DO_NOT_RESCHEDULE);
|
release_sem_etc(controller->buffer_ready_sem, 1, B_DO_NOT_RESCHEDULE);
|
||||||
@@ -563,13 +556,18 @@ hda_stream_setup_buffers(hda_audio_group* audioGroup, hda_stream* stream,
|
|||||||
// TODO check on other vendors, see in stream_handle_interrupt()
|
// TODO check on other vendors, see in stream_handle_interrupt()
|
||||||
// Tested only on Intel ICH8
|
// Tested only on Intel ICH8
|
||||||
uint32 offset = 0;
|
uint32 offset = 0;
|
||||||
if (stream->type == STREAM_PLAYBACK && stream->controller->pci_info.vendor_id == INTEL_VENDORID) {
|
if (stream->type == STREAM_PLAYBACK) {
|
||||||
if (stream->sample_size == 2)
|
if (stream->controller->pci_info.vendor_id == INTEL_VENDORID) {
|
||||||
offset = 6;
|
if (stream->sample_size == 2)
|
||||||
else if (stream->sample_size > 2)
|
offset = 3;
|
||||||
offset = 8;
|
else if (stream->sample_size > 2)
|
||||||
|
offset = 4;
|
||||||
|
} else {
|
||||||
|
offset = 11;
|
||||||
|
}
|
||||||
|
offset *= 64;
|
||||||
|
offset = ALIGN(offset, 128);
|
||||||
}
|
}
|
||||||
offset *= 32;
|
|
||||||
|
|
||||||
/* Calculate size of buffer (aligned to 128 bytes) */
|
/* Calculate size of buffer (aligned to 128 bytes) */
|
||||||
bufferSize = stream->sample_size * stream->num_channels
|
bufferSize = stream->sample_size * stream->num_channels
|
||||||
|
|||||||
Reference in New Issue
Block a user