Re: [Libusbx-devel] Android build files and improved logging patches, (was "Improved log in non-console applications and Android")

2013-08-12 Thread Toby Gray

On 12/08/13 03:41, Xiaofan Chen wrote:

On Fri, Aug 9, 2013 at 6:51 PM, Toby Gray  wrote:

If you are planning on testing on a device then you'll need to have root
access to it or fiddle around with building custom ROMs to setup
permissions on /dev/bus/usb/*/*.

Also be aware that the Android dynamic loader is more basic than the
normal Linux one so it's best to place libusb-1.0.so in /system/lib.


Could you give more details how you test libusbx under Android? What
is the device you are using and what kind of custom ROM you are using?


I've tried a few devices, both custom ROMs and rooted.

The custom ROM approach uses modifying ueventd.rc to change the 
permissions on /dev/bus/usb/*/*.



I myself have an Android tablet (have USB host support and real USB
host port along with the micro-USB port, tested the host support with
Microchip's app and seems to work fine) and an Android phone (not so
sure if it has USB host support and not plan to do anything USB with it).


Assuming that you have rooted the device then the easiest thing to do is 
something along the lines of the following:


  # Make the system partition writeable
  adb shell su -c "mount -o remount,rw /system"

  # Install libusb
  adb push obj/local/armeabi/libusb1.0.so /sdcard/
  adb shell su -c "cat > /system/lib/libusb1.0.so < /sdcard/libusb1.0.so"
  adb shell rm /system/lib/libusb1.0.so
  # Install the samples and tests
  for B in listdevs fxload xusb sam3u_benchmark hotplugtest stress
  do
adb push "obj/local/armeabi/$B" /sdcard/
adb shell su -c "cat > /system/bin/$B < /sdcard/$B"
adb shell su -c "chmod 0755 /system/bin/$B"
adb shell rm "/sdcard/$B"
  done

  # Make the system partition read only again
  adb shell su -c "mount -o remount,ro /system"

  # Run listdevs
  adb shell su -c "listdevs"

If your device only has a single USB port (so can't be a USB host and 
have a USB ADB connection) then you can use the following commands to 
use ADB over wifi:


  adb shell netcfg
  # Note the wifi IP address of the phone
  adb tcpip 
  # Use the IP address from netcfg
  adb connect 192.168.1.123:

Or you could use one of the many local terminal applications available 
for Android devices.


If you are making an Android application and want to use libusb then 
including the libusbx/android/jni/libusb.mk makefile in your NDK 
makefile will allow you to use libusb APIs from other native code.


I assume it'd be helpful for others to have this information recorded 
somewhere. Would a wiki page or an update to the README be more appropriate?


Regards,

Toby
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] Android build files and improved logging patches, (was "Improved log in non-console applications and Android")

2013-08-12 Thread Xiaofan Chen
On Mon, Aug 12, 2013 at 8:08 PM, Toby Gray  wrote:
> I assume it'd be helpful for others to have this information recorded
> somewhere. Would a wiki page or an update to the README be
> more appropriate?

I think Android has become so popular that a README.Android
is good to have.

-- 
Xiaofan

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Windows: libusb_dll_2010.vcxproj link errors (#129)

2013-08-12 Thread mcuee
Yes you are right. This is still in libusbx.git. The project file needs to be 
updated.

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/issues/129#issuecomment-22489846
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Windows: libusb_dll_2010.vcxproj link errors (#129)

2013-08-12 Thread mcuee
BTW, the VS2012 files are good in this aspect.

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/issues/129#issuecomment-22491895
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


[Libusbx-devel] libusbx Windows warnings

2013-08-12 Thread Xiaofan Chen
Just tried VS2012 under Windows 8 and there is a warning
for latest git tree. It is probably better to fix this as well for
1.0.17 release.

..\libusb\os\windows_usb.c(1768): warning C4267: 'return' : conversion
from 'size_t' to 'int', possible loss of data



-- 
Xiaofan

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Make libusbx accept an optional policy structure that specifies how logging and/or memory allocation work. (#128)

2013-08-12 Thread Pete Batard
This is a bit too much to digest, as far as I'm concerned. Unless you can 
submit your changes as patches that apply cleanly on top of the latest libusbx, 
it's unlikely that we are going to spend a lot of time looking at them. There's 
just too much work involved in doing that and our resources are limited.

Can you please try to break down what you need in a series of isolated patches 
that could be applied on top of the current master?

You also may get more feedback on these patches if you subscribe to the 
[mailing list](https://lists.sourceforge.net/lists/listinfo/libusbx-devel) and 
submit them there.

/Pete

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/pull/128#issuecomment-22523613
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] libusbx Windows warnings

2013-08-12 Thread Pete Batard
On 2013.08.12 14:15, Xiaofan Chen wrote:
> Just tried VS2012 under Windows 8 and there is a warning
> for latest git tree. It is probably better to fix this as well for
> 1.0.17 release.
>
> ..\libusb\os\windows_usb.c(1768): warning C4267: 'return' : conversion
> from 'size_t' to 'int', possible loss of data

I can fix that, but I don't get it in Windows 7, and I don't really 
understand how the compiler would be influenced purely by the version of 
Windows it is running on.

Do you get the same warning on Windows 7?
Or is there anything you set in your VS2012 installation on Windows 8, 
such as enabling extra warnings.

I'd rather figure out why your Windows 8 installation produces more 
warnings than my Windows 7 one, than have to fix a warning I never get 
every other week...

Regards,

/Pete

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Windows: libusb_dll_2010.vcxproj link errors (#129)

2013-08-12 Thread Pete Batard
I'll just point out that I don't believe anybody is testing the project with 
VS2010 any longer. As far as I'm concerned, I'm using VS2012 exclusively for 
Visual Studio, and I have no plans to test earlier versions of Visual Studio, 
so most of these projects update come from copy/paste and manual editing of the 
files.

I will continue to rely on people using these versions to send patches in case 
anything gets broken.

/Pete

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/issues/129#issuecomment-22525207
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Windows: libusb_dll_2010.vcxproj link errors (#129)

2013-08-12 Thread Pete Batard
Closed #129 via d28ab4bf13eb101f35d3543a3b2c2ca51a98e19d.

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/issues/129
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Make libusbx accept an optional policy structure that specifies how logging and/or memory allocation work. (#128)

2013-08-12 Thread swestrup
On Mon, Aug 12, 2013 at 4:40 PM, Pete Batard wrote:

> This is a bit too much to digest, as far as I'm concerned. Unless you can
> submit your changes as patches that apply cleanly on top of the latest
> libusbx, it's unlikely that we are going to spend a lot of time looking at
> them. There's just too much work involved in doing that and our resources
> are limited.
>
Can you please try to break down what you need in a series of isolated
> patches that could be applied on top of the current master?
>

Thanks for the feedback. For what its worth, this should merge cleanly with
the latest version, as of the time I submitted the branch.

I am willing to break this into smaller patches (although that could be a
considerable amount of work),  but I'm unsure how I could best break this
down into smaller patches for easy digestion. Suggestions are welcome.

There are essentially three pieces to this:

1) An abstract policy framework that does nothing by itself.
2) Make all logging (including debug calls) go through a logger indirection
provided by the policy
3) Make all memory allocation go through an allocation indirection provided
by the policy.

While its possible to do some of the above piecemeal there are a few
changes that essentially have to be monolithic (ie, make every usbi_dbg
call take a context parameter), or the results don't run.


You also may get more feedback on these patches if you subscribe to the mailing
> list  and
> submit them there.
>

I am subscribed to the mailing list and when I asked for advice there, I
was told that this was a good way to submit my changes.


-- 
Stirling Westrup
Programmer, Entrepreneur.
https://www.linkedin.com/e/fpf/77228
http://www.linkedin.com/in/swestrup
http://technaut.livejournal.com
http://sourceforge.net/users/stirlingwestrup

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/pull/128#issuecomment-22528930
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Make libusbx accept an optional policy structure that specifies how logging and/or memory allocation work. (#128)

2013-08-12 Thread Ludovic Rousseau
The first thing you should do is ``git rebase upstream/master``, fix any 
conflict and then push your policy branch (maybe using --force).

This should remove a lot of the patches already upstreamed and will simplify a 
lot the review.

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/pull/128#issuecomment-22530905
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] libusbx Windows warnings

2013-08-12 Thread Xiaofan Chen
On Tue, Aug 13, 2013 at 4:45 AM, Pete Batard  wrote:
> On 2013.08.12 14:15, Xiaofan Chen wrote:
>> Just tried VS2012 under Windows 8 and there is a warning
>> for latest git tree. It is probably better to fix this as well for
>> 1.0.17 release.
>>
>> ..\libusb\os\windows_usb.c(1768): warning C4267: 'return' : conversion
>> from 'size_t' to 'int', possible loss of data
>
> I can fix that, but I don't get it in Windows 7, and I don't really
> understand how the compiler would be influenced purely by the version of
> Windows it is running on.
>
> Do you get the same warning on Windows 7?
> Or is there anything you set in your VS2012 installation on Windows 8,
> such as enabling extra warnings.
>
> I'd rather figure out why your Windows 8 installation produces more
> warnings than my Windows 7 one, than have to fix a warning I never get
> every other week...
>

I think it has nothing to do with the Windows version. The x86 build
will not have the warning, the x64 version will have the warning.



-- 
Xiaofan

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Windows: libusb_dll_2010.vcxproj link errors (#129)

2013-08-12 Thread mcuee
I think you forget to update libusb_dll_2010.vcxproj.filters as well. 

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/issues/129#issuecomment-22533621
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Windows: libusb_dll_2010.vcxproj link errors (#129)

2013-08-12 Thread mcuee
Reopened #129.

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/issues/129
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Windows: libusb_dll_2010.vcxproj link errors (#129)

2013-08-12 Thread mcuee
BTW, I think it is perfectly okay for you to mention that you only test VS2012. 
I do not use VS much myself. And I think we may want to drop MSVC 6.0 support 
since I think it is too old to support. And even VS2005 is quite old but 
probably it is also for VS2008 users.

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/issues/129#issuecomment-22533809
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel