[Desktop-packages] [Bug 1614050] Re: Window depth order messed up

2016-11-18 Thread Dane Maslen
And just for the record I'll add that in the week or so since I
installed the package from the -proposed repository I have had no
recurrence of either of the two symptoms (wrong window displayed on top,
all windows displayed behind desktop background) that I had previously
been encountering every day or two.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to metacity in Ubuntu.
https://bugs.launchpad.net/bugs/1614050

Title:
  Window depth order messed up

Status in metacity package in Ubuntu:
  Fix Released
Status in metacity source package in Xenial:
  Fix Committed

Bug description:
  # Test Case
  Described in comment 
https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/1614050/comments/16

  # Impact
  Sometimes the window depth order is wrong, for example the desktop icons 
appear above all windows. Also sometimes windows disappear and the only way to 
bring them back to life is restarting Metacity. This can result in loss of work 
results for users who do not know how to deal with this bug.

  # Fix
  The Xenial fix is composed of two upstream commits, in gnome-3-18 branch:
  - https://git.gnome.org/browse/metacity/commit/?id=d5f9e42e30c67d07
  - https://git.gnome.org/browse/metacity/commit/?id=72488dc76ee24a3e

  # Regression Potential
  The patch has been in Yakkety for almost a month, and nobody complained.
  [bdmurray] - That's not a description of what could go wrong, rather one of 
what hasn't gone wrong in Yakkety.  Please add some possible regressions and 
what users testing this fix should look out for.

  =
  Using the gome-flashback session with metacity is totally messed up since I 
updated from Ubuntu 14.04.3 to 16.04.1.

  All the effects mentioned here do not appear when using compiz, so I
  guess Metacity is broken.

  -Windows that should open in front (like Kupfer) appear behind the
  windows already open.

  -Before nemo is run, the Ubuntu default desktop background image
  appear, it can't be changed by settings. I just guess this is due
  wrong ordering of the true background and some window used by Gnome
  for showing the selected background.

  -If nemo is run to take over the desktop, the destkop icons appear in
  front of all windows.

  I guess all those effects originate from a similiar reason. None of
  these problems where appearant at Ubuntu 14.04.

  This is a total show stopper for using metacity on 16.04 as everyday
  applications like nemo and Kupfer can't be used.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/1614050/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp


[Desktop-packages] [Bug 1614050] Re: Window depth order messed up

2016-11-10 Thread Dane Maslen
I have now installed the package from the -proposed repository.  I was
suffering the effects of the bug every day or two (and did not know what
particular sequence of actions by me was triggering it), so I'll need a
week or more to become reasonably confident that the bug is no longer
affecting me.  On the other hand if it is still affecting me, I'll
probably now within a couple of days.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to metacity in Ubuntu.
https://bugs.launchpad.net/bugs/1614050

Title:
  Window depth order messed up

Status in metacity package in Ubuntu:
  Fix Released
Status in metacity source package in Xenial:
  Fix Committed

Bug description:
  # Test Case
  Described in comment 
https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/1614050/comments/16

  # Impact
  Sometimes the window depth order is wrong, for example the desktop icons 
appear above all windows. Also sometimes windows disappear and the only way to 
bring them back to life is restarting Metacity. This can result in loss of work 
results for users who do not know how to deal with this bug.

  # Fix
  The Xenial fix is composed of two upstream commits, in gnome-3-18 branch:
  - https://git.gnome.org/browse/metacity/commit/?id=d5f9e42e30c67d07
  - https://git.gnome.org/browse/metacity/commit/?id=72488dc76ee24a3e

  # Regression Potential
  The patch has been in Yakkety for almost a month, and nobody complained.
  [bdmurray] - That's not a description of what could go wrong, rather one of 
what hasn't gone wrong in Yakkety.  Please add some possible regressions and 
what users testing this fix should look out for.

  =
  Using the gome-flashback session with metacity is totally messed up since I 
updated from Ubuntu 14.04.3 to 16.04.1.

  All the effects mentioned here do not appear when using compiz, so I
  guess Metacity is broken.

  -Windows that should open in front (like Kupfer) appear behind the
  windows already open.

  -Before nemo is run, the Ubuntu default desktop background image
  appear, it can't be changed by settings. I just guess this is due
  wrong ordering of the true background and some window used by Gnome
  for showing the selected background.

  -If nemo is run to take over the desktop, the destkop icons appear in
  front of all windows.

  I guess all those effects originate from a similiar reason. None of
  these problems where appearant at Ubuntu 14.04.

  This is a total show stopper for using metacity on 16.04 as everyday
  applications like nemo and Kupfer can't be used.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/1614050/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp


[Desktop-packages] [Bug 1175093] Re: K3520-Z mode not switched automatically

2013-05-12 Thread Dane Maslen
I've pinned down the origin of the bug: the information being provided
by udev to usb_modeswitch is not what usb_modeswitch is expecting.  If
my understanding of the udev documentation is correct, then there must
be a bug in udev that is causing it to perform its %b substitution
incorrectly.  Only an examination of the udev code can reveal why this
is happening.

Recall that the line in /lib/udev/rules.d/40-usb_modeswitch.rules that
gets matched for the K3520-Z is

ATTRS{idVendor}==19d2, ATTRS{idProduct}==2000, RUN+=usb_modeswitch
'%b/%k'

The udev documentation states:

$id, %b
   The name of the device matched while searching the devpath upwards
   for SUBSYSTEMS, KERNELS, DRIVERS and ATTRS.

Thus for the above rule %b ought to be the name of the parent device for
which idVendor is 19d2 and idProduct is 2000.

From an examination of the contents of /sys/bus/usb/devices I have been
able to establish that the idVendor and idProduct files are in
/sys/bus/usb/devices/7-1 so 7-1 is the device for which idVendor and
idProduct matched.  If, however, you look back at the debug output from
usb_modeswitch you will see the following:

Raw args from udev: 7-1:1.0/7-1:1.0

i.e. udev has told usb_modeswitch that 7-1:1.0 was the device for which
idVendor and idProduct matched.  This misdirects usb_modeswitch into
trying to read device data from /sys/bus/usb/devices/7-1:1.0 and as that
directory does not contain  idVendor and idProduct files, usb_modeswitch
is unable to identify the vendor and product with the result that it
can't work out how to switch the dongle's mode.

By once again renaming the kernel module usb-storage.ko out of the way
to prevent it automatically switching the K3770's mode, I have been able
to do the same analysis for the interaction between udev and
usb_modeswitch for that dongle.

The line in /lib/udev/rules.d/40-usb_modeswitch.rules that gets matched
for the K3770 is

ATTRS{idVendor}==12d1, ATTRS{idProduct}==14d1, RUN+=usb_modeswitch
'%b/%k'

so  %b ought to be the name of the parent device for which idVendor is
12d1 and idProduct is 14d1.   From an examination of the contents of
/sys/bus/usb/devices it is evident that the idVendor and idProduct files
are in /sys/bus/usb/devices/2-4 so 2-4 is the device for which idVendor
and idProduct match.  In this instance the debug output from
usb_modeswitch starts

Raw args from udev: /2-4:1.0

Bus ID for device not given by udev.
 Trying to determine it from kernel name (2-4:1.0) ...
