Post

Replies

Boosts

Views

Activity

Reply to Should UserSendCBD work on UAS interfaces?
Kevin, thanks for the suggestion. Unfortunately, it didn't work. I can put a different value for bInterfaceProtocol into the USB Device Info dictionary of the IOUSBMassStorageDriverNub, but that doesn't affect how the rest of the stack behaves. Whether I put 80 or 98 into bInterfaceProtocol, I always end up with a IOUSBMassStorageUASDriver attached to the IOUSBMassStorageDriverNub. I don't think modifying properties is going to work, unless there is some property I can add to the interface or the device that tells the stack "don't use alternate 1" or "always use alternate 0", which would require direct support from the USB stack.
Topic: App & System Services SubTopic: Drivers Tags:
Oct ’25
Reply to Should UserSendCBD work on UAS interfaces?
I tried making a codeless dext which matches to my IOUSBHostInterface. It has a plist that looks like this: CFBundleIdentifierKernel = com.apple.kpi.iokit // not sure if this is required IOClass = AppleUSBHostMergeProperties // uses IOProviderMergeProperties IOMatchCategory = $(PRODUCT_BUNDLE_IDENTIFIER) // makes its matching unique IOProviderClass = IOUSBHostInterface // what I want to match against IOUserClass = force_alt0 // not sure I need this, because we don't need a user-space process at all // required properties for matching to a IOUSBHostInterface, // see https://developer.apple.com/library/archive/qa/qa1076/_index.html idProduct = x // my product's usb product ID, as a Number idVendor = y // my product's usb vendor ID, as a Number bInterfaceNumber = 0 bConfigurationValue = 1 IOProviderMergeProperties = { bInterfaceProtocol = 80 // 0x50 sentinelProperty = "I am just a string" } I can see in the IORegistry that my sentinelProperty is applied to the interface, but bInterfaceProtocol is not. If I look at the IORegistry without my codeless dext, I see this hierarchy IOUSBInterface bInterfaceProtocol = 0x62 IOUSBMassStorageInterfaceNub, bInterfaceProtocol = 0x50 IOUSBMassStorageDriverNub, bInterfaceProtocol = 0x62 IOUSBMassStorageUASDriverNub, bInterfaceProtocol = 0x62 with my codeless dext, I see the same classes, with the same values of bInterfaceProtocol. I expect that tweaking the bInterfaceProtocol value on the IOUSBHostInterface at driver match time doesn't make any difference. Something in the USB stack that matches later, perhaps the IOUSBMassStorageDriverNub, is looking at the IOUSBHostInterface and making its own decision about what alternate interface to set, which causes IOUSBHostInterface to set its own bInterfaceProtocol property value. The value I designate in my IOProviderMergeProperties dictionary may well be briefly applied to the IOUSBHostInterface, but is later overwritten. Is there some other way to convince the OS to not use alternate interface 1?
Topic: App & System Services SubTopic: Drivers Tags:
Oct ’25
Reply to Close All
Hi. Welcome to these forums, which are for developers to communicate with other developers (some of whom may work for Apple) about issues with developing software for Apple platforms. You're not going to get much traction here. Your issue seems to be a feature suggestion for Apple software. Apple have a web address where you can submit such feedback: https://www.apple.com/feedback/ It helps if you clearly identify what platform (macOS, iOS, iPadOS, watchOS, tvOS...) you are referring to, and clearly describe what feature you think is missing (close all what?). If you believe you have found a bug in Apple software, you can use this address: https://feedbackassistant.apple.com or the Feedback Assistant app.
Oct ’25
Reply to the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
This has often happened to me with code which is incorrect but not glaringly so. I've found that using an LLM is useful here. Just ask it "why can't the Swift compiler type check this in reasonable time: " and append the code. An LLM isn't as hard-nosed as a compiler; it can spot common errors like extra or missing commas. It might be worth suggesting this as an Xcode feature. Just as the compiler constantly runs in the background as you type, an LLM could constantly examine your code and point out oddities - things that might even compile, but are likely unintended, or possible reasons for compiler error messages.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’25
Reply to Building SimpleAudioDriver example
look in ~/Library/Developer/Xcode/UserData/Provisioning Profiles for the Xcode-generated profile. You can use QuickLook to inspect the profile. If you added the DriverKit USB (development) Capability, your profile should have idVendor='*'. This wildcard value will only work for development builds. Your entitlements.plist should have an entry called com.apple.developer.driverkit.transport.usb or "DriverKit USB Transport' which is an array, containing one or more items, each of which is a dictionary. Each dictionary should have an item with key idVendor and value a decimal number equal to the vendor ID of the device you're driving.
Oct ’25
Reply to Beginner’s question on learning philosophy.
Well, welcome. Most Apple documentation is a reference of API calls, generated from header files. It tells you how to spell them, what the parameters are, sometimes what those parameters mean, what OS versions you can use them in, and not much else. Learning from these resources is like trying to learn a natural language from a dictionary. Apple has some videos from WWDC presentations about new technologies, but these tend to assume familiarity with the language and the problem domain. In the olden days (maybe twenty years ago), I might have said "get a book", but books are out of date the moment they are written. If you have access to an AI, I can recommend this approach. Prompt it with a program you have written in Python. Tell it that you are a Python programmer, and you are new to Swift, and that it should translate the program to Swift, and explain what it does and how the code compares to the Python implementation. Ask it to provide links to relevant documentation. Then read the explanation it provides, follow the links, read those. Try out the code (remember, AI makes mistakes, confidently). There are also a lot of good resources on the web. If you're stuck with how to use a particular API, search for " example". Pretty soon you'll identify some sites you will want to return to again and again. Good luck!
Oct ’25
Reply to How can I locate a UVC camera for PTZ control by AVCaptureDevice.unique_id
We parse the locationID out of the AVCaptureDevice.uniqueID and then find the IORegistry node with that locationID. Is there's a document declares how AVFoundation generate the unique_id for USB camera, no so I can assume this convert will always work? you can't Or is there's a way to send a PTZ control request to AVCaptureDevice? not that I know of. As far as I know, the only way is what you're doing. It looks that the unique_id provided is (locationID<<32|VendorID<<16|ProductID) as hex string, but I'm not sure if I can always assume this behavior won't change. Correct - it has changed in the past, it might change at any time in the future. Not all AVCaptureDevices are UVC, but they all have uniqueIDs. If you would like an API to clearly identify an AVCapture device in the IORegistry, please file a bug. I already did (in 2019, FB6146541)
Oct ’25
Reply to API for disk throughput?
you can see what iostat does by looking at its source code, which is here https://github.com/apple-oss-distributions/system_cmds/tree/main/iostat
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’25
Reply to New Developer
https://developer.apple.com/programs/
Replies
Boosts
Views
Activity
Nov ’25
Reply to AVAssetExportSession ignores frameDuration 60fps and exports at 30fps, but AVPlayer playback is correct
I think the problem isn't so much the preset as the use of the AVExportSession itself, which can only accept presets. To get more control, you could use an AVAssetWriter. You can set it up with a preset to begin with, then alter some of the parameters.
Topic: Media Technologies SubTopic: Video Tags:
Replies
Boosts
Views
Activity
Oct ’25
Reply to Unable to submit my macOS window‑manager app
Is com.apple.security.accessiblity a documented and valid entitlement? see https://developer.apple.com/forums/thread/799000
Replies
Boosts
Views
Activity
Oct ’25
Reply to How to retrieve the % of memory pressure using native libraries
the source code of memory_pressure is here: https://github.com/apple-oss-distributions/system_cmds/blob/e0c267e80e451b9441ec4f4bb05dd72f0b49d596/memory_pressure/memory_pressure.c
Replies
Boosts
Views
Activity
Oct ’25
Reply to Should UserSendCBD work on UAS interfaces?
Kevin, thanks for the suggestion. Unfortunately, it didn't work. I can put a different value for bInterfaceProtocol into the USB Device Info dictionary of the IOUSBMassStorageDriverNub, but that doesn't affect how the rest of the stack behaves. Whether I put 80 or 98 into bInterfaceProtocol, I always end up with a IOUSBMassStorageUASDriver attached to the IOUSBMassStorageDriverNub. I don't think modifying properties is going to work, unless there is some property I can add to the interface or the device that tells the stack "don't use alternate 1" or "always use alternate 0", which would require direct support from the USB stack.
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Oct ’25
Reply to System Data Occupying Half of My Storage
You're in the wrong place to ask questions like these. support.apple.com would be more appropriate.
Replies
Boosts
Views
Activity
Oct ’25
Reply to Should UserSendCBD work on UAS interfaces?
I tried making a codeless dext which matches to my IOUSBHostInterface. It has a plist that looks like this: CFBundleIdentifierKernel = com.apple.kpi.iokit // not sure if this is required IOClass = AppleUSBHostMergeProperties // uses IOProviderMergeProperties IOMatchCategory = $(PRODUCT_BUNDLE_IDENTIFIER) // makes its matching unique IOProviderClass = IOUSBHostInterface // what I want to match against IOUserClass = force_alt0 // not sure I need this, because we don't need a user-space process at all // required properties for matching to a IOUSBHostInterface, // see https://developer.apple.com/library/archive/qa/qa1076/_index.html idProduct = x // my product's usb product ID, as a Number idVendor = y // my product's usb vendor ID, as a Number bInterfaceNumber = 0 bConfigurationValue = 1 IOProviderMergeProperties = { bInterfaceProtocol = 80 // 0x50 sentinelProperty = "I am just a string" } I can see in the IORegistry that my sentinelProperty is applied to the interface, but bInterfaceProtocol is not. If I look at the IORegistry without my codeless dext, I see this hierarchy IOUSBInterface bInterfaceProtocol = 0x62 IOUSBMassStorageInterfaceNub, bInterfaceProtocol = 0x50 IOUSBMassStorageDriverNub, bInterfaceProtocol = 0x62 IOUSBMassStorageUASDriverNub, bInterfaceProtocol = 0x62 with my codeless dext, I see the same classes, with the same values of bInterfaceProtocol. I expect that tweaking the bInterfaceProtocol value on the IOUSBHostInterface at driver match time doesn't make any difference. Something in the USB stack that matches later, perhaps the IOUSBMassStorageDriverNub, is looking at the IOUSBHostInterface and making its own decision about what alternate interface to set, which causes IOUSBHostInterface to set its own bInterfaceProtocol property value. The value I designate in my IOProviderMergeProperties dictionary may well be briefly applied to the IOUSBHostInterface, but is later overwritten. Is there some other way to convince the OS to not use alternate interface 1?
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Oct ’25
Reply to Close All
Hi. Welcome to these forums, which are for developers to communicate with other developers (some of whom may work for Apple) about issues with developing software for Apple platforms. You're not going to get much traction here. Your issue seems to be a feature suggestion for Apple software. Apple have a web address where you can submit such feedback: https://www.apple.com/feedback/ It helps if you clearly identify what platform (macOS, iOS, iPadOS, watchOS, tvOS...) you are referring to, and clearly describe what feature you think is missing (close all what?). If you believe you have found a bug in Apple software, you can use this address: https://feedbackassistant.apple.com or the Feedback Assistant app.
Replies
Boosts
Views
Activity
Oct ’25
Reply to the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
This has often happened to me with code which is incorrect but not glaringly so. I've found that using an LLM is useful here. Just ask it "why can't the Swift compiler type check this in reasonable time: " and append the code. An LLM isn't as hard-nosed as a compiler; it can spot common errors like extra or missing commas. It might be worth suggesting this as an Xcode feature. Just as the compiler constantly runs in the background as you type, an LLM could constantly examine your code and point out oddities - things that might even compile, but are likely unintended, or possible reasons for compiler error messages.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’25
Reply to Building SimpleAudioDriver example
look in ~/Library/Developer/Xcode/UserData/Provisioning Profiles for the Xcode-generated profile. You can use QuickLook to inspect the profile. If you added the DriverKit USB (development) Capability, your profile should have idVendor='*'. This wildcard value will only work for development builds. Your entitlements.plist should have an entry called com.apple.developer.driverkit.transport.usb or "DriverKit USB Transport' which is an array, containing one or more items, each of which is a dictionary. Each dictionary should have an item with key idVendor and value a decimal number equal to the vendor ID of the device you're driving.
Replies
Boosts
Views
Activity
Oct ’25
Reply to Beginner’s question on learning philosophy.
Well, welcome. Most Apple documentation is a reference of API calls, generated from header files. It tells you how to spell them, what the parameters are, sometimes what those parameters mean, what OS versions you can use them in, and not much else. Learning from these resources is like trying to learn a natural language from a dictionary. Apple has some videos from WWDC presentations about new technologies, but these tend to assume familiarity with the language and the problem domain. In the olden days (maybe twenty years ago), I might have said "get a book", but books are out of date the moment they are written. If you have access to an AI, I can recommend this approach. Prompt it with a program you have written in Python. Tell it that you are a Python programmer, and you are new to Swift, and that it should translate the program to Swift, and explain what it does and how the code compares to the Python implementation. Ask it to provide links to relevant documentation. Then read the explanation it provides, follow the links, read those. Try out the code (remember, AI makes mistakes, confidently). There are also a lot of good resources on the web. If you're stuck with how to use a particular API, search for " example". Pretty soon you'll identify some sites you will want to return to again and again. Good luck!
Replies
Boosts
Views
Activity
Oct ’25
Reply to How can I locate a UVC camera for PTZ control by AVCaptureDevice.unique_id
We parse the locationID out of the AVCaptureDevice.uniqueID and then find the IORegistry node with that locationID. Is there's a document declares how AVFoundation generate the unique_id for USB camera, no so I can assume this convert will always work? you can't Or is there's a way to send a PTZ control request to AVCaptureDevice? not that I know of. As far as I know, the only way is what you're doing. It looks that the unique_id provided is (locationID<<32|VendorID<<16|ProductID) as hex string, but I'm not sure if I can always assume this behavior won't change. Correct - it has changed in the past, it might change at any time in the future. Not all AVCaptureDevices are UVC, but they all have uniqueIDs. If you would like an API to clearly identify an AVCapture device in the IORegistry, please file a bug. I already did (in 2019, FB6146541)
Replies
Boosts
Views
Activity
Oct ’25
Reply to Xcode Signing Fails: Provisioning Profile "doesn't match" com.apple.developer.driverkit.userclient-access entitlement
are you using IOServiceGetMatchingService("DriverKitAcxxx") as shorthand for let dict = IOServiceNameMatching("DriverKitAcxxx") service = IOServiceGetMatchingService(kIOMainPortDefault, dict) and did you call RegisterService from your driver code?
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Oct ’25
Reply to PCIDriverKit entitlements during development
Just to let you know, FB19449747 has been fixed, so there is now a development-only entitlement for PCI DriverKit. I was asked to follow up on FB19449747 after this was supposedly fixed, so I did. I can't see a DriverKit PCI Transport (development) entitlement in the list of available Capabilities.
Topic: Code Signing SubTopic: Entitlements Tags:
Replies
Boosts
Views
Activity
Oct ’25