Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread David Wilkinson

On 04/01/17 17:30, Terry Coles wrote:

The hub that I borrowed from David Wilkinson was USB 2.0 and so is the Naked 
one that
we are using for the project, so they should have had at least one built-in 
transaction
translator


I ran lsusb on the hub Terry tried and it does show up as single-TT, 
although it does show up as 4 hubs.


Looks like there 3 hubs attached to USB ports.
1 for ports 1-5 and 1 for each high powered "phone charge" ports.

I assume if you used the 2 high power ports and a normal port that would 
get around the single-TT issue?


lsusb output - http://pastebin.com/JVfiaQXT


--
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread Ralph Corderoy
Hi Terry,

Will wrote:
> > You might try using a multi transaction translator ("Multi-TT") hub
> > instead.
>
> The hub that I borrowed from David Wilkinson was USB 2.0 and so is the
> Naked one that we are using for the project, so they should have had
> at least one built-in transaction translator according to Toms
> hardware.

Do try and find out if you've a Multi-TT hub being used.  It's worth
reading all of
https://www.raspberrypi.org/forums/viewtopic.php?f=28=53832?ref=driverlayer.com/web

tl;dr is the Pi's SoC's single USB port, through which all other USB
travels, isn't much cop?

Cheers, Ralph.

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread Ralph Corderoy
Hi Terry,

> Well OK.  I am surmising that there are conflicts when the three
> devices are all shouting.

OK, but they're not playing audio at this point, just there for bus
enumeration, current negotiation, etc.

> The problem only occurs (and it occurs every time) if I try to connect
> the hub through one USB port.

Have you seen the list of issues on
https://www.raspberrypi.org/documentation/hardware/raspberrypi/usb/README.md
It's out of date, I think, but then so much of the Pi documentation is
frankly shoddy and incomplete.

Because of the OTG hardware limitations, if too many Full- or
Low-speed devices are plugged into a single-TT hub, unreliable
operation of the devices may occur.

> > Try and create a CPU load some other way
>
> Wouldn't that also be a problem when the Adaptors are plugged directly
> into the Pi?

No, because they'd be powered differently then so could have different
behaviour?

> > gzip -9 /dev/null
> >
> > Check `dmesg' output.  `dmesg -w' will wait for new output, similar
> > to journalctl above.
>
> Will need the £11 cable to do those things.

Don't think so because the USB keyboard will continue to work unless CPU
load causes a crash, and if it does then that's good.

Cheers, Ralph.

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread Andrew

On 04/01/17 16:26, Terry Coles wrote:

Also, I think `journalctl -f' might be interesting to watch as you do
things.  You can tap Enter to give you a bit of blank space now and
again so you can see what's new.  You can try doing this over an SSH
connection to the Pi for when you run `startx', but given networking is
also over the Pi's USB port I'd really recommend you use the Pi's serial
port and set the Linux console to use that.  Cables are available.

 http://elinux.org/RPi_Serial_Connection
 http://amzn.to/2iAd006

I tried SSH.  As predicted the Pi is inaccessible.  I could pay for a third of
a Pi 3 for the cost of one of those leads:-)



If you have more than one Raspberry Pi then you can connect their serial 
UARTs together with three wires. Gnd to Gnd, RX to TX, TX to RX.


--

Andrew.


--
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread Terry Coles
On Wednesday, 4 January 2017 16:36:54 GMT William R Sowerbutts wrote:
> >Well OK.  I am surmising that there are conflicts when the three devices
> >are all shouting.
> 
> It may be that there isn't enough USB bandwidth to serve multiple low-speed
> isochronous devices concurrently.

That is what I think too.  If the V1.1 devices throttle the hub to 12 Mps (see 
below), then 
there could well be an issue.

> You might try using a multi transaction translator ("Multi-TT") hub instead.
> 
>   https://en.wikipedia.org/wiki/USB_hub#Transaction_translator
>   http://www.tomshardware.com/reviews/usb-technology,677-3.html
> 
> "lsusb -v" will tell you if your hardware supports multi-TT
> (bInterfaceProtocol, 1 = single-TT, 2 = multi-TT) and if it is enabled
> (bDeviceProtocol, again 2 = multi-TT).
> 
> Although even if multi-TT works, maintenance could be a problem; the risk
> would be that one day the hub breaks, someone replaces it with a Single-TT
> hub assuming it is equivalent to the failed hub, and the thing mysteriously
> breaks.

It's probably cheaper to buy a Pi 3 :-)

