b0ltun Posted July 18, 2021 Share Posted July 18, 2021 (edited) 11 minutes ago, Austere.J said: [ 33.724033]: RTSX: IOReturn IOSDHostDriver::CMD55(UInt32) Error: Failed to initiate the CMD55. Error = 0xe00002d6. [ 33.724036]: RTSX: IOReturn IOSDHostDriver::waitForAppRequest(RealtekSDRequest &, UInt32) Error: Failed to issue a CMD55. Error = 0xe00002d6. [ 33.724039]: RTSX: IOReturn IOSDHostDriver::waitForAppRequest(RealtekSDRequest &, UInt32) Error: Failed to send the application command. Error = 0xe00002d6. [ 33.724043]: RTSX: bool IOSDCard::enable4BitWideBus() Error: Failed to issue the ACMD6 to switch to the 4-bit bus. [ 33.724046]: RTSX: bool IOSDCard::initHighSpeedMode() Error: Failed to enable the 4-bit wide bus. OK, I see. You encountered the same issue as Sherlocks. Please try the above 1-bit version with your card inserted while the system boots. Tried, still same. I will attach log P.S. - my fault, it's seems to be working now, it's appeared in Disk Utility. Will try to erase it, it's just new from shop, so that's my fault. Still no info in "System Report" RTS.txt Edited July 18, 2021 by b0ltun Link to comment Share on other sites More sharing options...
Austere.J Posted July 18, 2021 Author Share Posted July 18, 2021 Just now, b0ltun said: Tried, still same. I will attach log RTS.txt 886.17 kB · 0 downloads OK, your card has been initialized properly but now the problem is related to timed out DMA transfers. Stay tuned. 1 Link to comment Share on other sites More sharing options...
b0ltun Posted July 18, 2021 Share Posted July 18, 2021 1 minute ago, Austere.J said: OK, your card has been initialized properly but now the problem is related to timed out DMA transfers. Stay tuned. Hm, now it's just stuck on creating partition map, so i will wait Link to comment Share on other sites More sharing options...
Austere.J Posted July 18, 2021 Author Share Posted July 18, 2021 Just now, b0ltun said: Hm, now it's just stuck on creating partition map, so i will wait You will receive an error, because I/O transfers are not working properly for USB-based card readers. The driver is using the transfer mode that is used by PCIe-based card readers, which might be a problem now. 1 Link to comment Share on other sites More sharing options...
whatnameisit Posted July 18, 2021 Share Posted July 18, 2021 Sorry for late reply, and I'll be going away for about 3 hours... But my logs seem different from b0ltun's. logs.zip Link to comment Share on other sites More sharing options...
Austere.J Posted July 18, 2021 Author Share Posted July 18, 2021 3 hours ago, whatnameisit said: Sorry for late reply, and I'll be going away for about 3 hours... But my logs seem different from b0ltun's. logs.zip 217.48 kB · 1 download Your kernel log is indeed different and reveals another problem. Your UHS-I card failed to drive both command and data lines to low after receiving a CMD11 (which switches the voltage level to 1.8V). It might be possible that some cards are slow and need more time, so I updated the code to wait until the card drive both lines to low. Please try this one and see if it resolves the issue. RealtekCardReader_0.9.6_5842de3_DEBUG.zip Link to comment Share on other sites More sharing options...
Austere.J Posted July 18, 2021 Author Share Posted July 18, 2021 A quick summary of known issues with USB card readers. RTS5129: Problem: Non-UHS-I SD cards become unresponsive and commands are timed out after the driver sets the bus clock to 25MHz (Default Speed Mode) or 50MHz (High Speed Mode). The same issue also occurs on PCIe-based RTS5227 as reported on Github. User Observation: The card is not recognized and does not appear on desktop. USB Common: Problem: The driver starts the card initialization sequence only if the card is present in the card slot while the system boots. The periodic polling function that monitors the card status is not working at this moment. (IOTimerEventSource) User Observation: Nothing happens when one insert the card after the system boots. Problem: System Information does not list the USB card reader properly under the tab "Card Reader". User Observation: Device details are blank under the tab. 1 1 Link to comment Share on other sites More sharing options...
whatnameisit Posted July 18, 2021 Share Posted July 18, 2021 Still not showing. logs.zip Link to comment Share on other sites More sharing options...
stevezheng Posted July 24, 2021 Share Posted July 24, 2021 @Austere.J Hi, thank you so much for support on USB Realtek devices. For RTS5129/5139, I saw people said they have problems on MMC on Linux 3.16+ using rtsx driver. And there's a fix for this: https://github.com/asymingt/rts5139. I am not sure if it could help. Seems good for the work so far👍. Link to comment Share on other sites More sharing options...
stevezheng Posted July 25, 2021 Share Posted July 25, 2021 (edited) Yesterday my device experienced two crash downs on com.apple.iokit.IOUSBHostFamily after long sleep. After three hours or more sleep, all the USB ports are invalid, and after a minute, the device shuts down itself. Here's the crash report. My model is RTS5129 btw. CrashReport Jul25.txt Edited July 25, 2021 by stevezheng Link to comment Share on other sites More sharing options...
Austere.J Posted July 25, 2021 Author Share Posted July 25, 2021 Yesterday my device experienced two crash downs on com.apple.iokit.IOUSBHostFamily after long sleep. After three hours or more sleep, all the USB ports are invalid, and after a minute, the device shuts down itself. Here's the crash report. My model is RTS5129 btw. CrashReport Jul25.txtIs your card reader working properly before the computer goes to sleep? i.e. Is the SD card initialized properly and does it show up on your desktop? In either case, please attach your kernel log.Your kernel panic might be related to the power management, but I want to make sure that USB-based card readers are working properly (Card Init, I/O Transfer, Performance, etc.) before looking at PM issues. Link to comment Share on other sites More sharing options...
stevezheng Posted July 25, 2021 Share Posted July 25, 2021 2 hours ago, Austere.J said: Is your card reader working properly before the computer goes to sleep? i.e. Is the SD card initialized properly and does it show up on your desktop? In either case, please attach your kernel log. Your kernel panic might be related to the power management, but I want to make sure that USB-based card readers are working properly (Card Init, I/O Transfer, Performance, etc.) before looking at PM issues. I will re-test it and report in two weeks. Sorry for the delay, my device is on a hardware maintenance. Link to comment Share on other sites More sharing options...
stevezheng Posted July 26, 2021 Share Posted July 26, 2021 I am a bit confused by GenericCardReaderFriend's README. It says Quote If your card reader is powered by either AppleUSBCardReader.kext or RealtekCardReader.kext, you should NOT use this plugin. As I have a RTS5129, I need RealtekCardReader to drive it, but there's no information showed up in System Information - Card Reader. And I should not use neither GenericCardReaderFriend nor RealtekCardReaderFriend to inject built-in information? Link to comment Share on other sites More sharing options...
whatnameisit Posted July 26, 2021 Share Posted July 26, 2021 @stevezheng I think RealtekCardReaderFriend can only be used with RealtekCardReader which drives the SD card readers listed in RealtekCardReader README. GenericCardReaderFriend is to be used with SD card readers which is supported natively or can be extended by the native drivers. I would test GenericCardReaderFriend on my laptop with RTS5138 which is natively supported. Spoiler - If your have a builtin USB card reader that works out of box but does not show up in System Information, you may try the other Lilu plugin [GenericCardReaderFriend](https://github.com/0xFireWolf/GenericCardReaderFriend). - In other words, your card reader is powered by neither `AppleUSBCardReader.kext` nor `RealtekCardReader.kext`. Maybe removing the second bullet would make more sense? @Austere.J 1 Link to comment Share on other sites More sharing options...
Austere.J Posted July 26, 2021 Author Share Posted July 26, 2021 4 hours ago, stevezheng said: As I have a RTS5129, I need RealtekCardReader to drive it, but there's no information showed up in System Information - Card Reader. Yes, but you need the latest version of `RealtekCardReader` (See Below). 4 hours ago, stevezheng said: And I should not use neither GenericCardReaderFriend nor RealtekCardReaderFriend to inject built-in information? You should use `RealtekCardReaderFriend`. 53 minutes ago, whatnameisit said: I think RealtekCardReaderFriend can only be used with RealtekCardReader which drives the SD card readers listed in RealtekCardReader README. Correct. 54 minutes ago, whatnameisit said: GenericCardReaderFriend is to be used with SD card readers which is supported natively or can be extended by the native drivers. GenericCardReaderFriend is to be used with USB-based card readers that are powered by Apple's USB Mass Storage driver. There are three types of drivers for USB-based card readers: 1) Apple's USB Mass Storage driver (your card reader works like a thumb drive) 2) Apple's USB Card Reader driver (you probably need to modify its Info.plist to make it work with your device) 3) Realtek USB Card Reader driver (i.e., this driver and RTS5129, 5139 and 5179 only) In the first case, you need Generic Card Reader Friend to make your card reader show up in System Information, In the second case, you do not need any Lilu plugins, because from the perspective of System Information your card reader is natively supported. In the third case, you need Realtek Card Reader Friend to make both your card reader and the card information show up in System Information. 1 hour ago, whatnameisit said: Maybe removing the second bullet would make more sense? That's why I keep the second bullet, but I think I should make a table to clarify things more clearly. On 7/18/2021 at 1:14 AM, whatnameisit said: Still not showing. Your card failed to switch to 1.8V. Please try the latest one and add the boot argument `-rtsx3v3` to initialize the card at 3.3V. Links: https://github.com/0xFireWolf/RealtekCardReader/files/6874896/RealtekCardReader_0.9.6_4213fa4_DEBUG.zip 2 Link to comment Share on other sites More sharing options...
whatnameisit Posted July 26, 2021 Share Posted July 26, 2021 (edited) 4 hours ago, Austere.J said: That's why I keep the second bullet, but I think I should make a table to clarify things more clearly. Oh. I meant remove just the bullet and keep the line because the second bullet continues from the first bullet Making a table would be nice. Here's the log with -rtsx3v3. bootinserted.log I tested GenericCardReaderFriend on Alcor SD Card Reader and here's debug information. This SD card reader seems it initializes when the card is inserted and terminates when the card is removed. That's why Lilu log shows GenericCardReaderFriend not patching when the laptop is booted without the card inserted, I think. System Information shows SD card reader information when the card is inserted and displays no card reader present when the card is taken out. I guess this is the way macOS deals with Alcor 058f6366, and I also guess I could try to load Apple's USB Card Reader Driver as you said above and see if that does anything. Files.zip The IOReg is saved after I remove the SD card, and should I raise an issue on Github because this thread is dedicated to Realtek SD card reader support? Edited July 26, 2021 by whatnameisit Link to comment Share on other sites More sharing options...
Austere.J Posted July 26, 2021 Author Share Posted July 26, 2021 6 hours ago, whatnameisit said: This SD card reader seems it initializes when the card is inserted and terminates when the card is removed. Yes, that's the expected behavior. 6 hours ago, whatnameisit said: That's why Lilu log shows GenericCardReaderFriend not patching when the laptop is booted without the card inserted You will see the following two lines in the kernel log the first time you open System Information, regardless of whether a card is inserted or not. GenericCardReaderFriend GCRF: @ Patched the USB controller name. GenericCardReaderFriend GCRF: @ Patched the USB bundle identifier. 6 hours ago, whatnameisit said: I think. System Information shows SD card reader information when the card is inserted and displays no card reader present when the card is taken out. 6 hours ago, whatnameisit said: The IOReg is saved after I remove the SD card 10 hours ago, Austere.J said: There are three types of drivers for USB-based card readers: 1) Apple's USB Mass Storage driver (your card reader works like a thumb drive) Yes, that's correct. When you remove the card, your card reader device also disconnects from the system, and your IOReg dump also captures such behavior. That's why I said your card reader works like a thumb drive above. 6 hours ago, whatnameisit said: I could try to load Apple's USB Card Reader Driver as you said above and see if that does anything. You could give a try, but I think it's unnecessary as your card reader already works out of box. 6 hours ago, whatnameisit said: should I raise an issue on Github because this thread is dedicated to Realtek SD card reader support? No, you don't need to submit an issue, as what you observed is expected. You may take a look at the FAQs of the generic friend (https://github.com/0xFireWolf/GenericCardReaderFriend/blob/main/FAQ.md#long-story). 1 Link to comment Share on other sites More sharing options...
Sherlocks Posted July 27, 2021 Share Posted July 27, 2021 @Firewolf hi. need test now?Sent from my SM-N960N using Tapatalk Link to comment Share on other sites More sharing options...
whatnameisit Posted July 27, 2021 Share Posted July 27, 2021 I read first half of FAQ and completely ignored the second half. My fault. Now I understand. Thanks! Link to comment Share on other sites More sharing options...
Sherlocks Posted July 27, 2021 Share Posted July 27, 2021 On 7/26/2021 at 7:16 PM, Austere.J said: Yes, but you need the latest version of `RealtekCardReader` (See Below). You should use `RealtekCardReaderFriend`. Correct. GenericCardReaderFriend is to be used with USB-based card readers that are powered by Apple's USB Mass Storage driver. There are three types of drivers for USB-based card readers: 1) Apple's USB Mass Storage driver (your card reader works like a thumb drive) 2) Apple's USB Card Reader driver (you probably need to modify its Info.plist to make it work with your device) 3) Realtek USB Card Reader driver (i.e., this driver and RTS5129, 5139 and 5179 only) In the first case, you need Generic Card Reader Friend to make your card reader show up in System Information, In the second case, you do not need any Lilu plugins, because from the perspective of System Information your card reader is natively supported. In the third case, you need Realtek Card Reader Friend to make both your card reader and the card information show up in System Information. That's why I keep the second bullet, but I think I should make a table to clarify things more clearly. Your card failed to switch to 1.8V. Please try the latest one and add the boot argument `-rtsx3v3` to initialize the card at 3.3V. Links: https://github.com/0xFireWolf/RealtekCardReader/files/6874896/RealtekCardReader_0.9.6_4213fa4_DEBUG.zip here is log when booting with inserted sdcard. not recognized sd card rtsx_with -rtsx3v3.log rtsx_without -rtsx3v3.log Link to comment Share on other sites More sharing options...
b0ltun Posted July 31, 2021 Share Posted July 31, 2021 @Austere.J Here is the log from latest version with inserted card BEFORE boot (without any special boot-args) > RTS5129 1) I can see info about SD card reader in "System report" (no difference if i boot with SD card inserted or not) 2) No SD card shown at all (previously it appeared in IOreg and Disk Utility, but i wasn't able to erase it and initialise in Disk Utility) I will attach IOreg and log here (sd card was inserted before boot) rts.txt MacBook Air — b0ltun.ioreg Link to comment Share on other sites More sharing options...
gnpaone Posted August 3, 2021 Share Posted August 3, 2021 (edited) @Austere.J Hii, I just discovered for RTS5129 (0x129, 0xbda), a partial solution to make it work. I used some variants of realtekcardreader.kext out of which few variants partially worked (maybe developers could help me). I posted screenshots below to explain better than words. My initial try - https://github.com/0xFireWolf/RealtekCardReader/issues/8 Variant 5842de3 - Detects sdcard when attached before boot (5842de3-1.png)(sdcard gets detected but as an unknown card, couldn't format); hotplug sdcard not working(5842de3-3.png) (hot plug means plugging sdcard while Mac is running); doesn't show anything in system info Variant 4213fa4 - It detects some info in system info (similar to GenericCardReaderFriend.kext (as it fakes the card reader) as mentioned in my post - https://github.com/0xFireWolf/RealtekCardReader/issues/8#issuecomment-891726963) but it doesn't detect any sdcard (both pre-boot and hotplug) (both with and without -rtsx3v3 boot-arg) Variant 3523d8d - System Info similar to 5842de3 but doesn't detect sdcard Variant 3523d8d_1bitbuswidthversion - everything is similar to 5842de3 I doubt if it's the problem with sdcard variation in Mac detection (probably), IOReg shows SDXC reader but I use SDHC Card (Windows 10 could open my SDHC Card very well) and I couldn't test this as I don't have SDXC Card (Developers please find out). Also, please read my whole post and try to identify the problem with kext sir. You are doing a great job. (I am not sure if that kind of card reader reporting in ioreg is normal or a problem from the original macbook perspective) Note: The kexts which I posted here are taken from previous posts in this discussion and are not compiled by me. 5842de3-2.png: RealtekCardReader_0.9.6_5842de3_DEBUG.zip RealtekCardReader_0.9.6_4213fa4_DEBUG.zip RealtekCardReader_0.9.6_3523d8d_DEBUG.zip RealtekCardReader_0.9.6_3523d8d_1BitBusWidth_DEBUG.zip rtsx-5842de3-bootWithSDCard.log rtsx-5842de3-bootWithoutSDCard.log rtsx-4213fa4-bootWithSDCard.log rtsx-4213fa4-bootWithoutSDCard.log rtsx-3523d8d-bootWithSDCard.log rtsx-3523d8d-bootWithoutSDCard.log rtsx-3523d8d-1bitbus-bootWithSDCard.log rtsx-3523d8d-1bitbus-bootWithoutSDCard.log rtsx-4213fa4-rtsx3v3-bootWithSDCard.log rtsx-4213fa4-rtsx3v3-bootWithoutSDCard.log Edited August 6, 2021 by gnpaone Link to comment Share on other sites More sharing options...
gnpaone Posted August 5, 2021 Share Posted August 5, 2021 (edited) On 8/3/2021 at 11:55 PM, gnpaone said: @Austere.J Hii, I just discovered for RTS5129 (0x129, 0xbda), a partial solution to make it work. I used some variants of realtekcardreader.kext out of which few variants partially worked (maybe developers could help me). I posted screenshots below to explain better than words. My initial try - https://github.com/0xFireWolf/RealtekCardReader/issues/8 Variant 5842de3 - Detects sdcard when attached before boot (5842de3-1.png)(sdcard gets detected but as an unknown card, couldn't format); hotplug sdcard not working(5842de3-3.png) (hot plug means plugging sdcard while Mac is running); doesn't show anything in system info Variant 4213fa4 - It detects some info in system info (similar to GenericCardReaderFriend.kext (as it fakes the card reader) as mentioned in my post - https://github.com/0xFireWolf/RealtekCardReader/issues/8#issuecomment-891726963) but it doesn't detect any sdcard (both pre-boot and hotplug) (both with and without -rtsx3v3 boot-arg) Variant 3523d8d - System Info similar to 5842de3 but doesn't detect sdcard Variant 3523d8d_1bitbuswidthversion - everything is similar to 5842de3 I doubt if it's the problem with sdcard variation in Mac detection (probably), IOReg shows SDXC reader but I use SDHC Card (Windows 10 could open my SDHC Card very well) and I couldn't test this as I don't have SDXC Card (Developers please find out). Also, please read my whole post and try to identify the problem with kext sir. You are doing a great job. (I am not sure if that kind of card reader reporting in ioreg is normal or a problem from the original macbook perspective) Note: The kexts which I posted here are taken from previous posts in this discussion and are not compiled by me. 5842de3-2.png: RealtekCardReader_0.9.6_5842de3_DEBUG.zip 208.86 kB · 0 downloads RealtekCardReader_0.9.6_4213fa4_DEBUG.zip 209.87 kB · 0 downloads RealtekCardReader_0.9.6_3523d8d_DEBUG.zip 208.46 kB · 1 download RealtekCardReader_0.9.6_3523d8d_1BitBusWidth_DEBUG.zip 208.37 kB · 0 downloads rtsx-5842de3-bootWithSDCard.log 93.34 kB · 0 downloads rtsx-5842de3-bootWithoutSDCard.log 0 B · 0 downloads rtsx-4213fa4-bootWithSDCard.log 120.41 kB · 0 downloads rtsx-4213fa4-bootWithoutSDCard.log 86.74 kB · 0 downloads rtsx-3523d8d-bootWithSDCard.log 0 B · 0 downloads rtsx-3523d8d-bootWithoutSDCard.log 0 B · 0 downloads rtsx-3523d8d-1bitbus-bootWithSDCard.log 121.31 kB · 0 downloads rtsx-3523d8d-1bitbus-bootWithoutSDCard.log 0 B · 0 downloads 5842de3.mp4 Update: The kexts that I mentioned earlier that detect card, it detects only non-uhs card, it doesn't detect uhs-1 card. (NO Hotplug card detection for any cards though) @Austere.J Edited August 5, 2021 by gnpaone Link to comment Share on other sites More sharing options...
gnpaone Posted August 5, 2021 Share Posted August 5, 2021 (edited) @Austere.J Can I get 9265f98 version kext please (to test my card reader)? (https://github.com/0xFireWolf/RealtekCardReader/commit/9265f90bfd9c4803724a7225afe39c3a08720155) Edited August 5, 2021 by gnpaone Link to comment Share on other sites More sharing options...
Austere.J Posted August 7, 2021 Author Share Posted August 7, 2021 On 7/31/2021 at 8:09 AM, b0ltun said: 1) I can see info about SD card reader in "System report" (no difference if i boot with SD card inserted or not) On 7/18/2021 at 12:59 AM, Austere.J said: Problem: System Information does not list the USB card reader properly under the tab "Card Reader". User Observation: Device details are blank under the tab. @b0ltun The version you tried solves this issue only. I fixed a bug in the function that switches the bus block. Please give a try and let's see whether commands are still timed out after the card reader switches its internal clock. RealtekCardReader_0.9.6_851ede2_DEBUG.zip Link to comment Share on other sites More sharing options...
Recommended Posts