Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Likely an issue w/ macOS + ARM + USB/C #8

Open
kanalo-shrek opened this issue Dec 27, 2024 · 0 comments
Open

Likely an issue w/ macOS + ARM + USB/C #8

kanalo-shrek opened this issue Dec 27, 2024 · 0 comments

Comments

@kanalo-shrek
Copy link

kanalo-shrek commented Dec 27, 2024

Hi 👋 , Happy Holidays and thanks for the incredible work on ddc-macos-rs!

I'm encountering reliability issues with DDC/CI communication when using DisplayPort over USB-C connection. Initially using ddc-hi (which uses this package), I ran into several issues that I've partially resolved but still need help addressing.

Environment

  • OS: macOS
  • Display Connection: DisplayPort over USB-C
  • Package: Using ddc-hi which depends on macOS-ddc-rs

Initial Problems

  1. Getting DDC/CI error: invalid DDC/CI length error
  2. get_vcp_feature fails with the same error
  3. set_vcp_feature appears to succeed but has no effect on the monitor

Investigation

I compared the implementation with m1ddc which works well with my setup. The main difference I noticed was in m1ddc the write command section waits and invokes IOAVServiceWriteI2C multiple times for DDC_ITERATIONS:
Reference in m1ddc

Current Implementation

I've tried to match m1ddc's approach and tweaked the rust code for execute to:

unsafe {
    for _ in 0..DDC_ITERATIONS {
        std::thread::sleep(response_delay);
        verify_io(IOAVServiceWriteI2C(
            *service,
            i2c_address as _, // I2C_ADDRESS_DDC_CI as u32,
            SUB_ADDRESS_DDC_CI as _,
            // Skip the first byte, which is the I2C address, which this API does not need
            request_data[1..].as_ptr() as _,
            (request_data.len() - 1) as _, // command_length as u32 + 3,
        ))?;    
    }
};

Current Status

  • The above changes resolved the initial errors
  • Commands now execute without errors
  • I am not sure if why this works!

Questions

  1. Are there known issues with monitor detection over USB-C DisplayPort?
  2. Is there some obvious configuration that I am missing?

Additional Context

I'd be happy to help investigate further or implement suggested changes. Please let me know what additional information would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant