Difference between revisions of "MIC Services"

From 3dbrew
Jump to navigation Jump to search
m (Name consistency, some constant values.)
Line 13: Line 13:
 
|-
 
|-
 
| 0x00030140
 
| 0x00030140
| [[MICU:Initialize|Initialize]]
+
| [[MICU:StartSampling|StartSampling]]
 
|-
 
|-
 
| 0x00040040
 
| 0x00040040
Line 28: Line 28:
 
|-
 
|-
 
| 0x00080040
 
| 0x00080040
| SetControl(u8 input). This is a wrapper for CDCMIC command 0x00010040.  
+
| SetGain(u8 input). This is a wrapper for CDCMIC command 0x00010040.  
 
|-
 
|-
 
| 0x00090000
 
| 0x00090000
| GetControl. This is a wrapper for CDCMIC command 0x00020000.
+
| GetGain. This is a wrapper for CDCMIC command 0x00020000.
 
|-
 
|-
 
| 0x000A0040
 
| 0x000A0040
Line 59: Line 59:
 
Only one session can be open for this service total(that is, only one process can use this service at a time).
 
Only one session can be open for this service total(that is, only one process can use this service at a time).
  
=Control value=
+
'''enum Encoding'''
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Bit
+
Enum
Description
+
Value
 
|-
 
|-
| 6-0
+
| ENCODING_PCM8
| Amplification, 0=none.
+
| 0
 
|-
 
|-
| 7
+
| ENCODING_PCM16
| Doesn't affect output audio data in shared-mem?
+
| 1
 +
|-
 +
| ENCODING_PCM8_SIGNED
 +
| 2
 +
|-
 +
| ENCODING_PCM16_SIGNED
 +
| 3
 +
|}
 +
 
 +
'''enum SampleRate'''
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Enum
 +
!  Value
 +
|-
 +
| SAMPLE_RATE_32730
 +
| 0
 +
|-
 +
| SAMPLE_RATE_16360
 +
| 1
 +
|-
 +
| SAMPLE_RATE_10910
 +
| 2
 +
|-
 +
| SAMPLE_RATE_8180
 +
| 3
 
|}
 
|}
  
 
=See Also=
 
=See Also=
 
[[MIC Shared Memory]]
 
[[MIC Shared Memory]]

Revision as of 03:03, 9 October 2015

Microphone service "mic:u"

Command Header Description
0x00010042 MapSharedMem
0x00020000 UnmapSharedMem
0x00030140 StartSampling
0x00040040 AdjustSampling(u8 input)
0x00050000 StopSampling
0x00060000 IsSampling
0x00070000 GetEventHandle. This event is signaled by MIC-module when more audio-data is available in shared-mem.
0x00080040 SetGain(u8 input). This is a wrapper for CDCMIC command 0x00010040.
0x00090000 GetGain. This is a wrapper for CDCMIC command 0x00020000.
0x000A0040 SetBias(u8 input). This is a wrapper for CDCMIC command 0x00030040. 0 = disable recording, 1 = enable recording. When recording is disabled with this, MIC-module writes value 0xFFFF to the output audio sample data in shared-mem, since that's what the MIC hardware returns here.
0x000B0000 GetBias. This is a wrapper for CDCMIC command 0x00040000.
0x000C0042 (size, <translate-header>, bufptr) This is a wrapper for CDCMIC command 0x00050042.
0x000D0040 SetClamp(u8 input) This writes the input value to a MIC-module state field.
0x000E0000 GetClamp. This writes the u8 value of the MIC-module field also used by command 0x000D0040, to cmdreply indexword[2].
0x000F0040 (u8 input) This writes the input u8 value to a MIC-module state field.
0x00100040 When the input value is 0, value 1 is written to an u8 MIC module state field. Otherwise, value 0 is written there. Normally the input value is non-zero.

This is an interface for using the MIC hardware via the "cdc:MIC" service and the MIC IO registers.

Only one session can be open for this service total(that is, only one process can use this service at a time).

enum Encoding

Enum Value
ENCODING_PCM8 0
ENCODING_PCM16 1
ENCODING_PCM8_SIGNED 2
ENCODING_PCM16_SIGNED 3

enum SampleRate

Enum Value
SAMPLE_RATE_32730 0
SAMPLE_RATE_16360 1
SAMPLE_RATE_10910 2
SAMPLE_RATE_8180 3

See Also

MIC Shared Memory