Giter Club home page Giter Club logo

Comments (9)

zearp avatar zearp commented on August 25, 2024

Is it usb-c to hdmi or usb-c to usb-c? The former should work whilst the latter may need some extra configuration. I'd guess the monitor also appears as usb audio device which doesn't wake up properly cuz the port it connected to (or created) isn't set to internal (or added) in the usb port map.

Does it happen in Windows too? If so it could be a bug in the monitor itself and sleep modes, rare but possible.

Does it come back if you instead of reboot re-plug the usb-c monitor?

To properly figure this out we need more information, like how audio is transferred to the monitor. Make a dump with IOreg before and after sleep and compare those. It will show which device(s) went missing and will help to figure out how to prevent them form disappearing. If possible also make a dump without the monitor connected.

The fix is most likely making a new port map for the isb ports and/or set some ports to internal may also help preventing the audio device from disappearing. Assuming it is acting like usb audio device.

Also note that I don't have any usb-c capable monitors so I can't test that but I do use usb-c hubs with hdmi outputs all the time and audio over them is fine as is with direct connections to the hdmi port. Audio over usb-c for displays might do something different, I really have no idea.

from nucintosh.

gianemi2 avatar gianemi2 commented on August 25, 2024

Hi @zearp, thanks for your reply.
It is a USB C to USB C connection.
Nope, doesn't happen on Windows.

Nope, it doesn't come back if I replug the cable.

I've made an export of IORegistryExplorer while without USB C audio working and with it. Where can I send them to you?

This is how it appears on audio source selector when it's working:
Schermata 2021-04-06 alle 10 13 10
As you see while is working BenQEW3270 is visible.

from nucintosh.

zearp avatar zearp commented on August 25, 2024

You can upload them here.

Also disable Soundflower and any other 3rd party audio related apps or drivers you may have installed. It's important to keep things default else there are simply too many variables, especially since I don't own any usb-c monitor so can't test this myself. Even if it's unlikely to cause the issue its best to get rid of those thing for the time being. Less variables makes for easier troubleshooting.

If you can test this screen on a real Mac please do and see what happens. Cuz not all screens are 100% compatible with macOS (or Big Sur). Some quick searching showed a few people with BenQ screens that lost audio after waking up their Macs. BenQ most likely uses DisplayPort for video/audio over usb-c so maybe there's something up with that. Once again I don't have any h/w to test this myself. I have a screen with DisplayPort but no usb-c to DisplayPort dongle or cable.

It is also very weird that re-plugging a usb device after waking up the machine doesn't restore both connections (video + sound) and only restores video. Cuz normally even if waking up doesn't re-add all devices they should work when you do that manually. The fact you only get video and no audio when you manually replug after sleep could indicate something more complex is happening.

Also does this happen when the screen is connected over hdmi or only when using usb-c?

Another area to look that could be helpful is the frame buffer settings. Things like (re)mapping the connectors, double checking options, trying new options related to audio transport over DisplayPort and so on.

There are many places to check and things to test. Something I could do on my own pretty fast but doing it like this will cost a lot of time for both you and me. I hope it won't be too complex but if it is you may need to find help elsewhere and share any solutions so we can make the EFI work on more configurations. I can't do much when I don't have similar devices to test with.

from nucintosh.

zearp avatar zearp commented on August 25, 2024

Another thing to try is to revert to my previous ACPI patches.

Try the attached test EFI and replace your current one with it. Don't forget to make a backup of your EFI and copy over your serials if you were signed in to iCloud.

EFI-test.zip

from nucintosh.

gianemi2 avatar gianemi2 commented on August 25, 2024

usbc audio tests.zip
Here they are, thanks a lot for your precious help.
This problem happen only on USB C connection, never tried display port but done with HDMI. No problem at all, even after awake.
I'm gonna test better next time, trying to unplug from NUC also that from monitor.

Also, do you think that display port to hdmi cable could cause some problems? Because if not, I'm gonna just swap my usb C with that cable. (Sorry not related with this topic)

from nucintosh.

zearp avatar zearp commented on August 25, 2024

Some dongles/converters can cause issues with macOS and not in other operating systems. On my Macbook I can use cheap hdmi dongles in Windows but not all will work in macOS. Sometimes even cables matter. On my other repo one person had an issue with video output that was solved with another cable. Weirdly enough macOS didn't like that DisplayPort to hdmi cable but worked fine with another.

The best video connections under macOS are the ones with as little or no conversion on it, like plain hdmi to hdmi. I personally use usb-c hubs with hdmi ports and have no issues on those but not all usb-c to hdmi dongles or hubs might work in macOS. Ironic in a way that some stuff just works (better) in Windows (even on my Macbook) cuz macOS can be fussy lol.

Thanks for the IOreg files, it shows that the AppleHDAEngineOutputDP device isn't created anymore after wake. It should've been created under AppleHDAHDMI_DPDriver after wake. It's using the DisplayPort driver as expected. I have no clue why it doesn't come back.

Please try the EFI I posted above cuz the biggest recent changes all have to do with usb-c/Thunderbolt.

