sound, SB, AC97 и другое

Drivers for sound cards
  • Asper wrote:
    yogev_ezra wrote:Есть ещё 3 системы, на которых не заработало, но там пока не могу никак сохранить логи:
    Не работают ни клава, ни крыса, всё виснет Как смогу, выложу здесь.
    Виснет из-за драйвера HDA? Что за конфигурации?
    Да в том-то и дело, что непонятно, из-за чего. Предполагаю, что из-за драйвера USB.
    Но на 2 из 3 систем нет вообще входов PS/2, только USB, так что деваться некуда.

    А 3-я система (Intel D510MO) практически идентична Zotac NM10-ITX (которая работает отлично).
    Разница между Intel D510MO и Zotac NM10-ITX только в конденсаторах, транзисторах и т.д.
    Все абсолютно чипы идентичны, включая HDA controller + HDA codec. Ну и BIOS другой, понятно.
    В этой системе, думаю, глючный BIOS у Интел, хотя в Windows XP / Windows 7 обе работают нормально.
  • hidnplayr
    Sound driver uses interrupt to know that the buffer with samples has processed and to change buffer to the next one (already filled by Infinity with new portion of samples) and to say Infinity to refill the old buffer, there are 2 buffers in HDA drivers that changed one by one (like a round robin) on every interrupt. So if the interrupt comes too early it means that not all samples will be outputed and you will heare some noise, like click noise.

    If you want it, I can write here how sound driver and the whole KolibriOS sound system work in general.
  • yogev_ezra

    Если виснет при загрузке, то тут явно не в HDA дело. А USB да не все BIOS эмулируют как PS/2 (тем более если PS/2 порта нет). Если двоеточие в часах на панели мигает, значит система не висит, а не работают USB устройства.
  • Asper

    с кнопкой уже порядок, но проблема в том что воспроизведения нет, и полоска не движется в плеере, прости, не сказал сразу, думал это связано с блокировкой звука...
    лог ниже...
    Attachments
    BOARDLOG.TXT (1.48 KiB)
    Downloaded 194 times
    *****:
    ;дух машины, мой бубен сильнее твоей тупости

    *****:
  • Asper wrote:If you want it, I can write here how sound driver and the whole KolibriOS sound system work in general.
    Yes, please!
    (Wiki needs such an article)
  • ДедОк

    Прерывания почему-то не генерируются. Сними пожалуйста ещё полный лог с 017fd и ещё проверь не используется ли прерывания HDA контроллера ещё кем-то (запусти pcidev).

    P.S. Кстати pcidev в стандартной сборке пишет Unknown на контроллеры HDA.
  • art_zh
    I'll try to write it here and in brief for now. Maybe Serge will made some notes on sound system documentation. :wink:
  • Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
    hda_codec: ALC259: BIOS auto-probing

    Работает.
    Attachments
    BOARDLOG.TXT (1.33 KiB)
    Downloaded 201 times
  • Foldl
    Спасибо за тест. Congratulations! :)
  • Здравствуйте, попробовал на своём компе
    Intel(R) Core(TM)2 Quad CPU Q8300 @ 2.50GHz
    Графика ATI Radeon HD 5700 Series
    Память (RAM) 2,00 ГБ
    Мать P5KPL-AM SE
    с USB мышью не грузится, доходит до черного экрана, пытается определить мышь и виснет. С обычной мышкой загрузилось как то странно - черный экран и все программы пришлось запускать вручную, потом опять всё повисло... видно не судьба..
  • Not much for now.

    KolibriOS sound system layers.
    layers.PNG
    layers.PNG (21.28 KiB)
    Viewed 5039 times
    You can compare it with this picture on this page.

    Application that wants to output sound have to
    1. create buffer using SND_CREATE_BUFF service routine of Infinity
    2. set format of the buffer using SND_SET_FORMAT service routine of Infinity
    3. start playing using SND_PLAY service routine of Infinity
    4. Update the sound samples in the buffer

    Infinity get samples from all sound buffers of all applications that output sound and mix them together in one buffer that is given to Infinity by sound.obj.

    When the Infinity is called for the first time it inits itself and then calling sound.obj init it also.
    Infinity call DEV_CALLBACK servise routine of sound.obj to insert address of callback function to [ctrl.user_callback] variable. Sound.obj is responsible for calling this callback function every time when IRQ generated on end of processing buffer. So callback called in IRQ handler tesing if interrupt comes on end of buffer event (there are can be different events on which the same interrupt is generated). There can be e.g. 2 buffers (like in HDA) that sound.obj is responsible to change one by one. One buffer is given to Infinity to refill it with new portion of samples, while the second is outputed by souncard.

    Here is HDA IRQ handler, where you can see piece of code that changes buffers and call callback function of Infinity (I have selected that piece by ;!!!!!!!!!!! [ .... ;!!!!!!!!!!! ] brackets).

    Code: Select all

    align 4
    proc hda_irq   ;+
    ;     if DEBUG_IRQ
    ;           mov esi, msgIRQ
    ;           call SysMsgBoardStr
    ;     end if
    	   mov	 edx, ICH6_REG_INTSTS
    	   call  azx_readl
    	   test  eax, eax
    	   jnz	 @f
    	   popa
    	   ret
      @@:
    ;!!!!!!!!!!! [
    	   mov	 ebx, eax ; status
    	   mov	 eax, 1 shl 4
    	   test  ebx, eax
    	   jz	 @f
    
    	   mov	  al, SD_INT_MASK
    	   mov	 edx, ICH6_REG_SD_STS + SDO0_SD_OFFSET
    	   call  azx_writeb
    
    	   mov	 eax, [civ_val]
    	   inc	 eax
    	   and	 eax, 1
    	   mov	 [civ_val], eax
    
    	   mov	 ebx, dword [buff_list+eax*4]
    	   cmp	 [ctrl.user_callback], 0
    	   je	 @f
    	   stdcall [ctrl.user_callback], ebx[/b]
    ;!!!!!!!!!!! ]
      @@:
    
    	   ; clear rirb int
    	   mov	 edx, ICH6_REG_RIRBSTS
    	   call  azx_readb
    
    	   test  al, RIRB_INT_MASK
    	   jz	 .l1
    	   test  al, RIRB_INT_RESPONSE
    	   jz	 @f
    
    	   call  azx_update_rirb
      @@:
    	   mov	  al, RIRB_INT_MASK
    	   mov	 edx, ICH6_REG_RIRBSTS
    	   call  azx_writeb
      .l1:
    
    	   ret
    endp
    Sound.obj also is responsible for creating that sound buffers that will be read by souncard and filled by Infinity. Every buffer have to be page aligned and to have size = 16 Kb.

    So for two buffers we have such a code

    Code: Select all

    	   stdcall KernelAlloc, 0x8000
    	   mov [ctrl.buffer], eax
    
    	   mov edi, eax
    	   mov ecx, 0x8000/4
    	   xor eax, eax
    	   cld
    	   rep stosd
    Infinity need not know how the sound is outputed by the sound card it is the matter of sound.obj to operate with it. All that Infinity have to know is address of the sound buffer and when to fill it (all this information is given to it by sound.obj). So such an approach gives us HAL (hardware abstraction layer) that makes KolibriOS sound system universal and usefull for any soundcard.

    This what I can say you in brief about KolibriOS sound system.
    Later I will tell you about HDA controller, codecs and output devices interraction. :wink:
  • Roverman
    Попробуй убрать ATIKMS из автозагрузки.
    На этапе инициализации (черный экран с логом системы), если сразу не грузится попробуй нажать Enter.
  • Foldl wrote:Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
    hda_codec: ALC259: BIOS auto-probing
    Работает.
    Маленькое замечание: наверное это всё-таки Realtek ALC269 (так в логе указано)
    Asper wrote:yogev_ezra
    Если виснет при загрузке, то тут явно не в HDA дело. А USB да не все BIOS эмулируют как PS/2 (тем более если PS/2 порта нет). Если двоеточие в часах на панели мигает, значит система не висит, а не работают USB устройства.
    Спасибо за идею с часами, сам бы ни за что не догадался :idea: Проверю - отпишусь!
  • yogev_ezra wrote:Маленькое замечание: наверное это всё-таки Realtek ALC269 (так в логе указано)

    Code: Select all

    dmesg | grep hd
    Дает именно эту строчку (259), перепроверил. Что там на самом деле не знаю, нужно еще разбираться.
  • Who is online

    Users browsing this forum: No registered users and 11 guests