Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 84d6c39 in mainline


Ignore:
Timestamp:
2011-11-30T23:13:35Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
57cf3b3
Parents:
ac07a13
Message:

sb16: Drop support for 8bit format for now.

Looks like 8bit playback needs working dma8 channel (need to verify).

Location:
uspace/drv/audio/sb16
Files:
2 edited

Legend:

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

    rac07a13 r84d6c39  
    148148static inline size_t sample_count(uint8_t mode, size_t byte_count)
    149149{
    150         if (mode & DSP_MODE_16BIT) {
     150        // FIXME we only support 16 bit playback for now.
     151        return byte_count / 2;
     152
     153        if (mode & DSP_MODE_SIGNED) {
    151154                return byte_count / 2;
    152155        }
     
    256259
    257260        /* Check supported parameters */
    258         if (sample_size != 8 && sample_size != 16)
     261        if (sample_size != 16) // FIXME We only support 16 bit playback
    259262                return ENOTSUP;
    260263        if (channels != 1 && channels != 2)
     
    275278        dsp->playing.mode = 0;
    276279
    277         if (sample_size == 16)
    278                 dsp->playing.mode |= DSP_MODE_16BIT;
     280                dsp->playing.mode |= DSP_MODE_SIGNED;
    279281        if (channels == 2)
    280282                dsp->playing.mode |= DSP_MODE_STEREO;
  • uspace/drv/audio/sb16/dsp_commands.h

    rac07a13 r84d6c39  
    142142        SINGLE_DMA_16B_DA = 0xb0,     /* Followed by mode, size.low, size.high*/
    143143        SINGLE_DMA_16B_DA_FIFO = 0xb2,/* mode format is:                      */
    144         AUTO_DMA_16B_DA = 0xb4,       /*    0x00 - unsigned mono 8bit         */
    145         AUTO_DMA_16B_DA_FIFO = 0xb6,  /*    0x10 - signed mono 16bit          */
    146         SINGLE_DMA_16B_AD = 0xb8,     /*    0x20 - unsigned stereo 8bit       */
    147         SINGLE_DMA_16B_AD_FIFO = 0xba,/*    0x30 - signed stereo 16bit        */
     144        AUTO_DMA_16B_DA = 0xb4,       /*    0x00 - unsigned mono              */
     145        AUTO_DMA_16B_DA_FIFO = 0xb6,  /*    0x10 - signed mono                */
     146        SINGLE_DMA_16B_AD = 0xb8,     /*    0x20 - unsigned stereo            */
     147        SINGLE_DMA_16B_AD_FIFO = 0xba,/*    0x30 - signed stereo              */
    148148        AUTO_DMA_16B_AD = 0xbc,       /* Size is -1. Terminate by EXIT        */
    149149        AUTO_DMA_16B_AD_FIFO = 0xbe,  /* or switch to SINGLE_DMA              */
     
    151151        SINGLE_DMA_8B_DA = 0xc0,     /* Followed by mode, size.low, size.high */
    152152        SINGLE_DMA_8B_DA_FIFO = 0xc2,/* mode format is:                       */
    153         AUTO_DMA_8B_DA = 0xc4,       /*    0x00 - unsigned mono 8bit          */
    154         AUTO_DMA_8B_DA_FIFO = 0xc6,  /*    0x10 - signed mono 16bit           */
    155         SINGLE_DMA_8B_AD = 0xc8,     /*    0x20 - unsigned stereo 8bit        */
    156         SINGLE_DMA_8B_AD_FIFO = 0xca,/*    0x30 - signed stereo 16bit         */
     153        AUTO_DMA_8B_DA = 0xc4,       /*    0x00 - unsigned mono               */
     154        AUTO_DMA_8B_DA_FIFO = 0xc6,  /*    0x10 - signed mono                 */
     155        SINGLE_DMA_8B_AD = 0xc8,     /*    0x20 - unsigned stereo             */
     156        SINGLE_DMA_8B_AD_FIFO = 0xca,/*    0x30 - signed stereo               */
    157157        AUTO_DMA_8B_AD = 0xcc,       /* Size is -1. Terminate by EXIT         */
    158158        AUTO_DMA_8B_AD_FIFO = 0xce,  /* or switch to SINGLE_DMA               */
     
    163163} dsp_command_t;
    164164/*----------------------------------------------------------------------------*/
    165 #define DSP_MODE_16BIT 0x10
     165#define DSP_MODE_SIGNED 0x10
    166166#define DSP_MODE_STEREO 0x20
    167167
Note: See TracChangeset for help on using the changeset viewer.