The quickest and easiest solution for you would be to use the hdmi port on your screen since it has one. But if you don't mind testing stuff out then I don't mind trying to make it work over usb-c. This issue is a bit complex and weird since the connection itself isn't broken after sleep, only the audio part breaks. So I dunno how far we can get. I never thought about this usage cuz imho it's a bit of a waste of the port to only use it for video/audio (the hdmi port is better suited for that).

When you connect the monitor with hdmi to hdmi can you check what the audio connection its using in IOreg or upload a new IOreg dump? It would be interesting to see if uses AppleHDAHDMI_DPDriver or something else.

As a side note, when I searched on this issue I found a lot of Mac users with the same problems, some were even using hdmi dongles. All lost audio on wake but video worked fine. Just something to keep in mind before sinking a lot of time in this, like I said earlier some of these thing will unfortunately not work properly on macOS. It's not always worth to try and fix those kind of issues.

But thats up to you to decide, maybe you need to use usb-c for your monitor only. I don't spend much time on Github issues so sometimes replies may be a bit slow but as you can see when I do have the time to reply I say a lot haha. For me this is also an educational journey to learn more about these things, so I don't mind helping as long as people don't expect some kind of helpdesk service.

from nucintosh.

gianemi2 avatar gianemi2 commented on August 25, 2024

Hi Zearp, and thanks again for your reply. I really appreciate it.
I don't want to consume your time, I've posted here the problem looking for an easy solution. If you haven't, no problem at all. I'll try another video connection.

I'm going to send you the IOREG with HDMI plugged in (as I said with HDMI it works flawlessly). I'm forced to use another connection other than the HDMI because my monitor has 2 HDMI, 1 USB C and 1 display port. I have 2 HDMI locked by two consoles and I've left free only USBC and display port.

Also, I'm going to order on Amazon an HDMI to Display Port and try that too. Maybe that could do the trick.
So what I'm gonna do is:

  • Send you IOREG with HDMI plugged in
  • Test your newest EFI
  • Try again to unplug only the cable when the problem comes out again.
  • Try with an HDMI to Display Port cable
  • RIP me and decide to live with this issue or just with a multi HDMI adapter.

Super thanks again for your precious help.
Please, reply when you have time. This is not urgent at all, I can cohabit with this issue.

Thanks again

from nucintosh.

zearp avatar zearp commented on August 25, 2024

No worries, glad to help out and I also learn form these things. I found my DisplayPort to hdmi cable but when I tried it on the NUC I found out that it's directional. My cable can only convert DisplayPort to hdmi and not the other way around. Something you might want to keep in mind when ordering a converter or cable.

Let me know the results of your tests and thank you for your time too. It's only with feedback the EFI can become better. I only have an issue with issues opened that have nothing to do with the EFI and should be sorted by the user themselves. I don't think this issue is one of those.

Please try the EFI I posted in here first, its using the "old" ACPI patches and might sort everything out. The biggest recent changes were all in the usb-c/Thunderbolt area. To me thats the most likely cause, specially considering nobody has reported any issues like this before I changed that.

I made the changes so we can have native Thunderbolt support with hot plugging and while that works it currently breaks some usb stuff on the Thunderbolt port and also breaks sleep. The former is probably an easy fix but the latter is something that I can't fix on my own. If the old patches fix it then I will revert to those and push the Thunderbolt stuff to another branch for the time being.

In the worst case the usb-c audio thing can't be fixed and you'd need to use a hdmi to DisplayPort or usb-c to DisplayPort cable. I suggest the former to keep the usb-c port free for hubs or Thunderbolt as its the fastest port on the machine. Maybe usb-c if the screen has a usb 3 hub in it that doesn't share the b/w amongst its ports. Many share it which makes the hub pointless if you need multiple high speed connections.

Another option is to keep using usb-c and figure out a way to route audio to somewhere else. Most screens don't have the best speakers or headphone/line output. You could consider getting a cheap usb-dac-dongle for around $10 to route your audio to. It will be an upgrade over the onboard audio for sure and will work flawlessly in macOS. I use some of these myself, there are ones cheaper but the DAC used is kind of crappy. Starting around $10 you get a decent DAC chip like the one I linked or the ALC5686. Some will ship with a usb-c to usb-a plug with it and some don't but they cost very little and work fine even on older usb 2 ports.

I've been in the market for a new screen for a while, something more portable and 4k. So I ordered one yesterday and it should be here in 1-2 weeks, hopefully sooner. Once it's here I can test this and also make sure 4k works on the NUCs and my other machines running macOS. The upgrade was long overdue, I just hope my 1080p screens won't feel too outdated once I have a 4k screen lol.

from nucintosh.

zearp avatar zearp commented on August 25, 2024

Today I got 4k screen to test with, I'm afraid that I can't replicate this on the screen I have. I'm connected only by usb-c and before and after sleep the speakers in the screen work. I did patch the EDID but I don't think that's strictly needed and results in low refresh rates.

I had scaled resolutions working before this so this might be useless for your sound issue. It's still might be possible to fix but will require lot of effort to dig down on it, mostly gathering info on how sound is connected, what happens when it sleeps and when it wakes, getting (debug) logs for sleep and wake cycles and stuff like that.

I'll close this issue but keep me posted and we'll see what we can figure out if you want to dig down on it.

from nucintosh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.