52,7 → 52,6 |
} |
|
; retrieve the default device type from the default config value |
|
proc defcfg_type stdcall, node:dword |
push edx |
mov edx, [node] |
93,7 → 92,6 |
ret |
endp |
|
|
; destructor |
proc snd_hda_generic_free |
push eax ebx edx edi |
112,19 → 110,19 |
cmp eax, edi |
je @f |
pusha |
call Kfree ;free conn_list |
invoke Kfree ;free conn_list |
popa |
@@: |
mov eax, edx |
mov edx, [edx + HDA_GNODE.next] |
pusha |
call Kfree ;free node |
invoke Kfree ;free node |
popa |
jmp .next |
.free_head: |
mov eax, [spec.nid_list] |
pusha |
call Kfree ;free the very 1st node in the list |
invoke Kfree ;free the very 1st node in the list |
popa |
mov [spec.nid_list], 0 |
.out: |
138,7 → 136,7 |
push ebx ecx edx edi esi |
|
mov eax, HDA_GNODE.sizeof |
call Kmalloc |
invoke Kmalloc |
test eax, eax |
jz .err_out ; Not enough memory |
|
160,7 → 158,7 |
|
mov eax, HDA_MAX_CONNECTIONS*2 ;HDA_MAX_CONNECTIONS * sizeof(word) |
push ebx ecx edx |
call Kmalloc ;malloc temporary conn_list |
invoke Kmalloc ;malloc temporary conn_list |
pop edx ecx ebx |
mov edi, eax |
|
174,7 → 172,7 |
|
mov eax, edx |
pusha |
call Kfree ;free node |
invoke Kfree ;free node |
popa |
mov eax, ecx |
jmp .out |
192,7 → 190,7 |
mov eax, ecx |
shl ecx, 1 |
push ebx ecx edx edi |
call Kmalloc ;malloc conn_list |
invoke Kmalloc ;malloc conn_list |
pop edi edx ecx ebx |
shr ecx, 1 |
test eax, eax |
200,7 → 198,7 |
|
mov eax, edi |
pusha |
call Kfree ;free temporary conn_list |
invoke Kfree ;free temporary conn_list |
popa |
jmp .err_out |
@@: |
264,20 → 262,20 |
; if DEBUG |
; push eax esi |
; mov esi, msgBeeperNid |
; call SysMsgBoardStr |
; invoke SysMsgBoardStr |
; push eax |
; mov eax, [nid] |
; stdcall fdword2str, 2 |
; call SysMsgBoardStr |
; invoke SysMsgBoardStr |
; |
; mov esi, msgBeeperValue |
; call SysMsgBoardStr |
; invoke SysMsgBoardStr |
; pop eax |
; stdcall fdword2str, 2 |
; call SysMsgBoardStr |
; invoke SysMsgBoardStr |
; |
; mov esi, msgBeepNow |
; call SysMsgBoardStr |
; invoke SysMsgBoardStr |
; pop esi eax |
; end if |
; mov ecx, 256*1 |
294,9 → 292,9 |
; if DEBUG |
; ;push eax esi |
; mov esi, msgBeeperValue |
; call SysMsgBoardStr |
; invoke SysMsgBoardStr |
; stdcall fdword2str, 2 |
; call SysMsgBoardStr |
; invoke SysMsgBoardStr |
; ;pop esi eax |
; end if |
; .not_beeper: |
367,7 → 365,7 |
.out: |
mov eax, edi |
pusha |
call Kfree ;free temporary conn_list |
invoke Kfree ;free temporary conn_list |
popa |
xor eax, eax |
pop esi edi edx ecx ebx |
376,7 → 374,7 |
.err_out: |
mov eax, edx |
pusha |
call Kfree ;free node |
invoke Kfree ;free node |
popa |
xor eax, eax |
dec eax |
411,7 → 409,7 |
if FDEBUG |
push esi |
mov esi, emsgInvalidAFGSubtree |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
pop esi |
end if |
xor eax, eax |
437,7 → 435,34 |
ret |
endp |
|
;Asper+[ |
proc print_afg_tree_nodes |
push eax esi edi |
mov esi, msgNodeSeq |
invoke SysMsgBoardStr |
|
mov edi, [spec.nid_list] |
test edi, edi |
jz .out |
.next_node: |
movzx eax, word [edi + HDA_GNODE.nid] |
mov esi, msgNID |
invoke SysMsgBoardStr |
stdcall fdword2str, 3 |
invoke SysMsgBoardStr |
|
mov eax, [edi + HDA_GNODE.next] |
test eax, eax |
jz .out |
|
mov edi, eax |
jmp .next_node |
.out: |
pop edi esi eax |
ret |
endp |
;Asper+] |
|
; look for the node record for the given NID |
proc hda_get_node stdcall, nid:dword |
push ebx edx esi |
480,10 → 505,10 |
if DEBUG |
push eax esi |
mov esi, msgEnableEAPD |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
mov eax, ebx |
stdcall fdword2str, 3 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
pop esi eax |
end if |
.out: |
494,7 → 519,6 |
|
; unmute (and set max vol) the output amplifier |
proc unmute_output stdcall, node:dword |
|
push ebx ecx edx esi |
mov esi, [node] |
test [esi + HDA_GNODE.wid_caps], AC_WCAP_OUT_AMP |
503,9 → 527,9 |
if DEBUG |
push esi |
mov esi, msgUnmuteOut |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
stdcall fdword2str, 3 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
pop esi |
end if |
|
528,27 → 552,23 |
if DEBUG |
push eax esi |
mov esi, msgAmpVal |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
stdcall fdword2str, 1 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
|
mov esi, strSemicolon |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
mov eax, ecx |
stdcall fdword2str, 3 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
pop esi eax |
end if |
mov [volume.out_amp_node], esi |
inc al |
mov [volume.num_steps], al |
inc cl |
mov [volume.step_size], cl |
mul cl |
shr eax, 2 |
imul eax, 100 |
imul eax, (100/4) |
mov [volume.maxDb], eax |
|
.out: |
xor eax, eax |
pop esi edx ecx ebx |
566,14 → 586,14 |
if DEBUG |
push eax esi |
mov esi, msgUnmuteIn |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
stdcall fdword2str, 3 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
mov esi, msgIdx |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
mov eax, [index] |
stdcall fdword2str, 3 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
pop esi eax |
end if |
|
599,16 → 619,16 |
mov ebx, [index] |
if DEBUG |
mov esi, msgConnect |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
stdcall fdword2str, 3 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
|
mov esi, msgIdx |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
push eax |
mov eax, ebx |
stdcall fdword2str, 3 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
pop eax |
end if |
stdcall snd_hda_codec_write, eax, 0, AC_VERB_SET_CONNECT_SEL, ebx |
630,7 → 650,6 |
jz .out |
mov esi, eax |
jmp .next_node |
|
.out: |
pop esi eax |
ret |
661,9 → 680,9 |
if DEBUG |
push esi |
mov esi, msgSkipDigitalOutNode |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
stdcall fdword2str, 3 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
pop esi |
end if |
jmp .ret_zero |
671,9 → 690,9 |
if DEBUG |
push eax esi |
mov esi, msgAudOutFound |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
stdcall fdword2str, 3 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
pop esi eax |
end if |
|
768,12 → 787,16 |
test [esi + HDA_GNODE.wid_caps], AC_WCAP_DIGITAL |
jnz .continue ; skip SPDIF |
@@: |
; output as default? |
push eax |
movzx eax, [esi + HDA_GNODE.nid] |
stdcall snd_hda_enable_pin_sense, eax, eax ;Asper+: enable unsolicited events for the output pin |
pop eax |
|
if DEBUG |
pusha |
; push esi |
; mov esi, msgPin_Nid |
; call SysMsgBoardStr |
; invoke SysMsgBoardStr |
; pop esi |
movzx eax, [esi + HDA_GNODE.nid] |
movzx ebx, [esi + HDA_GNODE.pin_ctl] |
781,38 → 804,42 |
mov edx, [esi + HDA_GNODE.def_cfg] |
mov edi, [esi + HDA_GNODE.amp_out_caps] |
mov esi, msgPin_Nid |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
stdcall fdword2str, 3 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
|
mov esi, msgPin_Ctl |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
mov eax, ebx |
stdcall fdword2str, 2 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
|
mov esi, msgPin_Caps |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
mov eax, ecx |
stdcall fdword2str, 2 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
|
mov esi, msgDef_Cfg |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
mov eax, edx |
stdcall fdword2str, 2 |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
|
mov esi, msgAmp_Out_Caps |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
mov eax, edi |
stdcall fdword2str, 2 |
call SysMsgBoardStr |
|
invoke SysMsgBoardStr |
popa |
end if |
; output as default? |
; test [esi + HDA_GNODE.pin_ctl], AC_PINCTL_OUT_EN |
; jz .continue |
.use_dac0: |
cmp [spec.dac_node], 0 |
jne .use_dac1 |
|
stdcall clear_check_flags |
stdcall parse_output_path, esi, 0 |
|
821,6 → 848,7 |
mov edx, [spec.out_pin_node] |
test edx, edx |
jz @f |
.use_dac1: |
stdcall clear_check_flags |
stdcall parse_output_path, esi, 1 |
@@: |
899,7 → 927,7 |
if DEBUG |
push esi |
mov esi, emsgNoProperOutputPathFound |
call SysMsgBoardStr |
invoke SysMsgBoardStr |
pop esi |
end if |
@@: |
921,6 → 949,10 |
cmp eax, 0 |
jl .error |
|
if FDEBUG |
stdcall print_afg_tree_nodes ;Asper+ |
end if |
|
stdcall parse_output |
xor eax, eax |
.out: |