Banquillo
Posts: 9
Joined: Wed Jun 16, 2021 2:48 pm

USB ports suddenly die

Mon Jun 21, 2021 6:26 pm

I'm using sound reproduction using python on a Raspberry Pi 3, but I realized that after some reproductions, all USB ports start getting slower until they die. This makes the mouse and keyboard stop working, but the python script continue working. I tried something and also realized that even when I play mp3 files from file manager, USB ports also die after a while.

I tried to have connected only the mouse and USB speaker to be sure is not a current issue, but this continue happening. if more information is required, just ask for it, thanks.
Last edited by Banquillo on Wed Jun 23, 2021 2:43 pm, edited 1 time in total.

LTolledo
Posts: 5534
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: USB ports suddenly die

Tue Jun 22, 2021 12:00 pm

Banquillo wrote: ..... connected only the mouse and US speaker .....
I take its supposed to be a "USB" speaker.... or I'm seriously mistaken?

anyway... try to look at dmesg to see if there are some serious warnings showing up...

also does the USB somehow "regenerate" or come back to like after reboot or "hard reset"?
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

dbrion06
Posts: 476
Joined: Tue May 28, 2019 11:57 am

Re: USB ports suddenly die

Tue Jun 22, 2021 12:44 pm

try to look at dmesg
Well, if OP has "only" a USB keyboard, typing 'dmesg' can be complicated if USB does not resurrect...
(works with ssh in this deseperate situation)

katesimon123
Posts: 34
Joined: Sun Jun 13, 2021 2:45 am

Re: USB ports suddenly die

Tue Jun 22, 2021 4:00 pm

Looks like there some short-circuiting in the USB connection, don't plug anything.

dbrion06
Posts: 476
Joined: Tue May 28, 2019 11:57 am

Re: USB ports suddenly die

Tue Jun 22, 2021 4:29 pm

do not plug anything
OP should try
powered hub
other USB peripherals
until -s-he finds the culprit

a list of his/her USB peripherals might be useful to help people trying to guess (this is a wild guess at that stage)

OP uses a Pi3? Maybe it has a polyfuse issue (dies, then resurrects) or a bas dupply (is it the official one?)

Banquillo
Posts: 9
Joined: Wed Jun 16, 2021 2:48 pm

Re: USB ports suddenly die

Wed Jun 23, 2021 2:45 pm

[/quote]

also does the USB somehow "regenerate" or come back to like after reboot or "hard reset"?
[/quote]

Yes, since I can't use keyboard or mouse after the problem, disconnect and reconntect the Raspberry, after that, everything come back to normal. I tried with a bluethoot speaker, and there was no problem, but for the project I'm working on I need it to be a USB speaker.

Banquillo
Posts: 9
Joined: Wed Jun 16, 2021 2:48 pm

Re: USB ports suddenly die

Wed Jun 23, 2021 3:11 pm

dbrion06 wrote:
Tue Jun 22, 2021 4:29 pm
do not plug anything
OP should try
powered hub
other USB peripherals
until -s-he finds the culprit

a list of his/her USB peripherals might be useful to help people trying to guess (this is a wild guess at that stage)

OP uses a Pi3? Maybe it has a polyfuse issue (dies, then resurrects) or a bas dupply (is it the official one?)
I have a mouse, keyboarda, the USB speaker, and an Arduino Mega, the rasp is continueusly comunicating with it through serial. At fist I thought it was the source of the problem, but the ports die even when I don't have the Arduino connected. But when I have it connected with the serial comunnication on, USB ports stop working faster.

klricks
Posts: 7833
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: USB ports suddenly die

Wed Jun 23, 2021 4:19 pm

Banquillo wrote:
Wed Jun 23, 2021 3:11 pm
...
I have a mouse, keyboarda, the USB speaker, and an Arduino Mega, the rasp is continueusly comunicating with it through serial. At fist I thought it was the source of the problem, but the ports die even when I don't have the Arduino connected. But when I have it connected with the serial comunnication on, USB ports stop working faster.
How much power does the USB speaker draw?
If the combined total of all USB devices is > 1.2A then the power to the USB ports will be shut down.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

dbrion06
Posts: 476
Joined: Tue May 28, 2019 11:57 am

Re: USB ports suddenly die

Wed Jun 23, 2021 4:25 pm

Well, seems USB does not die (then resurrects, but just faints.Looks like a polyfuse behavior.
RPi B3 has a polyfuse https://raspberrypi.stackexchange.com/q ... pberry-pi3 seems the MF-MSMF250/16X-2
cuts at more than 2.5 A....
What is your USB speaker amperage demand? power (if they claim to be 5 W; it demands more than 1A... which is huge).

You should use a powered USB.... for the speaker (remaining peripherals: mouse -unless it has tons of LEDs- keyboard -unless it has tons of LEDs- and Arduino -unless you connect tons of periferals on a mega- have a reasonable amperage demand....

edited : see viewtopic.php?f=28&t=53832
(confirms the need for a powered hub)

Banquillo
Posts: 9
Joined: Wed Jun 16, 2021 2:48 pm

Re: USB ports suddenly die

Thu Jun 24, 2021 3:38 pm

The USB speaker spec. say it works at 2V - 500mA demand (2W max) which the Raspberry is supposed to provide without any problem, keyboard, mouse are office ones, so no leds. The Arduino Mega has nothing connected, just itself.

I don't think it's a power problem, I just cut the cable, and provide 5v from an external source, the behavior is the same, USB ports "die" after a while (2 or 3 minutes). I'll check the links you just provided, and i'll update if I find something new.

User avatar
scruss
Posts: 4170
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: USB ports suddenly die

Thu Jun 24, 2021 4:15 pm

I had a problem with a USB speaker (now discarded, so I can't check the kind, sorry) that sounds like yours.

While the USB port was rated to take the amplified speaker's power output, the speaker's USB driver identified it as a much lower powered audio interface. USB has current negotiation: a device has to announce how much it needs, and the system can decide to accept it. If the device draws more than the negotiated amount - like my speaker did - problems occur.

If you want to review this route, you'll need the vendor and product IDs of the USB speaker. You can find it by using the lsusb command: they are the two hex numbers in column 6 of the output (for example, 2886:002f), then do this:

Code: Select all

lsusb -v -d 2886:002f | grep MaxPower
    MaxPower              100mA
substituting your IDs for my example.

I think my speakers claimed to only need 100 mA, but were around 2 W, so would really draw up to 400 mA. A powered hub didn't help: the speakers still asked for the wrong amount, so the hub complained when the speakers drew too much power.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 6312
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: USB ports suddenly die

Thu Jun 24, 2021 6:05 pm

scruss wrote:
Thu Jun 24, 2021 4:15 pm
I had a problem with a USB speaker (now discarded, so I can't check the kind, sorry) that sounds like yours.

While the USB port was rated to take the amplified speaker's power output, the speaker's USB driver identified it as a much lower powered audio interface. USB has current negotiation: a device has to announce how much it needs, and the system can decide to accept it. If the device draws more than the negotiated amount - like my speaker did - problems occur.

If you want to review this route, you'll need the vendor and product IDs of the USB speaker. You can find it by using the lsusb command: they are the two hex numbers in column 6 of the output (for example, 2886:002f), then do this:

Code: Select all

lsusb -v -d 2886:002f | grep MaxPower
    MaxPower              100mA
substituting your IDs for my example.

I think my speakers claimed to only need 100 mA, but were around 2 W, so would really draw up to 400 mA. A powered hub didn't help: the speakers still asked for the wrong amount, so the hub complained when the speakers drew too much power.
I'm intrigued - from the number of devices I've extracted** the "MxPwr" "value" for it seemed to be "indicative" rather than usable/trustworthy in that very few appeared to be a "measured/specified" value (to 3 S.F.) and most were 1, 2 or 5 unit (x100mA) "loads".
Trev.
** http://www.cpmspectrepi.uk/raspberry_pi ... erReq.html
http://www.cpmspectrepi.uk/raspberry_pi ... rives.html
http://www.cpmspectrepi.uk/raspberry_pi ... pters.html
http://www.cpmspectrepi.uk/raspberry_pi ... pters.html
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B, B+, and a A+) but Buster on the P3B+, P4B's & P400. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Banquillo
Posts: 9
Joined: Wed Jun 16, 2021 2:48 pm

Re: USB ports suddenly die

Thu Jun 24, 2021 9:20 pm

scruss wrote:
Thu Jun 24, 2021 4:15 pm
I had a problem with a USB speaker (now discarded, so I can't check the kind, sorry) that sounds like yours.

While the USB port was rated to take the amplified speaker's power output, the speaker's USB driver identified it as a much lower powered audio interface. USB has current negotiation: a device has to announce how much it needs, and the system can decide to accept it. If the device draws more than the negotiated amount - like my speaker did - problems occur.

If you want to review this route, you'll need the vendor and product IDs of the USB speaker. You can find it by using the lsusb command: they are the two hex numbers in column 6 of the output (for example, 2886:002f), then do this:

Code: Select all

lsusb -v -d 2886:002f | grep MaxPower
    MaxPower              100mA
substituting your IDs for my example.

I think my speakers claimed to only need 100 mA, but were around 2 W, so would really draw up to 400 mA. A powered hub didn't help: the speakers still asked for the wrong amount, so the hub complained when the speakers drew too much power.

I just made what you said, and yes, it says the max power from my speaker is 100mA, even when it actually is a 500mA speaker, what can I do in order to solve this problem?

User avatar
scruss
Posts: 4170
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: USB ports suddenly die

Fri Jun 25, 2021 2:58 am

I don't know if udev allows you to modify MaxPower values. Aside from an external power supply, I don't know, sorry
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

Banquillo
Posts: 9
Joined: Wed Jun 16, 2021 2:48 pm

Re: USB ports suddenly die

Fri Jun 25, 2021 6:20 pm

scruss wrote:
Fri Jun 25, 2021 2:58 am
I don't know if udev allows you to modify MaxPower values. Aside from an external power supply, I don't know, sorry
Ok, don't worry, but how did you solve your problem with your speaker then?

User avatar
scruss
Posts: 4170
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: USB ports suddenly die

Fri Jun 25, 2021 7:30 pm

I threw it out and abandoned the project.
Sorry.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

Return to “Beginners”