The shortest necessary path to playing audio on Intel HDA

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
wishedtobe
Member
Member
Posts: 63
Joined: Sat May 04, 2024 7:48 am
Libera.chat IRC: wishedtobe

Re: The shortest necessary path to playing audio on Intel HDA

Post by wishedtobe »

VSlezak wrote: Mon Aug 25, 2025 7:57 am In my opinion it is much harder way than just switch on path of one speaker PIN. If you want to have output from all PINs at once, you will need to enable much more nodes than just nodes in path of one output PIN. But it is not impossible, so of course, you can try it.
I decided to turn on all the pins whose value on 0xf1c(15:12) is 4(green). Maybe there's only one in a codec.
Another question: How many nodes can a pin widget connect? I assume that there's only one mixer and one DAC, otherwise the existence of the mixer wouldn't make sense.
VSlezak
Member
Member
Posts: 341
Joined: Sat Mar 10, 2018 10:16 am

Re: The shortest necessary path to playing audio on Intel HDA

Post by VSlezak »

I am not exactly sure what are you asking. Pin node can be directly connected to any Audio Output, Mixer or Selector node, number is limited only to number of those nodes in codec. And for path itself, there also is no limitation of length, you just need to follow all connections between nodes.
User avatar
wishedtobe
Member
Member
Posts: 63
Joined: Sat May 04, 2024 7:48 am
Libera.chat IRC: wishedtobe

Re: The shortest necessary path to playing audio on Intel HDA

Post by wishedtobe »

Heavy news: I ruined the HDA configuration bar on my computer by making the Buffer Descriptor List point at 0xa0000. Let's observe a moment of silence.

Update: My BIOS has automatically fixed it after a completely shutdown and reboot. Actually, the ruin is caused by my manual alteration on the value of Hda bar 0, since it's originally mapped above 4gb space, although I've done the CMOS setting. Now the BIOS has admitted its error and mapped it lower, thus I don't have to violate the memory that didn't belong to HDA.
User avatar
wishedtobe
Member
Member
Posts: 63
Joined: Sat May 04, 2024 7:48 am
Libera.chat IRC: wishedtobe

Re: The shortest necessary path to playing audio on Intel HDA

Post by wishedtobe »

wishedtobe wrote: Tue Aug 26, 2025 11:32 pm I decided to turn on all the pins whose value on 0xf1c(15:12) is 4(green). Maybe there's only one in a codec.
Another question: How many nodes can a pin widget connect? I assume that there's only one mixer and one DAC, otherwise the existence of the mixer wouldn't make sense.
It can connect either a few mixers, or a single DAC. Mixers just serve as transmitters of signal.
User avatar
wishedtobe
Member
Member
Posts: 63
Joined: Sat May 04, 2024 7:48 am
Libera.chat IRC: wishedtobe

Re: The shortest necessary path to playing audio on Intel HDA

Post by wishedtobe »

Code: Select all

push byte 0
pop ds
mov edi,0xfebf0060
%macro send 1
mov [edi],dword %1
mov [edi+8],word 1
%endmacro
send 0x17ff00
send 0x170500
send 0x270500
send 0x370500
send 0x370740
send 0x370c02
send 0x270610
send 0x220011
send 0x270c02
mov di,0x100
mov [edi+0x12],word 0x11
mov [edi+0xc],word 1
mov [edi+8],size
mov [edi+0x18],base
The ultimate code on QEMU, and still don't work.
VSlezak
Member
Member
Posts: 341
Joined: Sat Mar 10, 2018 10:16 am

Re: The shortest necessary path to playing audio on Intel HDA

Post by VSlezak »

At first, it seems that you are implementing PIO interface for sending commands. If yes, you should do it in this way:
  • Be sure that Immediate Result Valid bit is clear (port 0x68)
  • Write verb (port 0x60)
  • Start transfer of verb (set bit Immediate Command Busy in port 0x68)
  • Wait until Immediate Result Valid bit is set and Immediate Command Busy bit is clear (port 0x68)
  • Clear Immediate Result Valid bit (port 0x68)
  • Read returned value (port 0x64)
Your actual code probably do not send more than one verb.

Also you did not set Stream number and Stream Run bit, so even if path would be completely initialized, not sound data would have been given to it. And you did not clear upper buffer address, so there is possibility that it has incorrect value.
User avatar
wishedtobe
Member
Member
Posts: 63
Joined: Sat May 04, 2024 7:48 am
Libera.chat IRC: wishedtobe

Re: The shortest necessary path to playing audio on Intel HDA

Post by wishedtobe »

VSlezak wrote: Sat Aug 30, 2025 5:49 am Also you did not set Stream number and Stream Run bit, so even if path would be completely initialized, no sound data would have been given to it. And you did not clear upper buffer address, so there is possibility that it has incorrect value.
That's not the point. Please focus on the "send" sequence. It might be incomplete.
VSlezak
Member
Member
Posts: 341
Joined: Sat Mar 10, 2018 10:16 am

Re: The shortest necessary path to playing audio on Intel HDA

Post by VSlezak »

Well, I do not know anything about codec you are trying to initialize, and I do not know what exactly you want to accomplish with this part of code, and how is your code integrated to your OS. If you have some problem with your code, I will happily help with that specific point. But "initialization sequence might be incomplete" do not give me any ground about your actual state and goal, so I can not help you with that.
Post Reply