Changeset 962ef67 in mainline


Ignore:
Timestamp:
2011-10-22T08:45:56Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5984107
Parents:
dce7e41
Message:

sb16: Fix offset by one, zero device buffer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/sb16/dsp.c

    rdce7e41 r962ef67  
    114114                dsp->buffer.position = buffer;
    115115                dsp->buffer.size = BUFFER_SIZE;
    116                 memset(buffer, 0x8f, BUFFER_SIZE);
     116                bzero(buffer, BUFFER_SIZE);
    117117                dma_prepare_channel(SB_DMA_CHAN_16, false, true, BLOCK_DMA);
    118118                /* Set 8bit channel */
     
    196196                sb_dsp_write(dsp, SINGLE_DMA_16B_DA);
    197197                sb_dsp_write(dsp, dsp->playing.mode);
    198                 sb_dsp_write(dsp, remain_size & 0xff);
    199                 sb_dsp_write(dsp, remain_size >> 8);
     198                sb_dsp_write(dsp, (remain_size - 1) & 0xff);
     199                sb_dsp_write(dsp, (remain_size - 1) >> 8);
    200200                return;
    201201        }
     
    262262        sb_dsp_write(dsp, AUTO_DMA_16B_DA_FIFO);
    263263        sb_dsp_write(dsp, dsp->playing.mode);
    264         sb_dsp_write(dsp, play_size & 0xff);
    265         sb_dsp_write(dsp, play_size >> 8);
     264        sb_dsp_write(dsp, (play_size - 1) & 0xff);
     265        sb_dsp_write(dsp, (play_size - 1) >> 8);
    266266
    267267        return EOK;
Note: See TracChangeset for help on using the changeset viewer.