# DA7212 Audio Codec HAT V34 Test Method

## Playback

```bash
sg-audio-test hp
```

## Headset MIC / MIC1 recording, no trimming

```bash
sg-audio-test headset-mic
```

## Onboard MIC tests, no trimming

```bash
sg-audio-test onboard-mic         # U1 + U2 together, MIC2 differential mode
sg-audio-test onboard-mic-p       # U1 -> MIC2_P only
sg-audio-test onboard-mic-n       # U2 -> MIC2_N only
sg-audio-test onboard-mic-compare # records U1 first, then U2
```

The generated files are:

```text
/tmp/sg_onboard_mic_two_mics_diff_48k_s16.wav
/tmp/sg_onboard_mic_u1_mic2_p_48k_s16.wav
/tmp/sg_onboard_mic_u2_mic2_n_48k_s16.wav
```

## Longer recording

```bash
SG_AUDIO_RECORD_SECONDS=15 sg-audio-test onboard-mic-p
```

## Mono WAV recording

```bash
SG_AUDIO_CHANNELS=1 sg-audio-test onboard-mic-p
```


### SPK direct output test

The DA7212 direct SPK output can be tested with:

```bash
sg-audio-test spk xxx.wav
```

The DA7212 SPK / Lineout output volume can be adjusted with:

```bash
sg-audio volume spk 55
```

The recommended adjustment order is:

```bash
sg-audio spk
sg-audio volume dac 100
sg-audio volume spk 55
sg-audio-test spk xxx.wav
```


### V34 DAC volume cap

The DA7212 DAC playback volume is limited to 100 in this test driver.

```bash
sg-audio volume dac 100
sg-audio volume dac 127   # request is accepted but capped to 100
```

The purpose of this limit is to avoid DA7212/APA2068 overdrive and reduce high-volume noise.