Using top device dir /sys/bus/usb/devices/2-4

Once again udev has failed to pass the correct name of the device for
which idVendor and idProduct matched, but this time it has passed a null
value rather than an incorrect one.  Fortuitously usb_modeswitch seems
to have code to cover this error, correctly deduces that the device
directory to use is 2-4, and hence is able to read the idVendor and
idProduct details successfully such that it can determine what steps are
necessary to switch the dongle's mode.

And that's my last word on the subject (other than to answer my own
question in the previous comment: I was indeed being naïve) for at least
a month.  If no one has shown any interest in this bug by the time I get
back from holiday, I might try taking a look at the udev code (if I can
find it) to see if I can see what's going wrong there, always assuming
that it's written in a programming language that I understand.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1175093

Title:
  K3520-Z mode not switched automatically

Status in “network-manager” package in Ubuntu:
  New

Bug description:
  Ubuntu 12.04.2 LTS

  Although I have logged this as a network-manager problem, it could
  well turn out to be an issue with usb-modeswitch (usb-modeswitch
  1.2.3+repack0-1ubuntu2) or usb-modeswitch-data (usb-modeswitch-data
  20120120-0ubuntu1).

  Expected behaviour (and what happened in 10.04):
   * The presence of mobile broadband dongle K3520-Z should be detected.
   * The appropriate steps should be taken to switch it from usb-storage mode.
   * Mobile broadband should be enabled.

  What actually happens:
   * The dongle remains in usb-storage mode.
   * Mobile broadband does not appear as an option on the network drop-down 
menu.

  The following commands can be used to work around the problem:

  sudo modprobe --verbose option

  sudo echo 19d2 0055 /sys/bus/usb-serial/drivers/option1/new_id

  sudo usb_modeswitch --default-vendor 0x19d2 --default-product 0x2000
  --message-content
  5553424312345678061e00
  --message-
  content2=5553424312345679061b000200
  --message-
  content3=555342431234567020008c85010101180101010101
  --need-response --target-vendor 0x19d2 --target-product 0x0055 -s 20
  -D

  After these commands mobile broadband appears as 

[Desktop-packages] [Bug 1175093] Re: K3520-Z mode not switched automatically

2013-05-10 Thread Dane Maslen
I had decided that the next thing to do was to try to get debug output
from usb_modeswitch.  In my efforts to find out how to do this I came
across

  http://www.draisberghof.de/usb_modeswitch/#trouble

which includes a couple of notes about devices with ID 19d2:2000.  The
K3520-Z is one such device.

One of the notes is to the effect that newer kernels attempt to switch
the mode of some devices and get it wrong for ID 19d2:2000, thereby
messing things up for usb_modeswitch.  I've no idea whether that is what
is happening to me (if it is, then this is a kernel problem), but the
revelation that the kernel switches the mode of some devices probably
explains why my K3770 switches mode without usb_modeswitch getting
involved.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1175093

Title:
  K3520-Z mode not switched automatically

Status in “network-manager” package in Ubuntu:
  New

Bug description:
  Ubuntu 12.04.2 LTS

  Although I have logged this as a network-manager problem, it could
  well turn out to be an issue with usb-modeswitch (usb-modeswitch
  1.2.3+repack0-1ubuntu2) or usb-modeswitch-data (usb-modeswitch-data
  20120120-0ubuntu1).

  Expected behaviour (and what happened in 10.04):
   * The presence of mobile broadband dongle K3520-Z should be detected.
   * The appropriate steps should be taken to switch it from usb-storage mode.
   * Mobile broadband should be enabled.

  What actually happens:
   * The dongle remains in usb-storage mode.
   * Mobile broadband does not appear as an option on the network drop-down 
menu.

  The following commands can be used to work around the problem:

  sudo modprobe --verbose option

  sudo echo 19d2 0055 /sys/bus/usb-serial/drivers/option1/new_id

  sudo usb_modeswitch --default-vendor 0x19d2 --default-product 0x2000
  --message-content
  5553424312345678061e00
  --message-
  content2=5553424312345679061b000200
  --message-
  content3=555342431234567020008c85010101180101010101
  --need-response --target-vendor 0x19d2 --target-product 0x0055 -s 20
  -D

  After these commands mobile broadband appears as a disabled option in
  the network drop-down menu.  Once mobile broadband is manually
  enabled, all is well.

  The remainder of this bug report might or might not contain useful
  information.

  When I tried researching this problem, I encountered threads in
  various forums that seemed to be reporting the same failure but for
  different dongles.  This bug might therefore not be limited to the
  K3520-Z, but I do know that it doesn't apply to a K3770 as I also have
  one of those (I suppose I could swap the SIM from the K3520-Z to the
  K3770 to work around the problem, but I'd rather not risk damaging the
  SIM in the process).

  When I first encountered this problem after upgrading from 10.04.01 to
  12.04.2, I was puzzled by the fact that mobile broadband had worked
  perfectly after the upgrade completed but then failed on a later
  startup.  I was further confused when from time to time it worked on
  subsequent startups.  I have, however, now realised what was going on
  and have tested my understanding appropriately.  Following a shutdown
  and startup mobile broadband fails because the dongle has been powered
  down and hence has reverted to usb-storage mode, but following a
  restart mobile broadband works (providing it was working prior to the
  restart) because the dongle has remained powered throughout and hence
  has not reverted to usb-storage mode.

  This problem manifests itself in the same way on a netbook (I'll
  provide more details of the hardware if they are considered useful).
  This is what might well be expected, but I mention it because on
  10.04.1 I had an entirely different experience.  The K3520-Z used to
  switch mode automatically on both systems, but I had to switch the
  K3770 manually on the netbook (this is why I was able to come up with
  the above workaround after upgrading to 12.04.02 - I had done all the
  hard work discovering the workaround 18 months ago when I bought the
  K3770 while on holiday in Spain and now just needed to find the
  correct usb_modeswitch options for the K3520-Z).  No, you haven't
  misread that.  The dongle that switched mode automatically on both
  systems in 10.04.01 now fails to switch automatically on both in
  12.04.02, while the one that switched automatically on only one of the
  two systems  in 10.04.01 now switches automatically on both in
  12.04.02.

  If it's on any interest, the following is the output from the above
  commands:

  Looking for target devices ...
   No devices in target mode or class found
  Looking for default devices ...
 found matching product ID
 adding device
   Found device in default mode, class or configuration (1)
  Accessing 

[Desktop-packages] [Bug 1175093] Re: K3520-Z mode not switched automatically

