Доработка звука: различия между версиями

Материал из Toshiba AC100 wiki
Перейти к навигации Перейти к поиску
Нет описания правки
 
м (Fix formatting)
 
(не показаны 2 промежуточные версии 2 участников)
Строка 6: Строка 6:


==План работ==  
==План работ==  
- ГОТОВО исправить suspend/reusme (патчи в проверке)
* ГОТОВО исправить suspend/reusme (патчи в проверке)
- ГОТОВО мердж новой имплементации кодека в [https://gitorious.org/%7Emarvin24/ac100/marvin24s-kernel/commits/chromeos-ac100-2.6.38 ветку марвина]
* ГОТОВО мердж новой имплементации кодека в [https://gitorious.org/%7Emarvin24/ac100/marvin24s-kernel/commits/chromeos-ac100-2.6.38 ветку марвина]
- ГОТОВО отсортировать контролы в алсамиксере, чтобы регуляторы громкости были в начале
* ГОТОВО отсортировать контролы в алсамиксере, чтобы регуляторы громкости были в начале
- ГОТОВО сделать джулианку приятное, исправить ему nvec (это мое, он меня уже достал с этим)
* ГОТОВО сделать джулианку приятное, исправить ему nvec (это мое, он меня уже достал с этим)
- доразобрать весь пауер менеджмент - добить патч для мейнлайна
* доразобрать весь пауер менеджмент - добить патч для мейнлайна
- ГОТОВО cделать автоопределение наушников. Отчасти детект наушников работает, т.к. DAPM значения меняет если их втыкать/вытыкать. Нужно отключать спикеры научиться. Возможно нужно просто раскоментировать код в paz00.c Отчасти детект на совести ос. Для андроида делали патч с использованием switch'ей.
* ГОТОВО cделать автоопределение наушников. Отчасти детект наушников работает, т.к. DAPM значения меняет если их втыкать/вытыкать. Нужно отключать спикеры научиться. Возможно нужно просто раскоментировать код в paz00.c Отчасти детект на совести ос. Для андроида делали патч с использованием switch'ей.
- ГОТОВО микрофон - начиная с ядер версии 3.0.19
* ГОТОВО микрофон - начиная с ядер версии 3.0.19
- ГОТОВО разобраться с выставлением регистров под разные частоты
* ГОТОВО разобраться с выставлением регистров под разные частоты
- ГОТОВО [[alsa_ucm|alsa use case manager]] - ubuntu 12.10
* ГОТОВО [[Alsaucm|alsa use case manager]] - ubuntu 12.10
- ГОТОВО [[hdmi_audio|звук через hdmi]] (TODO: в мейнлайн)
* ГОТОВО [[hdmi_audio|звук через hdmi]] (TODO: в мейнлайн)




Строка 24: Строка 24:
Поддерживается в 3.0-exp (ядро 3.0.19 [http://startx.ro/~jani/linux-image-3.0.19-1-ac100_3.0.19-1.1_armel.deb armel]/[http://startx.ro/~jani/linux-image-3.0.19-1-ac100_3.0.19-1.1_armhf.deb armhf]
Поддерживается в 3.0-exp (ядро 3.0.19 [http://startx.ro/~jani/linux-image-3.0.19-1-ac100_3.0.19-1.1_armel.deb armel]/[http://startx.ro/~jani/linux-image-3.0.19-1-ac100_3.0.19-1.1_armhf.deb armhf]


<pre>
[20:45:05] <gildean> yes, it's a four-headed minijack
[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: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
[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
</pre>


Cогласно [http://forum.xda-developers.com/showpost.php?p=11958098&postcount=15 этому сообщению]с форума xda-developers.com существуют два TRRS стандарта:
Cогласно [http://forum.xda-developers.com/showpost.php?p=11958098&postcount=15 этому сообщению]с форума xda-developers.com существуют два TRRS стандарта:
Строка 46: Строка 48:


===Баги===
===Баги===
- [[snd_pcm_avail problem|Проблема с размером буффера]]
* [[snd_pcm_avail problem|Проблема с размером буффера]]
   http://pastebin.com/LdCu1FeJ
   http://pastebin.com/LdCu1FeJ
   http://pastebin.ubuntu.com/869998/
   http://pastebin.ubuntu.com/869998/
- Выключение одного из контролов [Master, Speaker, Headphone] ведет к выключению двух других (проявляется не у всех).
* Выключение одного из контролов [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_: 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
* <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===
===TODO===

Текущая версия от 08:12, 2 августа 2016

Небольшое теоретическое вступление об устройстве кодека и работе. Основано на первоначальной вверсии драйвера 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.