Jump to content
173 posts in this topic

Recommended Posts

18 hours ago, Austere.J said:

@Sherlocks @whatnameisit RealtekCardReader_0.9.6_a0cb167_DEBUG.zip 207.7 kB · 1 download

 

Good, the driver attached to the host device successfully, but I made some stupid and fatal typos in the hardware initialization routine. Try this one.

here is log

no show sd card icon on desktop

deleted

 

Edited by Sherlocks
Link to comment
Share on other sites

Thank you guys for detailed test reports.

 

@Sherlocks It seems that you inserted a non-UHS-I card, so the driver tried to initialize your card at the high speed mode but failed the very last step that switches the bus width to 4-bit. Specifically, the driver was timed out while waiting for the card response to the ACMD6 command. I recalled that the same issue occurred on some RTS5227 chips, but their kernel logs are incomplete, so I am not too sure about that. I don't really have a clue at this moment, but maybe we could try to initialize the card with 1-bit data line and see if things work.

 

RealtekCardReader_0.9.6_3523d8d_1BitBusWidth_DEBUG.zip

 

----------------------------------------------------------------

 

@whatnameisit @b0ltun It seems that both of you inserted the card after the system boots. My previous assumption that the card reader gets connected to the system only when a card is inserted is wrong, so the driver cannot detect any card events after it has started. Please try this one and see if it works when you insert the card AFTER the system boots.

 

RealtekCardReader_0.9.6_3523d8d_DEBUG.zip

 

@b0ltun Regarding to the issue that the card reader is not listed in System Information, I forgot to inject the physical interconnect property to the controller.

Check if you can see the card reader with the above kext.

Link to comment
Share on other sites

@Austere.J will test it now, actually i did insert card only after system fully booted before. I will check it now.

 

P.S. Now it's kinda shown in system report, heh

 

Still no card showing after inserting it, i will attach log

(Booted, inserted card, checked, took log)

 

RTS.txt

 

Screenshot 2021-07-18 at 12.25.51.png

Edited by b0ltun
add info
Link to comment
Share on other sites

10 minutes ago, b0ltun said:

P.S. Now it's kinda shown in system report, heh

 

Still no card showing after inserting it, i will attach log

(Booted, inserted card, checked, took log)

 

@b0ltun What if you boot the system with the card inserted?

Link to comment
Share on other sites

4 minutes ago, b0ltun said:

 

Sure. Here is the log (inserted before booting process)

 

RTS.txt 750.61 kB · 0 downloads

 

[   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.

Link to comment
Share on other sites

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"

261857894_Screenshot2021-07-18at13_19_09.png.3292530e08038127b7eb0242aeca1f0f.png

RTS.txt

Edited by b0ltun
Link to comment
Share on other sites

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

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.

  • Thanks 1
Link to comment
Share on other sites

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

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.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • Slice changed the title to Realtek PCIe Card Reader Driver for macOS

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 by stevezheng
Link to comment
Share on other sites

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

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.
Link to comment
Share on other sites

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

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

@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

 

  • Like 1
Link to comment
Share on other sites

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

  • Like 2
Link to comment
Share on other sites

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 by whatnameisit
Link to comment
Share on other sites

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).

  • Like 1
Link to comment
Share on other sites

  • Austere.J changed the title to Realtek PCIe/USB SD Card Reader Driver for macOS
×
×
  • Create New...