Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: remove capture mixer setup from audio_init

On the 11e Yoga Gen 5, enabling capture switches/volume at boot (before
any capture PCM stream is open) puts the HDA codec into a bad state.
The original working code (90d8beeee) only touched playback controls
in audio_init. Capture mixer was added later in 693ea22c8.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+8 -12
+8 -12
fedac/native/src/audio.c
··· 552 552 audio->total_frames += AUDIO_PERIOD_SIZE; 553 553 audio->time = (double)audio->total_frames / rate; 554 554 555 + // Recording tap: send mixed PCM to recorder (if active) 556 + if (audio->rec_callback) 557 + audio->rec_callback(buffer, AUDIO_PERIOD_SIZE, audio->rec_userdata); 558 + 555 559 // Write to ALSA (handle short writes to avoid dropped samples/clicks) 556 560 snd_pcm_t *pcm = (snd_pcm_t *)audio->pcm; 557 561 int remaining = AUDIO_PERIOD_SIZE; ··· 853 857 fprintf(stderr, "[audio] Volume %s: %ld/%ld\n", name, max, max); 854 858 } 855 859 856 - // Ensure capture paths are enabled so mic input is not silently muted. 857 - if (snd_mixer_selem_has_capture_switch(elem)) { 858 - snd_mixer_selem_set_capture_switch_all(elem, 1); 859 - fprintf(stderr, "[audio] Capture switch ON: %s\n", name); 860 - } 861 - if (snd_mixer_selem_has_capture_volume(elem)) { 862 - long cmin, cmax; 863 - snd_mixer_selem_get_capture_volume_range(elem, &cmin, &cmax); 864 - long cset = cmin + ((cmax - cmin) * 9) / 10; // avoid clipping at absolute max 865 - snd_mixer_selem_set_capture_volume_all(elem, cset); 866 - fprintf(stderr, "[audio] Capture volume %s: %ld/%ld\n", name, cset, cmax); 867 - } 860 + // NOTE: Do NOT touch capture mixer controls here — on the 11e Yoga 861 + // Gen 5, enabling capture switches at boot (before any capture PCM 862 + // is open) puts the HDA codec into a bad state that causes EIO when 863 + // the capture stream is later opened with period/buffer params. 868 864 } 869 865 snd_mixer_close(mixer); 870 866 } else {