Доработка звука

Материал из Toshiba AC100 wiki
Перейти к навигации Перейти к поиску

Небольшое теоретическое вступление об устройстве кодека и работе. Основано на первоначальной вверсии драйвера alc5632 и некоторые вещи уже не актуальны.

Иногда требуется посмотреть состояние регистров кодека. Лучше всего это делать по специальному мануалу, т.к. дамп от debugfs не всегда актуален.

Основная разработка кодека на данный момент идет в ветке chromeos-ac100-3.0-exp, созданной leonro. В ней код основательно почищен и приведен к нормальному виду, допилен немного DAPM (контролы и роуты), ...

План работ

  • ГОТОВО исправить suspend/reusme (патчи в проверке)
  • ГОТОВО мердж новой имплементации кодека в ветку марвина
  • ГОТОВО отсортировать контролы в алсамиксере, чтобы регуляторы громкости были в начале
  • ГОТОВО сделать джулианку приятное, исправить ему nvec (это мое, он меня уже достал с этим)
  • доразобрать весь пауер менеджмент - добить патч для мейнлайна
  • ГОТОВО cделать автоопределение наушников. Отчасти детект наушников работает, т.к. DAPM значения меняет если их втыкать/вытыкать. Нужно отключать спикеры научиться. Возможно нужно просто раскоментировать код в paz00.c Отчасти детект на совести ос. Для андроида делали патч с использованием switch'ей.
  • ГОТОВО микрофон - начиная с ядер версии 3.0.19
  • ГОТОВО разобраться с выставлением регистров под разные частоты
  • ГОТОВО alsa use case manager - ubuntu 12.10
  • ГОТОВО звук через hdmi (TODO: в мейнлайн)


Mainline

Кодек в мейнлайне (в 3.8 точно есть), hdmi-audio - надо пушить.

Микрофон

Поддерживается в 3.0-exp (ядро 3.0.19 armel/armhf

[20:45:05] <gildean> yes, it's a four-headed minijack
[20:45:48] <gildean> the first part of the plug is mic+ the second is hpr+ then hpl+ and last the ground
[20:47:00] <gildean> so both the normal headphone plug and the longer headset-plug work but the mic should be activated only with the latter

Cогласно этому сообщениюс форума xda-developers.com существуют два TRRS стандарта:

The Nokia TRRS standard is what everything else uses, Tip = Left channel, first Ring = Right channel,
second Ring = Mic/Control feed, Sleeve = Ground.
The Apple TRRS standard uses, Tip = Left channel, first Ring = Right channel, second Ring = Ground,
Sleeve = Mic/Control feed.

<range type="comment" id="459504">При этом ни один из них нам не подходит</range id="459504"> Подходит Apple TRRS (схема джека)

USB Audio

Достаточно включить CONFIG_SND_USB в .config

CONFIG_SND_USB=y

Баги

  http://pastebin.com/LdCu1FeJ
  http://pastebin.ubuntu.com/869998/
  • Выключение одного из контролов [Master, Speaker, Headphone] ведет к выключению двух других (проявляется не у всех).
  • <PaulFertser> stuw_: i have no snd_soc_dapm_force_enable_pin(dapm, "MICBIAS1"); but it feels like some daps is not enabled when recording is not active even though it's selected by "HP Mix MIC12HP". If i start arecord, the mic starts to work and works for as long as i do not start and stop aplay = i see "issues" when i do not play and do not record at all but expect for the mic sound to be heard if i enabled the right switches in alsamixer. (fyi, the tests were done along the lines of ``sox testmusic.wav -t wav -r 8000 - | aplay -v -Dhw:0,0 -)
  • <PaulFertser> stuw_: another bugreport: i tried rmmoding all the asoc modules and then loading again and got tegra-snd-alc5632.0: ASoC: Failed to create codec debugfs directory

TODO

PaulFertser: the cool trick: cherry-pick f0e8ed858edb327802ee65fd695cc1538286226f , save http://paste.debian.net/155051/ to /usr/share/alsa/cards/tegra-alc5632.conf , the default alsa pcm device will be dmix, as it is for the other common soundcards that do not support hardware mixing. http://mailman.alsa-project.org/pipermail/alsa-devel/2011-September/044089.html http://paste.debian.net/155055/ <PaulFertser> nifty trick to have per-application volume controls _without PA_, just plain standard ALSA: http://paste.debian.net/155190/ <PaulFertser> it can be combined with anything of course. If your default pcm is dmix (which happens automatically if the tegra-alc5632.conf is in place) then it's already combined. <PaulFertser> aplay -v in fact outputs the whole chain.