2013-05-10 Thread Dane Maslen
I tried blacklisting the usb_storage module (as suggested by
http://www.draisberghof.de/usb_modeswitch/#trouble) to see if this bug
is caused by that kernel module.  Unfortunately I then trip over this
bug:

https://bugs.launchpad.net/ubuntu/+source/module-init-tools/+bug/1035739

which means that the blacklisting is ignored (to be precise the
usb_storage module isn't loaded at boot but gets loaded as soon as any
usb storage device is connected to the system).  Great!

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1175093

Title:
  K3520-Z mode not switched automatically

Status in “network-manager” package in Ubuntu:
  New

Bug description:
  Ubuntu 12.04.2 LTS

  Although I have logged this as a network-manager problem, it could
  well turn out to be an issue with usb-modeswitch (usb-modeswitch
  1.2.3+repack0-1ubuntu2) or usb-modeswitch-data (usb-modeswitch-data
  20120120-0ubuntu1).

  Expected behaviour (and what happened in 10.04):
   * The presence of mobile broadband dongle K3520-Z should be detected.
   * The appropriate steps should be taken to switch it from usb-storage mode.
   * Mobile broadband should be enabled.

  What actually happens:
   * The dongle remains in usb-storage mode.
   * Mobile broadband does not appear as an option on the network drop-down 
menu.

  The following commands can be used to work around the problem:

  sudo modprobe --verbose option

  sudo echo 19d2 0055 /sys/bus/usb-serial/drivers/option1/new_id

  sudo usb_modeswitch --default-vendor 0x19d2 --default-product 0x2000
  --message-content
  5553424312345678061e00
  --message-
  content2=5553424312345679061b000200
  --message-
  content3=555342431234567020008c85010101180101010101
  --need-response --target-vendor 0x19d2 --target-product 0x0055 -s 20
  -D

  After these commands mobile broadband appears as a disabled option in
  the network drop-down menu.  Once mobile broadband is manually
  enabled, all is well.

  The remainder of this bug report might or might not contain useful
  information.

  When I tried researching this problem, I encountered threads in
  various forums that seemed to be reporting the same failure but for
  different dongles.  This bug might therefore not be limited to the
  K3520-Z, but I do know that it doesn't apply to a K3770 as I also have
  one of those (I suppose I could swap the SIM from the K3520-Z to the
  K3770 to work around the problem, but I'd rather not risk damaging the
  SIM in the process).

  When I first encountered this problem after upgrading from 10.04.01 to
  12.04.2, I was puzzled by the fact that mobile broadband had worked
  perfectly after the upgrade completed but then failed on a later
  startup.  I was further confused when from time to time it worked on
  subsequent startups.  I have, however, now realised what was going on
  and have tested my understanding appropriately.  Following a shutdown
  and startup mobile broadband fails because the dongle has been powered
  down and hence has reverted to usb-storage mode, but following a
  restart mobile broadband works (providing it was working prior to the
  restart) because the dongle has remained powered throughout and hence
  has not reverted to usb-storage mode.

  This problem manifests itself in the same way on a netbook (I'll
  provide more details of the hardware if they are considered useful).
  This is what might well be expected, but I mention it because on
  10.04.1 I had an entirely different experience.  The K3520-Z used to
  switch mode automatically on both systems, but I had to switch the
  K3770 manually on the netbook (this is why I was able to come up with
  the above workaround after upgrading to 12.04.02 - I had done all the
  hard work discovering the workaround 18 months ago when I bought the
  K3770 while on holiday in Spain and now just needed to find the
  correct usb_modeswitch options for the K3520-Z).  No, you haven't
  misread that.  The dongle that switched mode automatically on both
  systems in 10.04.01 now fails to switch automatically on both in
  12.04.02, while the one that switched automatically on only one of the
  two systems  in 10.04.01 now switches automatically on both in
  12.04.02.

  If it's on any interest, the following is the output from the above
  commands:

  Looking for target devices ...
   No devices in target mode or class found
  Looking for default devices ...
 found matching product ID
 adding device
   Found device in default mode, class or configuration (1)
  Accessing device 002 on bus 007 ...
  Getting the current device configuration ...
   OK, got current device configuration (1)
  Using first interface: 0x00
  Using endpoints 0x09 (out) and 0x89 (in)
  Inquiring device details; driver will be detached ...
  Looking for 

[Desktop-packages] [Bug 1175093] Re: K3520-Z mode not switched automatically

2013-05-10 Thread Dane Maslen
I've now ruled out kernel module usb_storage as the cause of the problem
and have found that usb_modeswitch is failing to read device information
even though lsusb shows me that the relevant information is available.
I'm not familiar with device naming, but I can't see how
/sys/bus/usb/devices/7-1:1.0 relates to the information I can get from
lsusb.  In particular lsusb refers to 'Bus 007 Device 004' while
usb_modeswitch has been passed '7-1:1.0' by udev.  Am I naïve in
expecting to see a '4' somewhere in the parameter passed by udev?

I removed usb-storage.ko (by renaming it to out of the  kernel directory
tree), rebooted and tested both dongles.  The K3520-Z behaved as before,
i.e. it failed to switch modes.  The K-3770 still worked, but checking
udev debug output in syslog revealed that its mode was now being
switched by usb_modeswitch rather than by the kernel module usb_storage.

My next step was to enable debug output in usb_modeswitch.  It produced
the following:

USB_ModeSwitch log from Fri May 10 17:48:11 2013

Using global config file: /etc/usb_modeswitch.conf

Raw args from udev: 7-1:1.0/7-1:1.0

Using top device dir /sys/bus/usb/devices/7-1:1.0

USB dir exists: /sys/bus/usb/devices/7-1:1.0
Warning: USB attribute idVendor not readable.
Warning: USB attribute idProduct not readable.
Warning: USB attribute manufacturer not readable.
Warning: USB attribute product not readable.
Warning: USB attribute serial not readable.
Warning: USB attribute bNumConfigurations not readable.
Warning: USB attribute bConfigurationValue not readable.
Warning: USB attribute devnum not readable.
Warning: USB attribute busnum not readable.

SCSI dir exists: /sys/bus/usb/devices/7-1:1.0
Warning: SCSI attribute vendor not readable.
Warning: SCSI attribute model not readable.
Warning: SCSI attribute rev not readable.
USB IDs not found in sysfs tree. Exiting.

So, basically usb_modeswitch (I think it's actually
usb_modeswitch_dispatcher but I could be wrong)  is failing to get any
information about the device and hence can't look the device up in the
usb_modeswitch_data tarball to find out the actions necessary to switch
the mode.

The following is the output from lsusb --verbose -d 19d2:2000 and shows
that the information that usb_modeswitch can't read is in fact
available:

Bus 007 Device 004: ID 19d2:2000 ZTE WCDMA Technologies MSM 
MF627/MF628/MF628+/MF636+ HSDPA/HSUPA
Couldn't open device, some information will be missing
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   1.10
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0 
  bDeviceProtocol 0 
  bMaxPacketSize064
  idVendor   0x19d2 ZTE WCDMA Technologies MSM
  idProduct  0x2000 MF627/MF628/MF628+/MF636+ HSDPA/HSUPA
  bcdDevice0.00
  iManufacturer   1 
  iProduct2 
  iSerial 3 
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   32
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  0 
bmAttributes 0xa0
  (Bus Powered)
  Remote Wakeup
MaxPower  500mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   2
  bInterfaceClass 8 Mass Storage
  bInterfaceSubClass  6 SCSI
  bInterfaceProtocol 80 Bulk-Only
  iInterface  0 
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x89  EP 9 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x09  EP 9 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   0

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1175093

Title:
  K3520-Z mode not switched automatically

Status in “network-manager” package in Ubuntu:
  New

Bug description:
  Ubuntu 12.04.2 LTS

  Although I have logged this as a network-manager problem, it could
  well turn out to be an issue with usb-modeswitch (usb-modeswitch
  1.2.3+repack0-1ubuntu2) or usb-modeswitch-data (usb-modeswitch-data
  20120120-0ubuntu1).

  Expected behaviour (and what happened in 10.04):
   * The presence of mobile 

[Desktop-packages] [Bug 1175093] Re: K3520-Z mode not switched automatically

2013-05-09 Thread Dane Maslen
I've now done a lot more investigating and I'm pretty sure this is a
problem in usb_modeswitch.  If I knew how to modify this bug report to
point the finger at usb_modeswitch rather than network-manager I would
do so, but I can't see an obvious way to do so.  Perhaps someone more
familiar with Launchpad could do so for me.  Thanks.

From my investigations I believe that this is what is supposed to happen when 
the mobile broadband dongle is pugged in:
 A: udev finds a matching rule in /lib/udev/rules.d/40-usb_modeswitch.rules 
(the rule matches based on key-value pairs for idVendor and idProduct and 
specifies the assignment pair RUN+=usb_modeswitch '%b/%k')
 B: that causes udev to run the shell script lib/udev/usb_modeswitch
 C: the shell script execs the executable /usr/sbin/usb_modeswitch_dispatcher
 D: the executable consults information somewhere (in older versions of 
usb_modeswitch it was a collection of files in  /etc/usb_modeswitch.d, but now 
I believe it is a single tar file somewhere) to determine the usb_modeswitch 
options required to switch the dongle out of usb storage mode
 E: the executable invokes /usr/sbin/usb_modeswitch with the appropriate options
 F: /usr/sbin/usb_modeswitch switches the dongle out of usb storage mode
 G: udev finds matching rules in  /lib/udev/rules.d/40-usb_modeswitch.rules for 
the new device (i.e. the dongle switched out of usb storage mode); these rules 
specify the assignment pairs PROGRAM=usb_modeswitch --symlink-name %p 
%s{idVendor} %s{idProduct} %E{PRODUCT}, SYMLINK=%c and RUN+=usb_modeswitch 
--driver-bind %p %s{idVendor} %s{idProduct} %E{PRODUCT}
 H: that causes udev to run the shell script /lib/udev/usb_modeswitch
 I: the shell script loads the option driver (using modprobe) if it not already 
loaded and adds the dongle to the devices managed by the option driver (by 
writing the vendor id and product id to 
/sys/bus/usb-serial/drivers/option1/new_id)

In practice that's not what is happening.  Either D or E is not
happening correctly with the result that steps F to I are not occurring.

My original workaround did the equivalent of I and E manually.  In the
course of my further investigations I discovered that only E needed to
be done.  Once the dongle is switched manually out of usb storage mode,
steps G to I automatically occur successfully.

I have now come up with a new workaround based on a udev rules file that
effectively bypasses steps B, C and D (i.e. it bypasses
usb_modeswitch_dispatcher which I strongly suspect to be the culprit
here).  With this workaround in place my K3520-Z now switches mode
automatically when plugged in.

Anyone who has been paying close attention might well be wondering But
if all that is the case, how come the K3770 works?  The answer seems to
be that something other than usb_modeswitch is switching it out of usb
storage mode, but I have yet to deduce what is doing it.  It is,
however, certainly the case that even though steps A to F are not
occurring for the K3770 it is switching modes such that steps G to I are
then occurring.

Over the course of the next day or so I shall post further comments that
provide the supporting evidence for various of the above assertions and
that present my new workaround.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1175093

Title:
  K3520-Z mode not switched automatically

Status in “network-manager” package in Ubuntu:
  New

Bug description:
  Ubuntu 12.04.2 LTS

  Although I have logged this as a network-manager problem, it could
  well turn out to be an issue with usb-modeswitch (usb-modeswitch
  1.2.3+repack0-1ubuntu2) or usb-modeswitch-data (usb-modeswitch-data
  20120120-0ubuntu1).

  Expected behaviour (and what happened in 10.04):
   * The presence of mobile broadband dongle K3520-Z should be detected.
   * The appropriate steps should be taken to switch it from usb-storage mode.
   * Mobile broadband should be enabled.

  What actually happens:
   * The dongle remains in usb-storage mode.
   * Mobile broadband does not appear as an option on the network drop-down 
menu.

  The following commands can be used to work around the problem:

  sudo modprobe --verbose option

  sudo echo 19d2 0055 /sys/bus/usb-serial/drivers/option1/new_id

  sudo usb_modeswitch --default-vendor 0x19d2 --default-product 0x2000
  --message-content
  5553424312345678061e00
  --message-
  content2=5553424312345679061b000200
  --message-
  content3=555342431234567020008c85010101180101010101
  --need-response --target-vendor 0x19d2 --target-product 0x0055 -s 20
  -D

  After these commands mobile broadband appears as a disabled option in
  the network drop-down menu.  Once mobile broadband is manually
  enabled, all is well.

  The remainder of this bug report might or might not contain useful

[Desktop-packages] [Bug 1175093] Re: K3520-Z mode not switched automatically

2013-05-09 Thread Dane Maslen
The attached file is an extract from syslog that includes debug output
from udev when the K3520-Z is connected to the system.

udev finds a matching entry in /lib/udev/rules.d/40-usb_modeswitch.rules
at line 565.  That line is

ATTRS{idVendor}==19d2, ATTRS{idProduct}==2000, RUN+=usb_modeswitch
'%b/%k'

so udev runs

usb_modeswitch '7-1:1.0/7-1:1.0'

What /lib/udev/usb_modeswitch does in response to this invocation is not
revealed by the entries in syslog.  In theory it should run
usb_modeswitch_dispatcher which should then run /usr/sbin/usb_modeswitch
with parameters something like this:

usb_modeswitch --default-vendor 0x19d2 --default-product 0x2000
--message-content
5553424312345678061e00
--message-
content2=5553424312345679061b000200
--message-
content3=555342431234567020008c85010101180101010101
--need-response --target-vendor 0x19d2 --target-product 0x0055 -s 20 -D

but that is certainly not happening as the dongle remains in usb storage
mode.

In my next comment I shall show the extract from syslog when I manually
use usb_modeswitch to switch the dongle's mode.



** Attachment added: k3520z-1.log
   
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1175093/+attachment/3671217/+files/k3520z-1.log

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1175093

Title:
  K3520-Z mode not switched automatically

Status in “network-manager” package in Ubuntu:
  New

Bug description:
  Ubuntu 12.04.2 LTS

  Although I have logged this as a network-manager problem, it could
  well turn out to be an issue with usb-modeswitch (usb-modeswitch
  1.2.3+repack0-1ubuntu2) or usb-modeswitch-data (usb-modeswitch-data
  20120120-0ubuntu1).

  Expected behaviour (and what happened in 10.04):
   * The presence of mobile broadband dongle K3520-Z should be detected.
   * The appropriate steps should be taken to switch it from usb-storage mode.
   * Mobile broadband should be enabled.

  What actually happens:
   * The dongle remains in usb-storage mode.
   * Mobile broadband does not appear as an option on the network drop-down 
menu.

  The following commands can be used to work around the problem:

  sudo modprobe --verbose option

  sudo echo 19d2 0055 /sys/bus/usb-serial/drivers/option1/new_id

  sudo usb_modeswitch --default-vendor 0x19d2 --default-product 0x2000
  --message-content
  5553424312345678061e00
  --message-
  content2=5553424312345679061b000200
  --message-
  content3=555342431234567020008c85010101180101010101
  --need-response --target-vendor 0x19d2 --target-product 0x0055 -s 20
  -D

  After these commands mobile broadband appears as a disabled option in
  the network drop-down menu.  Once mobile broadband is manually
  enabled, all is well.

  The remainder of this bug report might or might not contain useful
  information.

  When I tried researching this problem, I encountered threads in
  various forums that seemed to be reporting the same failure but for
  different dongles.  This bug might therefore not be limited to the
  K3520-Z, but I do know that it doesn't apply to a K3770 as I also have
  one of those (I suppose I could swap the SIM from the K3520-Z to the
  K3770 to work around the problem, but I'd rather not risk damaging the
  SIM in the process).

  When I first encountered this problem after upgrading from 10.04.01 to
  12.04.2, I was puzzled by the fact that mobile broadband had worked
  perfectly after the upgrade completed but then failed on a later
  startup.  I was further confused when from time to time it worked on
  subsequent startups.  I have, however, now realised what was going on
  and have tested my understanding appropriately.  Following a shutdown
  and startup mobile broadband fails because the dongle has been powered
  down and hence has reverted to usb-storage mode, but following a
  restart mobile broadband works (providing it was working prior to the
  restart) because the dongle has remained powered throughout and hence
  has not reverted to usb-storage mode.

  This problem manifests itself in the same way on a netbook (I'll
  provide more details of the hardware if they are considered useful).
  This is what might well be expected, but I mention it because on
  10.04.1 I had an entirely different experience.  The K3520-Z used to
  switch mode automatically on both systems, but I had to switch the
  K3770 manually on the netbook (this is why I was able to come up with
  the above workaround after upgrading to 12.04.02 - I had done all the
  hard work discovering the workaround 18 months ago when I bought the
  K3770 while on holiday in Spain and now just needed to find the
  correct usb_modeswitch options for the K3520-Z).  No, you haven't
  

[Desktop-packages] [Bug 1175093] Re: K3520-Z mode not switched automatically

2013-05-09 Thread Dane Maslen
The attached file is an extract from syslog that includes debug output
from udev when I manually use usb_modeswitch to switch the K3520-Z's
mode, i.e. when I issue the command

usb_modeswitch --default-vendor 0x19d2 --default-product 0x2000
--message-content
5553424312345678061e00
--message-
content2=5553424312345679061b000200
--message-
content3=555342431234567020008c85010101180101010101
--need-response --target-vendor 0x19d2 --target-product 0x0055 -s 20 -D

You will notice that initially there is a lot of activity removing the
storage device that no longer exists.  Then udev starts looking for
rules for the new device.  First it finds a matching entry in
/lib/udev/rules.d/40-usb_modeswitch.rules at line 9. That line is

KERNEL==ttyUSB*, ATTRS{bNumConfigurations}==*,
PROGRAM=usb_modeswitch --symlink-name %p %s{idVendor} %s{idProduct}
%E{PRODUCT}, SYMLINK=%c

Then it finds another matching entry in
/lib/udev/rules.d/40-usb_modeswitch.rules at line 16.  That line is

ATTR{bInterfaceClass}==ff, ATTR{bInterfaceNumber}==00,
ATTRS{bNumConfigurations}==*, RUN+=usb_modeswitch --driver-bind %p
%s{idVendor} %s{idProduct} %E{PRODUCT}

This is the rule that causes /lib/udev/usb_modeswitch to load the option
driver if it not already loaded and to add the dongle to the devices
managed by the option driver.

All of that activity would have appeared in the syslog extract in my
previous comment if usb_modeswitch had successfully switched the
dongle's mode at udev's instigation.

One other thing that you will find in the attached syslog extract is the
following entry made by usb_modeswitch:

May  9 09:37:07 dell-desktop usb_modeswitch: switching device 19d2:2000
on 007/004

Bear this in mind when reading my next comment in which I shall show the
extract from syslog that includes debug output from udev when the K3770
is connected to the system.

** Attachment added: syslog extract showing udev debug output after manually 
using usb_modeswitch
   
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1175093/+attachment/3671279/+files/k3520z-2.log

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1175093

Title:
  K3520-Z mode not switched automatically

Status in “network-manager” package in Ubuntu:
  New

Bug description:
  Ubuntu 12.04.2 LTS

  Although I have logged this as a network-manager problem, it could
  well turn out to be an issue with usb-modeswitch (usb-modeswitch
  1.2.3+repack0-1ubuntu2) or usb-modeswitch-data (usb-modeswitch-data
  20120120-0ubuntu1).

  Expected behaviour (and what happened in 10.04):
   * The presence of mobile broadband dongle K3520-Z should be detected.
   * The appropriate steps should be taken to switch it from usb-storage mode.
   * Mobile broadband should be enabled.

  What actually happens:
   * The dongle remains in usb-storage mode.
   * Mobile broadband does not appear as an option on the network drop-down 
menu.

  The following commands can be used to work around the problem:

  sudo modprobe --verbose option

  sudo echo 19d2 0055 /sys/bus/usb-serial/drivers/option1/new_id

  sudo usb_modeswitch --default-vendor 0x19d2 --default-product 0x2000
  --message-content
  5553424312345678061e00
  --message-
  content2=5553424312345679061b000200
  --message-
  content3=555342431234567020008c85010101180101010101
  --need-response --target-vendor 0x19d2 --target-product 0x0055 -s 20
  -D

  After these commands mobile broadband appears as a disabled option in
  the network drop-down menu.  Once mobile broadband is manually
  enabled, all is well.

  The remainder of this bug report might or might not contain useful
  information.

  When I tried researching this problem, I encountered threads in
  various forums that seemed to be reporting the same failure but for
  different dongles.  This bug might therefore not be limited to the
  K3520-Z, but I do know that it doesn't apply to a K3770 as I also have
  one of those (I suppose I could swap the SIM from the K3520-Z to the
  K3770 to work around the problem, but I'd rather not risk damaging the
  SIM in the process).

  When I first encountered this problem after upgrading from 10.04.01 to
  12.04.2, I was puzzled by the fact that mobile broadband had worked
  perfectly after the upgrade completed but then failed on a later
  startup.  I was further confused when from time to time it worked on
  subsequent startups.  I have, however, now realised what was going on
  and have tested my understanding appropriately.  Following a shutdown
  and startup mobile broadband fails because the dongle has been powered
  down and hence has reverted to usb-storage mode, but following a
  restart mobile broadband works (providing it 

[Desktop-packages] [Bug 1175093] Re: K3520-Z mode not switched automatically

2013-05-09 Thread Dane Maslen
The attached file is an extract from syslog that includes debug output
from udev when the K3770 is connected to the system.

Note that /lib/udev/rules.d/40-usb_modeswitch.rules line 397 is

ATTRS{idVendor}==12d1, ATTRS{idProduct}==14d1, RUN+=usb_modeswitch
'%b/%k'

This is the line that one would expect udev to match for this dongle,
but it never happens.  Instead the dongle switches mode for some other
reason (I don't know what other reason, but I might eventually get round
to investigating further) and then udev finds  matching entry in
/lib/udev/rules.d/40-usb_modeswitch.rules at lines 9 and 16 (cf my
previous comment) for the new device.  So the K3770 works correctly when
connected to the system even though usb_modeswitch hasn't at any stage
been invoked to switch its mode, as evidenced by the lack of a
usb_modeswitch entry in syslog (cf my previous comment).

As a sanity check to confirm that usb_modeswitch was not responsible for
the K3770 switching modes, I temporarily replaced
/lib/udev/usb_modeswitch by a dummy shell script that did nothing more
than 'exit 0' and then connected the K3770 to the system again.  Despite
the neutering of usb_modeswitch, the dongle still switched modes.

** Attachment added: syslog extract showing udev debug output when K3770 is 
connected to system
   
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1175093/+attachment/3671291/+files/k3770.log

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1175093

Title:
  K3520-Z mode not switched automatically

Status in “network-manager” package in Ubuntu:
  New

Bug description:
  Ubuntu 12.04.2 LTS

  Although I have logged this as a network-manager problem, it could
  well turn out to be an issue with usb-modeswitch (usb-modeswitch
  1.2.3+repack0-1ubuntu2) or usb-modeswitch-data (usb-modeswitch-data
  20120120-0ubuntu1).

  Expected behaviour (and what happened in 10.04):
   * The presence of mobile broadband dongle K3520-Z should be detected.
   * The appropriate steps should be taken to switch it from usb-storage mode.
   * Mobile broadband should be enabled.

  What actually happens:
   * The dongle remains in usb-storage mode.
   * Mobile broadband does not appear as an option on the network drop-down 
menu.

  The following commands can be used to work around the problem:

  sudo modprobe --verbose option

  sudo echo 19d2 0055 /sys/bus/usb-serial/drivers/option1/new_id

  sudo usb_modeswitch --default-vendor 0x19d2 --default-product 0x2000
  --message-content
  5553424312345678061e00
  --message-
  content2=5553424312345679061b000200
  --message-
  content3=555342431234567020008c85010101180101010101
  --need-response --target-vendor 0x19d2 --target-product 0x0055 -s 20
  -D

  After these commands mobile broadband appears as a disabled option in
  the network drop-down menu.  Once mobile broadband is manually
  enabled, all is well.

  The remainder of this bug report might or might not contain useful
  information.

  When I tried researching this problem, I encountered threads in
  various forums that seemed to be reporting the same failure but for
  different dongles.  This bug might therefore not be limited to the
  K3520-Z, but I do know that it doesn't apply to a K3770 as I also have
  one of those (I suppose I could swap the SIM from the K3520-Z to the
  K3770 to work around the problem, but I'd rather not risk damaging the
  SIM in the process).

  When I first encountered this problem after upgrading from 10.04.01 to
  12.04.2, I was puzzled by the fact that mobile broadband had worked
  perfectly after the upgrade completed but then failed on a later
  startup.  I was further confused when from time to time it worked on
  subsequent startups.  I have, however, now realised what was going on
  and have tested my understanding appropriately.  Following a shutdown
  and startup mobile broadband fails because the dongle has been powered
  down and hence has reverted to usb-storage mode, but following a
  restart mobile broadband works (providing it was working prior to the
  restart) because the dongle has remained powered throughout and hence
  has not reverted to usb-storage mode.

  This problem manifests itself in the same way on a netbook (I'll
  provide more details of the hardware if they are considered useful).
  This is what might well be expected, but I mention it because on
  10.04.1 I had an entirely different experience.  The K3520-Z used to
  switch mode automatically on both systems, but I had to switch the
  K3770 manually on the netbook (this is why I was able to come up with
  the above workaround after upgrading to 12.04.02 - I had done all the
  hard work discovering the workaround 18 months ago when I bought the
  K3770 while on holiday in Spain and now just needed 

[Desktop-packages] [Bug 1175093] Re: K3520-Z mode not switched automatically

2013-05-09 Thread Dane Maslen
Having established that usb_modeswitch wasn't switching the K3520-Z's
mode when invoked by udev to do so, and suspecting
usb_modeswitch_dispatcher was to blame, I decided to write my own udev
rules file (/etc/udev/rules.d/kludge_k3520z.rules) so as to bypass
usb_modeswitch_dispatcher.  It is attached.  It causes udev to invoke a
shell script (/lib/udev/kludge_k3520z) that runs usb_modeswitch with
precisely those options required to switch the K3520-Z's mode.

** Attachment added: udev rules file to provide a workaround
   
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1175093/+attachment/3671293/+files/kludge_k3520z.rules

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1175093

Title:
  K3520-Z mode not switched automatically

Status in “network-manager” package in Ubuntu:
  New

Bug description:
  Ubuntu 12.04.2 LTS

  Although I have logged this as a network-manager problem, it could
  well turn out to be an issue with usb-modeswitch (usb-modeswitch
  1.2.3+repack0-1ubuntu2) or usb-modeswitch-data (usb-modeswitch-data
  20120120-0ubuntu1).

  Expected behaviour (and what happened in 10.04):
   * The presence of mobile broadband dongle K3520-Z should be detected.
   * The appropriate steps should be taken to switch it from usb-storage mode.
   * Mobile broadband should be enabled.

  What actually happens:
   * The dongle remains in usb-storage mode.
   * Mobile broadband does not appear as an option on the network drop-down 
menu.

  The following commands can be used to work around the problem:

  sudo modprobe --verbose option

  sudo echo 19d2 0055 /sys/bus/usb-serial/drivers/option1/new_id

  sudo usb_modeswitch --default-vendor 0x19d2 --default-product 0x2000
  --message-content
  5553424312345678061e00
  --message-
  content2=5553424312345679061b000200
  --message-
  content3=555342431234567020008c85010101180101010101
  --need-response --target-vendor 0x19d2 --target-product 0x0055 -s 20
  -D

  After these commands mobile broadband appears as a disabled option in
  the network drop-down menu.  Once mobile broadband is manually
  enabled, all is well.

  The remainder of this bug report might or might not contain useful
  information.

  When I tried researching this problem, I encountered threads in
  various forums that seemed to be reporting the same failure but for
  different dongles.  This bug might therefore not be limited to the
  K3520-Z, but I do know that it doesn't apply to a K3770 as I also have
  one of those (I suppose I could swap the SIM from the K3520-Z to the
  K3770 to work around the problem, but I'd rather not risk damaging the
  SIM in the process).

  When I first encountered this problem after upgrading from 10.04.01 to
  12.04.2, I was puzzled by the fact that mobile broadband had worked
  perfectly after the upgrade completed but then failed on a later
  startup.  I was further confused when from time to time it worked on
  subsequent startups.  I have, however, now realised what was going on
  and have tested my understanding appropriately.  Following a shutdown
  and startup mobile broadband fails because the dongle has been powered
  down and hence has reverted to usb-storage mode, but following a
  restart mobile broadband works (providing it was working prior to the
  restart) because the dongle has remained powered throughout and hence
  has not reverted to usb-storage mode.

  This problem manifests itself in the same way on a netbook (I'll
  provide more details of the hardware if they are considered useful).
  This is what might well be expected, but I mention it because on
  10.04.1 I had an entirely different experience.  The K3520-Z used to
  switch mode automatically on both systems, but I had to switch the
  K3770 manually on the netbook (this is why I was able to come up with
  the above workaround after upgrading to 12.04.02 - I had done all the
  hard work discovering the workaround 18 months ago when I bought the
  K3770 while on holiday in Spain and now just needed to find the
  correct usb_modeswitch options for the K3520-Z).  No, you haven't
  misread that.  The dongle that switched mode automatically on both
  systems in 10.04.01 now fails to switch automatically on both in
  12.04.02, while the one that switched automatically on only one of the
  two systems  in 10.04.01 now switches automatically on both in
  12.04.02.

  If it's on any interest, the following is the output from the above
  commands:

  Looking for target devices ...
   No devices in target mode or class found
  Looking for default devices ...
 found matching product ID
 adding device
   Found device in default mode, class or configuration (1)
  Accessing device 002 on bus 007 ...
  Getting the current device configuration ...
   OK, got 

[Desktop-packages] [Bug 1175093] Re: K3520-Z mode not switched automatically

2013-05-09 Thread Dane Maslen
Attached is /lib/udev/kludge_k3520z.

** Attachment added: /lib/udev/kludge_k3520z to be invoked by udev after rule 
hit in kludge_k3520z.rules
   
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1175093/+attachment/3671294/+files/kludge_k3520z

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1175093

Title:
  K3520-Z mode not switched automatically

Status in “network-manager” package in Ubuntu:
  New

Bug description:
  Ubuntu 12.04.2 LTS

  Although I have logged this as a network-manager problem, it could
  well turn out to be an issue with usb-modeswitch (usb-modeswitch
  1.2.3+repack0-1ubuntu2) or usb-modeswitch-data (usb-modeswitch-data
  20120120-0ubuntu1).

  Expected behaviour (and what happened in 10.04):
   * The presence of mobile broadband dongle K3520-Z should be detected.
   * The appropriate steps should be taken to switch it from usb-storage mode.
   * Mobile broadband should be enabled.

  What actually happens:
   * The dongle remains in usb-storage mode.
   * Mobile broadband does not appear as an option on the network drop-down 
menu.

  The following commands can be used to work around the problem:

  sudo modprobe --verbose option

  sudo echo 19d2 0055 /sys/bus/usb-serial/drivers/option1/new_id

  sudo usb_modeswitch --default-vendor 0x19d2 --default-product 0x2000
  --message-content
  5553424312345678061e00
  --message-
  content2=5553424312345679061b000200
  --message-
  content3=555342431234567020008c85010101180101010101
  --need-response --target-vendor 0x19d2 --target-product 0x0055 -s 20
  -D

  After these commands mobile broadband appears as a disabled option in
  the network drop-down menu.  Once mobile broadband is manually
  enabled, all is well.

  The remainder of this bug report might or might not contain useful
  information.

  When I tried researching this problem, I encountered threads in
  various forums that seemed to be reporting the same failure but for
  different dongles.  This bug might therefore not be limited to the
  K3520-Z, but I do know that it doesn't apply to a K3770 as I also have
  one of those (I suppose I could swap the SIM from the K3520-Z to the
  K3770 to work around the problem, but I'd rather not risk damaging the
  SIM in the process).

  When I first encountered this problem after upgrading from 10.04.01 to
  12.04.2, I was puzzled by the fact that mobile broadband had worked
  perfectly after the upgrade completed but then failed on a later
  startup.  I was further confused when from time to time it worked on
  subsequent startups.  I have, however, now realised what was going on
  and have tested my understanding appropriately.  Following a shutdown
  and startup mobile broadband fails because the dongle has been powered
  down and hence has reverted to usb-storage mode, but following a
  restart mobile broadband works (providing it was working prior to the
  restart) because the dongle has remained powered throughout and hence
  has not reverted to usb-storage mode.

  This problem manifests itself in the same way on a netbook (I'll
  provide more details of the hardware if they are considered useful).
  This is what might well be expected, but I mention it because on
  10.04.1 I had an entirely different experience.  The K3520-Z used to
  switch mode automatically on both systems, but I had to switch the
  K3770 manually on the netbook (this is why I was able to come up with
  the above workaround after upgrading to 12.04.02 - I had done all the
  hard work discovering the workaround 18 months ago when I bought the
  K3770 while on holiday in Spain and now just needed to find the
  correct usb_modeswitch options for the K3520-Z).  No, you haven't
  misread that.  The dongle that switched mode automatically on both
  systems in 10.04.01 now fails to switch automatically on both in
  12.04.02, while the one that switched automatically on only one of the
  two systems  in 10.04.01 now switches automatically on both in
  12.04.02.

  If it's on any interest, the following is the output from the above
  commands:

  Looking for target devices ...
   No devices in target mode or class found
  Looking for default devices ...
 found matching product ID
 adding device
   Found device in default mode, class or configuration (1)
  Accessing device 002 on bus 007 ...
  Getting the current device configuration ...
   OK, got current device configuration (1)
  Using first interface: 0x00
  Using endpoints 0x09 (out) and 0x89 (in)
  Inquiring device details; driver will be detached ...
  Looking for active driver ...
   OK, driver found (usb-storage)
   OK, driver usb-storage detached

  SCSI inquiry data (for identification)
  -
Vendor String: ZTE Corp
 Model String: USB Storage   

[Desktop-packages] [Bug 1175093] Re: K3520-Z mode not switched automatically

2013-05-08 Thread Dane Maslen
Having done some further investigation, I believe this is a udev issue,
not a network manager issue.

Having issued the command
  udevadm control --log-priority=debug
I then inserted first the K3770 and then the K3520-Z.  I've subsequently been 
looking at the very copious debug output from udev in syslog.  For both dongles 
udev is successfully finding a rule and invoking usb_modeswitch but although 
the mode switch is successful for the K3770, it is unsuccessful for the 
K3520-Z.  The way in which isb_modeswitch is being invoked by udev differs 
substantially for the two dongles.  This surprises me given that the manual 
method for switching them is fairly similar.

I shall spend some more time trying to make greater sense of the udev
debug output to see if I can identify the cause of the difference in the
invocation of usb_modeswitch.  Meanwhile if anyone would like me to
upload the extracts from syslog for the K-3770 and the K3520-Z, let me
know.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1175093

Title:
  K3520-Z mode not switched automatically

Status in “network-manager” package in Ubuntu:
  New

Bug description:
  Ubuntu 12.04.2 LTS

  Although I have logged this as a network-manager problem, it could
  well turn out to be an issue with usb-modeswitch (usb-modeswitch
  1.2.3+repack0-1ubuntu2) or usb-modeswitch-data (usb-modeswitch-data
  20120120-0ubuntu1).

  Expected behaviour (and what happened in 10.04):
   * The presence of mobile broadband dongle K3520-Z should be detected.
   * The appropriate steps should be taken to switch it from usb-storage mode.
   * Mobile broadband should be enabled.

  What actually happens:
   * The dongle remains in usb-storage mode.
   * Mobile broadband does not appear as an option on the network drop-down 
menu.

  The following commands can be used to work around the problem:

  sudo modprobe --verbose option

  sudo echo 19d2 0055 /sys/bus/usb-serial/drivers/option1/new_id

  sudo usb_modeswitch --default-vendor 0x19d2 --default-product 0x2000
  --message-content
  5553424312345678061e00
  --message-
  content2=5553424312345679061b000200
  --message-
  content3=555342431234567020008c85010101180101010101
  --need-response --target-vendor 0x19d2 --target-product 0x0055 -s 20
  -D

  After these commands mobile broadband appears as a disabled option in
  the network drop-down menu.  Once mobile broadband is manually
  enabled, all is well.

  The remainder of this bug report might or might not contain useful
  information.

  When I tried researching this problem, I encountered threads in
  various forums that seemed to be reporting the same failure but for
  different dongles.  This bug might therefore not be limited to the
  K3520-Z, but I do know that it doesn't apply to a K3770 as I also have
  one of those (I suppose I could swap the SIM from the K3520-Z to the
  K3770 to work around the problem, but I'd rather not risk damaging the
  SIM in the process).

  When I first encountered this problem after upgrading from 10.04.01 to
  12.04.2, I was puzzled by the fact that mobile broadband had worked
  perfectly after the upgrade completed but then failed on a later
  startup.  I was further confused when from time to time it worked on
  subsequent startups.  I have, however, now realised what was going on
  and have tested my understanding appropriately.  Following a shutdown
  and startup mobile broadband fails because the dongle has been powered
  down and hence has reverted to usb-storage mode, but following a
  restart mobile broadband works (providing it was working prior to the
  restart) because the dongle has remained powered throughout and hence
  has not reverted to usb-storage mode.

  This problem manifests itself in the same way on a netbook (I'll
  provide more details of the hardware if they are considered useful).
  This is what might well be expected, but I mention it because on
  10.04.1 I had an entirely different experience.  The K3520-Z used to
  switch mode automatically on both systems, but I had to switch the
  K3770 manually on the netbook (this is why I was able to come up with
  the above workaround after upgrading to 12.04.02 - I had done all the
  hard work discovering the workaround 18 months ago when I bought the
  K3770 while on holiday in Spain and now just needed to find the
  correct usb_modeswitch options for the K3520-Z).  No, you haven't
  misread that.  The dongle that switched mode automatically on both
  systems in 10.04.01 now fails to switch automatically on both in
  12.04.02, while the one that switched automatically on only one of the
  two systems  in 10.04.01 now switches automatically on both in
  12.04.02.

  If it's on any interest, the following is the output from the above
  commands:

  

[Desktop-packages] [Bug 1175093] [NEW] K3520-Z mode not switched automatically

2013-05-01 Thread Dane Maslen
Public bug reported:

Ubuntu 12.04.2 LTS

Although I have logged this as a network-manager problem, it could well
turn out to be an issue with usb-modeswitch (usb-modeswitch
1.2.3+repack0-1ubuntu2) or usb-modeswitch-data (usb-modeswitch-data
20120120-0ubuntu1).

Expected behaviour (and what happened in 10.04):
 * The presence of mobile broadband dongle K3520-Z should be detected.
 * The appropriate steps should be taken to switch it from usb-storage mode.
 * Mobile broadband should be enabled.

What actually happens:
 * The dongle remains in usb-storage mode.
 * Mobile broadband does not appear as an option on the network drop-down menu.

The following commands can be used to work around the problem:

sudo modprobe --verbose option

sudo echo 19d2 0055 /sys/bus/usb-serial/drivers/option1/new_id

sudo usb_modeswitch --default-vendor 0x19d2 --default-product 0x2000
--message-content
5553424312345678061e00
--message-
content2=5553424312345679061b000200
--message-
content3=555342431234567020008c85010101180101010101
--need-response --target-vendor 0x19d2 --target-product 0x0055 -s 20 -D

After these commands mobile broadband appears as a disabled option in
the network drop-down menu.  Once mobile broadband is manually enabled,
all is well.

The remainder of this bug report might or might not contain useful
information.

When I tried researching this problem, I encountered threads in various
forums that seemed to be reporting the same failure but for different
dongles.  This bug might therefore not be limited to the K3520-Z, but I
do know that it doesn't apply to a K3770 as I also have one of those (I
suppose I could swap the SIM from the K3520-Z to the K3770 to work
around the problem, but I'd rather not risk damaging the SIM in the
process).

When I first encountered this problem after upgrading from 10.04.01 to
12.04.2, I was puzzled by the fact that mobile broadband had worked
perfectly after the upgrade completed but then failed on a later
startup.  I was further confused when from time to time it worked on
subsequent startups.  I have, however, now realised what was going on
and have tested my understanding appropriately.  Following a shutdown
and startup mobile broadband fails because the dongle has been powered
down and hence has reverted to usb-storage mode, but following a restart
mobile broadband works (providing it was working prior to the restart)
because the dongle has remained powered throughout and hence has not
reverted to usb-storage mode.

This problem manifests itself in the same way on a netbook (I'll provide
more details of the hardware if they are considered useful).  This is
what might well be expected, but I mention it because on 10.04.1 I had
an entirely different experience.  The K3520-Z used to switch mode
automatically on both systems, but I had to switch the K3770 manually on
the netbook (this is why I was able to come up with the above workaround
after upgrading to 12.04.02 - I had done all the hard work discovering
the workaround 18 months ago when I bought the K3770 while on holiday in
Spain and now just needed to find the correct usb_modeswitch options for
the K3520-Z).  No, you haven't misread that.  The dongle that switched
mode automatically on both systems in 10.04.01 now fails to switch
automatically on both in 12.04.02, while the one that switched
automatically on only one of the two systems  in 10.04.01 now switches
automatically on both in 12.04.02.

If it's on any interest, the following is the output from the above
commands:

Looking for target devices ...
 No devices in target mode or class found
Looking for default devices ...
   found matching product ID
   adding device
 Found device in default mode, class or configuration (1)
Accessing device 002 on bus 007 ...
Getting the current device configuration ...
 OK, got current device configuration (1)
Using first interface: 0x00
Using endpoints 0x09 (out) and 0x89 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
 OK, driver found (usb-storage)
 OK, driver usb-storage detached

SCSI inquiry data (for identification)
-
  Vendor String: ZTE Corp
   Model String: USB Storage 
Revision String: 2.31
-

USB description data (for identification)
-
Manufacturer: Qualcomm, Incorporated
 Product: USB ZTE Storage
  Serial No.: P671M8VDF_MS
-
Setting up communication with interface 0
Using endpoint 0x09 for message sending ...
Trying to send message 1 to endpoint 0x09 ...
 OK, message successfully sent
Reading the response to message 1 (CSW) ...
 OK, response successfully read (13 bytes).
Trying to send message 2 to endpoint 0x09 ...
 OK, message successfully sent
Reading the response to message 2 (CSW) ...
 OK, response successfully read (0 bytes).
Trying to send message 3 to endpoint 0x09 ...