The hub that I borrowed from David Wilkinson was USB 2.0 and so is the Naked 
one that 
we are using for the project, so they should have had at least one built-in 
transaction 
translator according to Toms hardware.

-- 



Terry Coles
-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread William R Sowerbutts
>Well OK.  I am surmising that there are conflicts when the three devices are 
>all shouting.

It may be that there isn't enough USB bandwidth to serve multiple low-speed 
isochronous devices concurrently. 

You might try using a multi transaction translator ("Multi-TT") hub instead.

  https://en.wikipedia.org/wiki/USB_hub#Transaction_translator
  http://www.tomshardware.com/reviews/usb-technology,677-3.html

"lsusb -v" will tell you if your hardware supports multi-TT 
(bInterfaceProtocol, 1 = single-TT, 2 = multi-TT) and if it is enabled 
(bDeviceProtocol, again 2 = multi-TT).

Although even if multi-TT works, maintenance could be a problem; the risk 
would be that one day the hub breaks, someone replaces it with a Single-TT 
hub assuming it is equivalent to the failed hub, and the thing mysteriously 
breaks.

Will

_
William R Sowerbutts  w...@sowerbutts.com
"Carpe post meridiem"   http://sowerbutts.com
 main(){char*s=">#=0> ^#X@#@^7=",c=0,m;for(;c<15;c++)for
 (m=-1;m<7;putchar(m++/6%3/2?10:s[c]-31&1<

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread Terry Coles
On Wednesday, 4 January 2017 15:50:00 GMT Ralph Corderoy wrote:
> > It turns out that the problem seems to be that the Hub is connected
> > via a USB port on the Pi (the only one in the case of the Zero).  It
> > looks like that port cannot handle the conflicts when all the Audio
> > Adaptors shout at once.
> 
> I don't see a strong indication that's the cause?  What conflicts?

Well OK.  I am surmising that there are conflicts when the three devices are 
all shouting.

> The different Pis have different USB hardware, and different Linux
> drivers to talk to them IIRC.  And those drivers change over time.  Try
> a distro with a dramatically different kernel version, like an old one.
> It will be another data point.

This problem occurs with a Zero, a Pi 2 and a Pi 3, so I'm discounting the 
hardware at the moment.  I am using the same SD card running Raspbian Jessie 
on all three.  The problem only occurs (and it occurs every time) if I try to 
connect the hub through one USB port.

I will have a look at using an old distro, but the fact that the Adaptors work 
OK when they are accessed through separate USB ports seems to preclude driver 
issues to me.  Maybe I'm wrong.

> Also, I think `journalctl -f' might be interesting to watch as you do
> things.  You can tap Enter to give you a bit of blank space now and
> again so you can see what's new.  You can try doing this over an SSH
> connection to the Pi for when you run `startx', but given networking is
> also over the Pi's USB port I'd really recommend you use the Pi's serial
> port and set the Linux console to use that.  Cables are available.
> 
> http://elinux.org/RPi_Serial_Connection
> http://amzn.to/2iAd006

I tried SSH.  As predicted the Pi is inaccessible.  I could pay for a third of 
a Pi 3 for the cost of one of those leads :-)

> Other thoughts: startx(1) will prod USB as well as creating CPU load
> causing the ARM to draw more power as its frequency increases.  Try and
> create a CPU load some other way;  this should make one core busy and
> you can run it in the background so you can kick off one per core if
> need be.

Wouldn't that also be a problem when the Adaptors are plugged directly into 
the Pi?

> gzip -9 /dev/null
> 
> Check `dmesg' output.  `dmesg -w' will wait for new output, similar to
> journalctl above.

Will need the £11 cable to do those things.

> Replace the audio USB adapters with other devices that will want
> significant current to see if it helps spot when it's the £3 Chinese
> audio USBs or a power issue.

Yes.  Paul says that he has some USB speaker-phone adaptors that I can borrow.  
Otherwise, I suppose I could scrape together some USB hard disks, but they 
tend to be self-powered, so not necessarily conclusive if they work.

I've now raised this on the Raspberry Pi Forum, so my next move is to see what 
they say.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread Ralph Corderoy
Hi Terry,

> Not in fact the problem, see :
> 
> http://forum.modmypi.com/technical-support/usb-audio-adaptors-pi-locking-up-when-booting-t1041.html#p4482
> 
> It turns out that the problem seems to be that the Hub is connected
> via a USB port on the Pi (the only one in the case of the Zero).  It
> looks like that port cannot handle the conflicts when all the Audio
> Adaptors shout at once.

I don't see a strong indication that's the cause?  What conflicts?

> If I plug all the Adaptors directly into a Pi 2 or Pi 3 (even when I
> am using a hub for the other devices (mouse, keyboard, WiFI)),
> everything works.

The different Pis have different USB hardware, and different Linux
drivers to talk to them IIRC.  And those drivers change over time.  Try
a distro with a dramatically different kernel version, like an old one.
It will be another data point.

Also, I think `journalctl -f' might be interesting to watch as you do
things.  You can tap Enter to give you a bit of blank space now and
again so you can see what's new.  You can try doing this over an SSH
connection to the Pi for when you run `startx', but given networking is
also over the Pi's USB port I'd really recommend you use the Pi's serial
port and set the Linux console to use that.  Cables are available.

http://elinux.org/RPi_Serial_Connection
http://amzn.to/2iAd006

Other thoughts: startx(1) will prod USB as well as creating CPU load
causing the ARM to draw more power as its frequency increases.  Try and
create a CPU load some other way;  this should make one core busy and
you can run it in the background so you can kick off one per core if
need be.

gzip -9 /dev/null

Check `dmesg' output.  `dmesg -w' will wait for new output, similar to
journalctl above.

Replace the audio USB adapters with other devices that will want
significant current to see if it helps spot when it's the £3 Chinese
audio USBs or a power issue.

Cheers, Ralph.

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread Terry Coles
On Wednesday, 4 January 2017 15:30:01 GMT Ralph Corderoy wrote:
> > > Have you this page, and in particular the anchored section?
> > > http://elinux.org/RPi_Powered_USB_Hubs#USB_Hub_Power_Hookup
> > 
> > The answer is yes; that's exactly what I am doing.
> 
> So you saw "This section describes two tests that will verify that a USB
> hub has the correct power circuitry"?

Yes.  Although I didn't run them because the problem occurs with more than one 
hub type, including David's with 3 A shared by all ports, and because I have 
now discovered that the problem is the single port that carries all of the USB 
traffic; see my other post.
  
> As mentioned last night, a USB device requests a current allowance.
> `sudo lsusb -v' will show lots of interesting information that's really
> worth reading through;  ignore what doesn't make any sense.  The sudo is
> required.

I added a line to config.txt; 'max_usb_current=1, which doubles the current 
available to each device (in this case the whole hub) to 1.2 A.  This was 
advised by Jake on the ModMyPi forum, but it didn't help.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread Ralph Corderoy
Hi Terry,

> > Have you this page, and in particular the anchored section?
> > http://elinux.org/RPi_Powered_USB_Hubs#USB_Hub_Power_Hookup
>
> The answer is yes; that's exactly what I am doing.

So you saw "This section describes two tests that will verify that a USB
hub has the correct power circuitry"?

As mentioned last night, a USB device requests a current allowance.
`sudo lsusb -v' will show lots of interesting information that's really
worth reading through;  ignore what doesn't make any sense.  The sudo is
required.

Cheers, Ralph.

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread Terry Coles
On Tuesday, 3 January 2017 14:23:45 GMT Terry Coles wrote:
> My previous request for a loan of a powered Hub took me a step closer to
> resolving my problem (thanks David).  The problem is that although I think
> I know now what is causing the problem, I don't know what it is doing to
> the machine.
> 
> So when I plugged David's Hub in, instead of the 'Naked' Hub, I got exactly
> the same symptoms as I got with my own Hub.  So, the 'Naked' Hub isn't the
> cause and neither is the supplied PSU Brick.
> 
> After lots of testing, using different combinations of devices plugged into
> the Hub, I have arrived at the conclusion that the Audio Adaptors are the
> problem:

Not in fact the problem, see :

http://forum.modmypi.com/technical-support/usb-audio-adaptors-pi-locking-up-when-booting-t1041.html#p4482

It turns out that the problem seems to be that the Hub is connected via a USB 
port on the Pi (the only one in the case of the Zero).  It looks like that 
port cannot handle the conflicts when all the Audio Adaptors shout at once.

If I plug all the Adaptors directly into a Pi 2 or Pi 3 (even when I am using 
a hub for the other devices (mouse, keyboard, WiFI)), everything works.

That means that I cannot use a £4 Pi Zero and must use a £30 Pi 3 (the Pi 2 is 
now £32).

Unless   Someone knows how to resolve the issue.  (These devices are USB 
V1.1 and that means that the whole hub runs at V 1.1 speed).

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR