Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unleash secret usb blue super power [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
while true
Guru
Guru


Joined: 07 Apr 2010
Posts: 532
Location: Ljubljana, Slovenia

PostPosted: Thu May 28, 2020 8:47 am    Post subject: Unleash secret usb blue super power [solved] Reply with quote

Yesterday i got ssd for my rpi, should be fast, was expensive.
i plugged ssd right into rpi, but i had some troubles with it
leading me to believe that my new fast ssd is somehow broken.
So I plugged ssd into pc,
and i got tears of joy when 460MB/s write speed peaked...
13GB copied in seconds, and when i issued sync command
prompt came right back on - and i was motionless...

So I plugged ssd back to rpi, but...
I open mc and i can copy one file at the time ok, (but slow)
but if I choose 8GB of data some things happen:
-speed is slow, starts with 120 MS/s but in minute drops to 4
-after 3-7 GB copied mc complains:
cannot create target file "/media/usb1/def~.mp4.480p.mp4" Read-only file system (30)
-and from glances I can see from disk i/o that /dev/sda*
are no longer listed, but still listed under file sys
-also ls /dev/sd* shows no disk
-and ssd still blinks-eses.
-and, sometimes even all usbs stop working, I can not use mouse or keyboard (led in mouse works, but not keyboard's leds)

is this me being noob and not knowing how to unleash the secret super power of blue usb?

Thank you
_________________
Kind regards, Goran Mitic

alive
while true
kick ass


Last edited by while true on Sat Jun 06, 2020 7:56 am; edited 1 time in total
Back to top
View user's profile Send private message
dr_wulsen
Tux's lil' helper
Tux's lil' helper


Joined: 21 Aug 2013
Posts: 146
Location: Austria

PostPosted: Thu May 28, 2020 8:56 pm    Post subject: Reply with quote

while true,

one could suspect that the SSD is drawing too much power from your pi.
Which one do you have, a Pi4?

If you copy files and suddenly lose your SSD, please check the output of dmesg
It will at least tell what the kernel did see happening before it got lost.

Are you within the recommended power supply rating?
https://www.raspberrypi.org/documentation/hardware/raspberrypi/power/README.md
If not, you can try an USB Y-cable (two type A plugs, one for data and power, the other for power only) and attach an additional power supply (phone charger) to it.

Please post the output of lsusb -tv with the SSD connected without problem;
and the output of dmesg | tail after it has crashed.


Something for later and a general hint:
For the moment you get it working stable, you will want maximum performance. You may improve it by providing the UAS driver (USB Attached SCSI).

Check your kernel config, if the option USB_UAS is enabled.
cd /usr/src/linux; grep CONFIG_USB_UAS .config
If it says "CONFIG_USB_UAS=y" or "CONFIG_USB_UAS=m" you are set and the kernel will automatically use the driver, whenever possible.
This driver can greatly improve the responsiveness and throughput of external drives connected via USB.

You can check lsusb -tv before and after {enabling the option,compiling the kernel, installing the kernel, rebooting to the new kernel}.
If it's not in use (for example: a USB2 flash drive), it will say something like:
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/16p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 3: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
ID 174c:2074 ASMedia Technology Inc. ASM1074 High-Speed hub
|__ Port 1: Dev 6, If 0, Class=Mass Storage, Driver=usb-storage, 480M
ID 0930:6545 Toshiba Corp. Kingston DataTraveler 102/2.0 / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick


Note the driver in use is usb-storage, as opposed to my USB3 external drive:
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 10000M
ID 1d6b:0003 Linux Foundation 3.0 root hub
|__ Port 2: Dev 2, If 0, Class=Mass Storage, Driver=uas, 5000M
ID 152d:0567 JMicron Technology Corp. / JMicron USA Technology Corp. JMS567 SATA 6Gb/s bridge


which uses the UAS driver.
It may as well be possible that some USB3 external devices will NOT use the UAS driver due to incompatibilities. So if you have the driver enabled and it's not in use, the device may just not support it.
_________________
There's no stupid questions, only stupid answers.
Back to top
View user's profile Send private message
while true
Guru
Guru


Joined: 07 Apr 2010
Posts: 532
Location: Ljubljana, Slovenia

PostPosted: Fri May 29, 2020 10:32 am    Post subject: Reply with quote

Hello dr_wulsen

I use rpi4 4GB version,
with sakaki's flavour of genpi64
(that is why i ask here, but i was in wrong place many times before),
oficial raspberry fundation power supply for rpi4,
i do have it overclocked to 2GHz/.6 arm/gpu
i have that armour cooler surrounding rpi
i use two monitors, i say that because you mentioned power and i guess it draws more power if two,
and i have two brown eyes, oh sorry...

the new ssd has just type c usb plugin, no other connections on it.
(what i am aiming at is to switch rpi from sd card to ssd disk)
Code:
~/ $ lsusb -tv
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=uas, 5000M
        ID 0781:5593 SanDisk Corp.
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 2109:3431 VIA Labs, Inc. Hub
        |__ Port 3: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
            ID 0000:0538 
        |__ Port 4: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
            ID 04f2:0402 Chicony Electronics Co., Ltd Genius LuxeMate i200 Keyboard
        |__ Port 4: Dev 4, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
            ID 04f2:0402 Chicony Electronics Co., Ltd Genius LuxeMate i200 Keyboard

also on genpi64:
Code:
ls /usr/src/
total 0

(i am noob i do not know where kernel is, i suspect in /boot/somewhere
i know on pc i build here my kernels, but i guess sakaki premakes one like genkernel...
i am noob and talking out of my bottom hole right now)

and it seems sakaki included those drivers in kernel, since as i learned from a good and trusted source :wink: , driver in use is UAS

ok, and now crushing time, this is dmesg | tail:
Code:
[ 1173.495762] EXT4-fs (sda1): I/O error while writing superblock
[ 1173.495770] EXT4-fs error (device sda1): ext4_journal_check_start:61: Detected aborted journal
[ 1173.495773] EXT4-fs (sda1): Remounting filesystem read-only
[ 1173.495822] Buffer I/O error on dev sda1, logical block 0, lost sync page write
[ 1173.495833] EXT4-fs (sda1): I/O error while writing superblock
[ 1173.495839] EXT4-fs (sda1): ext4_writepages: jbd2_start: 9223372036854775807 pages, ino 27000850; err -30
[ 1173.541070] usb 1-1.4: USB disconnect, device number 4
[ 1173.701222] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 1173.942516] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=0x07 driverbyte=0x00
[ 1173.990895] xhci_hcd 0000:01:00.0: WARN Can't disable streams for endpoint 0x81, streams are being disabled already

dr_wulsen, thank you for your time and input
_________________
Kind regards, Goran Mitic

alive
while true
kick ass
Back to top
View user's profile Send private message
dr_wulsen
Tux's lil' helper
Tux's lil' helper


Joined: 21 Aug 2013
Posts: 146
Location: Austria

PostPosted: Fri May 29, 2020 11:11 am    Post subject: Reply with quote

while true,

you can be sure that a sakaki build will have all you could need, he's been digging deeper into the pi than most mortals :)
so you can ignore the UAS kernel stuff. since it's a readymade build and released by sakaki, there is no need to fiddle with the kernel, so there's no need to include the sources (which can be installed manually, if really required).

Back to the problem, it does look like an unstable connection.
Code:
[ 1173.541070] usb 1-1.4: USB disconnect, device number 4
is pretty much what you will see if you just unplug a pendrive.
one way to test it: you could (if those things even exist) get a cable with two usb-a plugs for more power, which connect to one usb-c plug.
I haven't found them on A****n, so the other thing to try would be a powered USB3.0 hub.
Personally I prefer the stuff from Anker, they haven't failed up to now in my home. However, any externally powered USB3 hub should do the trick.

EDIT:
power consumption of a (hopefully) similar usb-ssd (sandisk extreme portable 1TB) to be found here
If it peaks at 3.5W power, your USB should be able to provide at least (3.5W/5V=0,7A=700mA).
So with a decent raspi power supply (3A and above) you shold be good to go, as the raspi page states 1,2A or 1200mA as maximum combined power output.
Of course, if there's any other USB peripherals, they will take some power too, so you have to add all of them up to get a proper guesstimate.

Since it works on your desktop, we can exclude the cable and disk from our list of suspects; I'd shoot for the USB hub.
_________________
There's no stupid questions, only stupid answers.
Back to top
View user's profile Send private message
while true
Guru
Guru


Joined: 07 Apr 2010
Posts: 532
Location: Ljubljana, Slovenia

PostPosted: Fri May 29, 2020 11:34 am    Post subject: Reply with quote

I use official raspberry pi fundation adapter for rpi4, white one.
15.3W Power Supply, 5.1V, 3.0A
_________________
Kind regards, Goran Mitic

alive
while true
kick ass
Back to top
View user's profile Send private message
while true
Guru
Guru


Joined: 07 Apr 2010
Posts: 532
Location: Ljubljana, Slovenia

PostPosted: Fri May 29, 2020 12:05 pm    Post subject: Reply with quote

i got one powered usb hub... with mini (not micro) cabel.
it took 14 minutes for 13 giga data of files...
but it did not freeze, so it is a power issue

I guess I need blue powered hub?
_________________
Kind regards, Goran Mitic

alive
while true
kick ass
Back to top
View user's profile Send private message
while true
Guru
Guru


Joined: 07 Apr 2010
Posts: 532
Location: Ljubljana, Slovenia

PostPosted: Fri May 29, 2020 3:57 pm    Post subject: Reply with quote

ok, update,

my partner has this tiny credit card size ssd 240 GB disk,
and I tested it, and it seems it works fine,
I get 75-90MB/s read/write and read on pi.
on pc starts with 400 and after a minute drops to 90
after 2min drops to 75 MB/s reading and writing.

So i guess this is not so fast ssd,
but at least it does not need additional power.

She agreed to swap ssd disks. she seems happy...

on pi I can not get faster read write speed from this ssd,
or can I?

thank you
_________________
Kind regards, Goran Mitic

alive
while true
kick ass
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54865
Location: 56N 3W

PostPosted: Fri May 29, 2020 11:16 pm    Post subject: Reply with quote

while true,

How old is your Pi and what firmware does it have?
The original firmware, when the Pi4 was released worked well with my USB3/SATA adaptor.
The next version improved the power efficiency of the USB3 and killed the performance because of errors.
I had to revert the update.

See https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md

Code:
$ rpi-eeprom-update
BCM2711 detected
*** UPDATE REQUIRED ***
BOOTLOADER: update required
CURRENT: Mon 18 Nov 11:06:55 UTC 2019 (1574075215)
 LATEST: Fri 17 Jan 17:37:11 UTC 2020 (1579282631)
VL805: version unknown. Try sudo rpi-eeprom-update
CURRENT:
 LATEST: 000137ad


The bootloader is the code is the SPI ROM that gets everything started. Older Pis use bootcode.bin for that.
The VL805 code, which shares the SPI ROM sets up the USB3 port.
It looks like mine is old.

If you update your install. genup ?
You get the latest firmware files and firmware updater program.
I'm not sure if Sakaki has it set up to auto update the firmware or not.

Oh, I had to turn off UAS too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
while true
Guru
Guru


Joined: 07 Apr 2010
Posts: 532
Location: Ljubljana, Slovenia

PostPosted: Sat Jun 06, 2020 7:16 am    Post subject: Reply with quote

Hello NeddySeagoon

late reply, sorry, you gave me link(s) to read, i had to understand them (well, partialy anyways, kheh)

I had to switch to usb-storage as well, uas just overwhelms rpi.
On average I get now 75M/s with usb-storage on my ssd on rpi4.

also, powered usb 3.0 hub (blue one) helps nothing with uas.
uas and powered usb 2.0 hub did not 'crash', but speed was 12M/s.


Thank you both for helping me getting ssd to work 'fast'.
_________________
Kind regards, Goran Mitic

alive
while true
kick ass
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54865
Location: 56N 3W

PostPosted: Sat Jun 06, 2020 8:39 am    Post subject: Reply with quote

while true,

Its worth trying a VL805 firmware update, if there is one for you.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
while true
Guru
Guru


Joined: 07 Apr 2010
Posts: 532
Location: Ljubljana, Slovenia

PostPosted: Sun Jun 07, 2020 4:19 pm    Post subject: Reply with quote

ah, there is hope?
Code:
sudo rpi-eeprom-update
BCM2711 detected
VL805 firmware in bootloader EEPROM
BOOTLOADER: up-to-date
CURRENT: Wed 03 Jun 2020 12:53:47 PM UTC (1591188827)
 LATEST: Wed 03 Jun 2020 12:53:47 PM UTC (1591188827)
 FW DIR: /lib/firmware/raspberrypi/bootloader/beta
VL805: up-to-date
CURRENT: 000137ad
 LATEST: 000137ad

_________________
Kind regards, Goran Mitic

alive
while true
kick ass
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum