acidanthera / bugtracker

Acidanthera Bugtracker
385 stars 45 forks source link

[AudioDxe] Force to output sound from specific node/port #2281

Closed m0d16l14n1 closed 1 year ago

m0d16l14n1 commented 1 year ago

Problem: boot chime sound volume is super low. According to OpenCore log it's happening because it output only from two nodes (0x14 - upper speakers and 0x21 - jack/hp out). I did check the sound itself via headphones - it's clean and nice though.

02:025 00:026 HDA: | Port widget @ 0x14 is an output (pin defaults 0x90170110) (bitmask 1) 02:043 00:017 HDA: | Widget @ 0x2 (type 0x0) 02:046 00:002 HDA: | Port widget @ 0x21 is an output (pin defaults 0x2214020) (bitmask 2) 02:059 00:012 HDA: Codec protocols installed 02:061 00:002 HDA: Codec initialized

It's seems AudioDxe is "ignoring" the node with bass speakers > 0x1B, it's actually see it there:

00:659 00:027 HDA: | Widget @ 0x2 output amp capabilities: 0x25757 00:722 00:063 HDA: | Widget @ 0x3 output amp capabilities: 0x25757 01:244 00:521 HDA: | Widget @ 0x14 output amp capabilities: 0x80000000 01:534 00:290 HDA: | Widget @ 0x1B output amp capabilities: 0x80000000 01:737 00:203 HDA: | Widget @ 0x21 output amp capabilities: 0x80000000

The main problem in my case is codec not set it up properly, on Windows it's overriding values by driver, on macOS it's possible to override via pinconfig using AppleALC (it's done and working fine). Here is the output dump log from RtHDDump:

Wid=14 Codec=90170110 Drv=90170110 Loc=00000000 Wid=1B Codec=411111F0 Drv=90170110 Loc=00000000 Wid=21 Codec=02214020 Drv=02214020 Loc=00020200

Is it possible to override it in a same way with AudioDxe to get sound from both 0x14 and 0x1b (or even just from 0x1b, because speakers on 0x14 are super cheap and "trash")? Thanks in advance and sorry, if it was already mentioned somewhere, I may create duplicate of same issue. I will pin logs from OC/RtHDDump in case it will help.

RtHDDump.txt opencore-2023-05-13-140724.txt

mikebeaton commented 1 year ago

config.plist also, please

m0d16l14n1 commented 1 year ago

config.plist also, please

Sure, sorry, forgot about that config.plist.zip

mikebeaton commented 1 year ago

I have to admit, I'm not immediately sure about this. This is part of what normally 'just works' in AudioDxe, and not part of the bits I updated so far; unless @Goldfish64 has time to suggest anything? Given time, I am sure I could find the relevant code and figure out what needs configuring - but I am pretty sure this is not something that is supported at the moment. (You get different speakers normally by using the AudioOutMask once you are on the right codec*; but then the default mask of -1, which you are using, should enable all available channels, including this one - if it was available. And it seems you are already on the right codec.) You are welcome to check out the existing code yourself, and offer a PR or discuss further here, if you can see what might need configuring to make this channel available.

*e.g. This already works for me using just what is described here, on my MacPro10,2 - and actually using both bass and treble speakers together sounds best of all, better then just bass - even though the treble sounds terrible on its own.

mikebeaton commented 1 year ago

Actually, I take it back... on hunting in the code, maybe I can see how to do this already. Allow me up to a few days to grab some time, but perhaps I can just add an option to force identifying this as an output and it will just work.

m0d16l14n1 commented 1 year ago

Actually, I take it back... on hunting in the code, maybe I can see how to do this already. Allow me up to a few days to grab some time, but perhaps I can just add an option to force identifying this as an output and it will just work.

Sure, thanks for that! I am not sure I am qualified to check and fix it myself, heh. As much as I want to help you there, I just can not ^_^ Not sure if there a way to fix it by modifying BIOS/UEFI, I have a full dumps made with CH341A (I can send you it in case it could somehow help)

mikebeaton commented 1 year ago

I believe the sound card is probably misidentifying the capabilities of the node - not marked as output when it should be. Not a BIOS issue as such.

mikebeaton commented 1 year ago

Can you try the DEBUG version from the macOS build artefacts here https://github.com/acidanthera/OpenCorePkg/actions/runs/4996355713? Give the artefacts a couple of seconds to appear at the bottom of the screen.

This might produce output on your node 0x1b - please report - and it will also give some useful debug output - please provide the log.

m0d16l14n1 commented 1 year ago

Can you try the DEBUG version from the macOS build artefacts here https://github.com/acidanthera/OpenCorePkg/actions/runs/4996355713? Give the artefacts a couple of seconds to appear at the bottom of the screen.

This might produce output on your node 0x1b - please report - and it will also give some useful debug output - please provide the log.

This one worked like a charm! Here is the log: opencore-2023-05-17-060932.txt

perez987 commented 1 year ago

@umka-petrovich Just curiosity. Do you have UTBMap without USBToolBox?

mikebeaton commented 1 year ago

This one worked like a charm! Here is the log: opencore-2023-05-17-060932.txt

Great. Again allow me some time to convert this to a proper fix or new option, but it seems it shouldn't be a problem.

m0d16l14n1 commented 1 year ago

@umka-petrovich Just curiosity. Do you have UTBMap without USBToolBox?

Yep.

Great. Again allow me some time to convert this to a proper fix or new option, but it seems it shouldn't be a problem.

Thanks a lot!

perez987 commented 1 year ago

@umka-petrovich OT. UTBMap needs USBToolBox to work, as per developer instructions. Are your USB ports working properly with single UTBMap?

m0d16l14n1 commented 1 year ago

Are your USB ports working properly with single UTBMap?

Not sure it's right place to discuss that. Yeah, USB ports are working as they should, no problem with that. It's possible to use UTBMap "kextless" itself if you wanna to. Possible to make an injector, same is done on "classic" USB map tool (one's from corpt as example)

@umka-petrovich OT. UTBMap needs USBToolBox to work, as per developer instructions.

image image
mikebeaton commented 1 year ago

@umka-petrovich - Can you confirm that this new option works for you?

m0d16l14n1 commented 1 year ago

@umka-petrovich - Can you confirm that this new option works for you?

Sure, need couple hours to get near laptop. I will write back as I test it

m0d16l14n1 commented 1 year ago

@umka-petrovich - Can you confirm that this new option works for you?

@mikebeaton, thank you very much! Works well!