Changeset 84d6c39 in mainline
- Timestamp:
- 2011-11-30T23:13:35Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 57cf3b3
- Parents:
- ac07a13
- Location:
- uspace/drv/audio/sb16
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/dsp.c
rac07a13 r84d6c39 148 148 static inline size_t sample_count(uint8_t mode, size_t byte_count) 149 149 { 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) { 151 154 return byte_count / 2; 152 155 } … … 256 259 257 260 /* Check supported parameters */ 258 if (sample_size != 8 && sample_size != 16)261 if (sample_size != 16) // FIXME We only support 16 bit playback 259 262 return ENOTSUP; 260 263 if (channels != 1 && channels != 2) … … 275 278 dsp->playing.mode = 0; 276 279 277 if (sample_size == 16) 278 dsp->playing.mode |= DSP_MODE_16BIT; 280 dsp->playing.mode |= DSP_MODE_SIGNED; 279 281 if (channels == 2) 280 282 dsp->playing.mode |= DSP_MODE_STEREO; -
uspace/drv/audio/sb16/dsp_commands.h
rac07a13 r84d6c39 142 142 SINGLE_DMA_16B_DA = 0xb0, /* Followed by mode, size.low, size.high*/ 143 143 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 */ 148 148 AUTO_DMA_16B_AD = 0xbc, /* Size is -1. Terminate by EXIT */ 149 149 AUTO_DMA_16B_AD_FIFO = 0xbe, /* or switch to SINGLE_DMA */ … … 151 151 SINGLE_DMA_8B_DA = 0xc0, /* Followed by mode, size.low, size.high */ 152 152 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 */ 157 157 AUTO_DMA_8B_AD = 0xcc, /* Size is -1. Terminate by EXIT */ 158 158 AUTO_DMA_8B_AD_FIFO = 0xce, /* or switch to SINGLE_DMA */ … … 163 163 } dsp_command_t; 164 164 /*----------------------------------------------------------------------------*/ 165 #define DSP_MODE_ 16BIT0x10165 #define DSP_MODE_SIGNED 0x10 166 166 #define DSP_MODE_STEREO 0x20 167 167
Note:
See TracChangeset
for help on using the changeset viewer.