All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Regarding generic_buffer.c Application for Android
       [not found] <CALwa49vRGN_VaJ147PVF8Cf+8vnBotWVh7hmxLj=jaAba5QTTw@mail.gmail.com>
@ 2015-04-09 17:56 ` Jonathan Cameron
  2015-04-10  4:18   ` s.rawat
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Cameron @ 2015-04-09 17:56 UTC (permalink / raw)
  To: s.rawat, Jonathan Cameron, linux-iio

On 31/03/15 17:36, s.rawat wrote:
> Hi Jonathan,
> 
> I have tested and used the generic_buffer.c application and found it
> to be good for testing the IIO drivers.I tried it on one of the
> android system and found it to be failing.(Android System has CPU ABI
> armv7-eabi )
> 
> Here is a short summary to investigate why it didnt work on
> Andorid.Can you plz provide your comments:
> 
> I have two system having different kernel version and drivers(IIO) on
> which I can run the
> generic_buffer.c(http://lxr.free-electrons.com/source/drivers/staging/iio/Documentation/generic_buffer.c)
> application .On one system it works(kernel 3.18.15) fine but on the
> other(3.10.20) it does not give the input reports data.I have already
> applied the attached patch to it.
> 
> I have checked that the system on which it is working has the
> following sysfs under /sys/bus/iio/devices/iio:deviceX (where X is
> 1,2,3...)
> 
> buffer
> 
> dev
> 
> in_accel_hysteresis
> 
> in_accel_offset
> 
> in_accel_sampling_frequency
> 
> in_accel_scale
> 
> in_accel_x_raw
> 
> in_accel_y_raw
> 
> in_accel_z_raw
> 
> name
> 
> power
> 
> scan_elements
> 
> subsystem
> 
> trigger
> 
> uevent
> 
>  
> 
> This is for accelerometer, similarly for magnetometer (in_magn_x_raw,_y_raw,z_raw etc) and for Gyrometer ( in_anglvel_x_raw,in_anglvel_y_raw,in_anglvel_z_raw )
> 
>  and the one on which it is not working has the below sysfs under /sys/bus/iio/devices/iio:deviceX (where X is 1,2,3...) :
> 
>  buffer
> 
> dev
> 
> in_accel_hysteresis
> 
> in_accel_offset
> 
> in_accel_sampling_frequency
> 
> in_accel_scale
> 
> name
> 
> power
> 
> scan_elements
> 
> subsystem
> 
> trigger
> 
> uevent
> 
>  
> 
> Is the missing *_x_raw,_y_raw and _z_raw* component main reason for not working of the app?If yes how can I enable it? –
Not as such. However it is certainly curious that you have them missing. 
These provide direct sysfs access to the accelerations. 

We did at one point make it a requirement for the iio_chan_spec to explicitly include the IIO_CHAN_INFO_RAW bit
rather than using the prior separate callbacks for that.  Perhaps it is missing in your driver?

What is the actual driver in question?

> 
> Additionally, the system on which it doesn’t works  is the Android System for which I have cross compiled the generic_buffer.c
> 
>  
> 
> *[1] + stopped (signal) ./generic buffer –c 10 –n accel_3d (*basically waits at some point in the application and then  some illegal termination may be)**
> 
>  
> 
> Plz let me know your  comments on this.I need to run the same app for the Android system.
> 
> 
> Many Thanks in advance !
> 
> Best Rgds,
> 
> Saurabh
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regarding generic_buffer.c Application for Android
  2015-04-09 17:56 ` Regarding generic_buffer.c Application for Android Jonathan Cameron
@ 2015-04-10  4:18   ` s.rawat
  2015-04-10  6:19     ` Jonathan Cameron
  0 siblings, 1 reply; 10+ messages in thread
From: s.rawat @ 2015-04-10  4:18 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio

On Thu, Apr 9, 2015 at 11:26 PM, Jonathan Cameron <jic23@kernel.org> wrote:
> Not as such. However it is certainly curious that you have them missing.
> These provide direct sysfs access to the accelerations.
>
> We did at one point make it a requirement for the iio_chan_spec to explicitly include the IIO_CHAN_INFO_RAW bit
> rather than using the prior separate callbacks for that.  Perhaps it is missing in your driver?
>
> What is the actual driver in question?
The acutal driver is accel,gyro and magn.OK,i agree this is not a
mandatory requirement for the generic_buffer app to work.
The illegal termination of the application is due to the changes I
have done in the build_channel_array for function  seekdir(dp, 0).I
found that I can compile/test the app safely using arm tool chain or
gcc but when I am trying to compile the application using ndk(native
android tool chain ) I get errors for undefined references for these
functions below :
seekdir()
be16toh()
le16toh()
Are these functions portable?
and on cross-compiling with x86 tool chain for x86 32 bit platform I
get errors for missing headers unistd.h ,dirent.h,etc. I guess
unistd.h are the part of libc which may not be present in the tool
chain I am using.Is that the reason?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regarding generic_buffer.c Application for Android
  2015-04-10  4:18   ` s.rawat
@ 2015-04-10  6:19     ` Jonathan Cameron
  2015-04-13  3:40       ` s.rawat
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Cameron @ 2015-04-10  6:19 UTC (permalink / raw)
  To: s.rawat, linux-iio



On 10 April 2015 05:18:56 BST, "s.rawat" <imsaurabhrawat@gmail.com> wrote:
>On Thu, Apr 9, 2015 at 11:26 PM, Jonathan Cameron <jic23@kernel.org>
>wrote:
>> Not as such. However it is certainly curious that you have them
>missing.
>> These provide direct sysfs access to the accelerations.
>>
>> We did at one point make it a requirement for the iio_chan_spec to
>explicitly include the IIO_CHAN_INFO_RAW bit
>> rather than using the prior separate callbacks for that.  Perhaps it
>is missing in your driver?
>>
>> What is the actual driver in question?
>The acutal driver is accel,gyro and magn.OK,i agree this is not a
>mandatory requirement for the generic_buffer app to work.
>The illegal termination of the application is due to the changes I
>have done in the build_channel_array for function  seekdir(dp, 0).I
>found that I can compile/test the app safely using arm tool chain or
>gcc but when I am trying to compile the application using ndk(native
>android tool chain ) I get errors for undefined references for these
>functions below :
>seekdir()
Hit google
http://pubs.opengroup.org/onlinepubs/009695399/functions/seekdir.html
So for POSIX compliance they are optional.
>be16toh()
https://code.google.com/p/android/issues/detail?id=41769 suggest at least older android uses betoh16.

>le16toh()
>Are these functions portable?
>and on cross-compiling with x86 tool chain for x86 32 bit platform I
>get errors for missing headers unistd.h ,dirent.h,etc. I guess
>unistd.h are the part of libc which may not be present in the tool
>chain I am using.Is that the reason?
Possibly...

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regarding generic_buffer.c Application for Android
  2015-04-10  6:19     ` Jonathan Cameron
@ 2015-04-13  3:40       ` s.rawat
  2015-04-13  6:26         ` Jonathan Cameron
  0 siblings, 1 reply; 10+ messages in thread
From: s.rawat @ 2015-04-13  3:40 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio

On Fri, Apr 10, 2015 at 11:49 AM, Jonathan Cameron <jic23@kernel.org> wrote:
> Hit google
> http://pubs.opengroup.org/onlinepubs/009695399/functions/seekdir.html
> So for POSIX compliance they are optional.

You mean seekdir(dp, 0); in function inline int
build_channel_array(...) is optional?If I comment it, will it have no
effect? This function is called inside main() of generic_buffer.c and
I cant get it compiled with the tool chain I have.Is there any
alternate code I can replace it with if it is Not Optional?

I can take care of le16toh/be16toh.

Thanks and Rgds,
S

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regarding generic_buffer.c Application for Android
  2015-04-13  3:40       ` s.rawat
@ 2015-04-13  6:26         ` Jonathan Cameron
  2015-04-13  9:49           ` s.rawat
                             ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Jonathan Cameron @ 2015-04-13  6:26 UTC (permalink / raw)
  To: s.rawat, Jonathan Cameron; +Cc: linux-iio



On 13 April 2015 04:40:17 BST, "s.rawat" <imsaurabhrawat@gmail.com> wrote:
>On Fri, Apr 10, 2015 at 11:49 AM, Jonathan Cameron <jic23@kernel.org>
>wrote:
>> Hit google
>> http://pubs.opengroup.org/onlinepubs/009695399/functions/seekdir.html
>> So for POSIX compliance they are optional.
>
>You mean seekdir(dp, 0); in function inline int
>build_channel_array(...) is optional?If I comment it, will it have no
>effect? This function is called inside main() of generic_buffer.c and
>I cant get it compiled with the tool chain I have.Is there any
>alternate code I can replace it with if it is Not Optional?
The functionality is not optional. There is no obligation for the operating system to implement seekdir.

Here equivalent is probably to close and reopen the directory.
>
>I can take care of le16toh/be16toh.
>
>Thanks and Rgds,
>S

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regarding generic_buffer.c Application for Android
  2015-04-13  6:26         ` Jonathan Cameron
@ 2015-04-13  9:49           ` s.rawat
  2015-04-13  9:51           ` s.rawat
  2015-04-13 10:05           ` s.rawat
  2 siblings, 0 replies; 10+ messages in thread
From: s.rawat @ 2015-04-13  9:49 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Jonathan Cameron, linux-iio

[-- Attachment #1: Type: text/plain, Size: 301 bytes --]

On Mon, Apr 13, 2015 at 11:56 AM, Jonathan Cameron <
jic23@jic23.retrosnub.co.uk> wrote:

> Here equivalent is probably to close and reopen the directory.
>
+closedir(dp)
+dp = opendir(scan_el_dir);

This seems to work fine.But sometimes polling accel throws error : failed
to open /dev/iio:device0 .

[-- Attachment #2: Type: text/html, Size: 912 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regarding generic_buffer.c Application for Android
  2015-04-13  6:26         ` Jonathan Cameron
  2015-04-13  9:49           ` s.rawat
@ 2015-04-13  9:51           ` s.rawat
  2015-04-13 10:05           ` s.rawat
  2 siblings, 0 replies; 10+ messages in thread
From: s.rawat @ 2015-04-13  9:51 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio

[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]

+closedir(dp)
+dp = opendir(scan_el_dir);

This seems to work fine.But sometimes polling accel throws error : failed
to open /dev/iio:device0

On Mon, Apr 13, 2015 at 11:56 AM, Jonathan Cameron <
jic23@jic23.retrosnub.co.uk> wrote:

>
>
> On 13 April 2015 04:40:17 BST, "s.rawat" <imsaurabhrawat@gmail.com> wrote:
> >On Fri, Apr 10, 2015 at 11:49 AM, Jonathan Cameron <jic23@kernel.org>
> >wrote:
> >> Hit google
> >> http://pubs.opengroup.org/onlinepubs/009695399/functions/seekdir.html
> >> So for POSIX compliance they are optional.
> >
> >You mean seekdir(dp, 0); in function inline int
> >build_channel_array(...) is optional?If I comment it, will it have no
> >effect? This function is called inside main() of generic_buffer.c and
> >I cant get it compiled with the tool chain I have.Is there any
> >alternate code I can replace it with if it is Not Optional?
> The functionality is not optional. There is no obligation for the
> operating system to implement seekdir.
>
> Here equivalent is probably to close and reopen the directory.
> >
> >I can take care of le16toh/be16toh.
> >
> >Thanks and Rgds,
> >S
>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>

[-- Attachment #2: Type: text/html, Size: 2142 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regarding generic_buffer.c Application for Android
  2015-04-13  6:26         ` Jonathan Cameron
  2015-04-13  9:49           ` s.rawat
  2015-04-13  9:51           ` s.rawat
@ 2015-04-13 10:05           ` s.rawat
  2015-04-20 10:34             ` s.rawat
  2 siblings, 1 reply; 10+ messages in thread
From: s.rawat @ 2015-04-13 10:05 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Jonathan Cameron, linux-iio

+closedir(dp)
+dp = opendir(scan_el_dir);

This seems to work fine.But sometimes polling accel throws error :
failed to open /dev/iio:device0 .

sorry for reposts : Changed the browser.Was not able to send in "Plain
text mode"

On Mon, Apr 13, 2015 at 11:56 AM, Jonathan Cameron
<jic23@jic23.retrosnub.co.uk> wrote:
>
>
> On 13 April 2015 04:40:17 BST, "s.rawat" <imsaurabhrawat@gmail.com> wrote:
>>On Fri, Apr 10, 2015 at 11:49 AM, Jonathan Cameron <jic23@kernel.org>
>>wrote:
>>> Hit google
>>> http://pubs.opengroup.org/onlinepubs/009695399/functions/seekdir.html
>>> So for POSIX compliance they are optional.
>>
>>You mean seekdir(dp, 0); in function inline int
>>build_channel_array(...) is optional?If I comment it, will it have no
>>effect? This function is called inside main() of generic_buffer.c and
>>I cant get it compiled with the tool chain I have.Is there any
>>alternate code I can replace it with if it is Not Optional?
> The functionality is not optional. There is no obligation for the operating system to implement seekdir.
>
> Here equivalent is probably to close and reopen the directory.
>>
>>I can take care of le16toh/be16toh.
>>
>>Thanks and Rgds,
>>S
>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regarding generic_buffer.c Application for Android
  2015-04-13 10:05           ` s.rawat
@ 2015-04-20 10:34             ` s.rawat
  2015-06-09  4:09               ` s.rawat
  0 siblings, 1 reply; 10+ messages in thread
From: s.rawat @ 2015-04-20 10:34 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Jonathan Cameron, linux-iio

After I allow  the device to go into sleep(pressing power button once)
and then run  the generic_buffer app and then make the device wake-up
the app works fine.I don't know if going into the sleep and waking it
up does some sort of reset to the application variables or file
descriptor.

On Mon, Apr 13, 2015 at 3:35 PM, s.rawat <imsaurabhrawat@gmail.com> wrote:
> +closedir(dp)
> +dp = opendir(scan_el_dir);
>
> This seems to work fine.But sometimes polling accel throws error :
> failed to open /dev/iio:device0 .
>
> sorry for reposts : Changed the browser.Was not able to send in "Plain
> text mode"
>
> On Mon, Apr 13, 2015 at 11:56 AM, Jonathan Cameron
> <jic23@jic23.retrosnub.co.uk> wrote:
>>
>>
>> On 13 April 2015 04:40:17 BST, "s.rawat" <imsaurabhrawat@gmail.com> wrote:
>>>On Fri, Apr 10, 2015 at 11:49 AM, Jonathan Cameron <jic23@kernel.org>
>>>wrote:
>>>> Hit google
>>>> http://pubs.opengroup.org/onlinepubs/009695399/functions/seekdir.html
>>>> So for POSIX compliance they are optional.
>>>
>>>You mean seekdir(dp, 0); in function inline int
>>>build_channel_array(...) is optional?If I comment it, will it have no
>>>effect? This function is called inside main() of generic_buffer.c and
>>>I cant get it compiled with the tool chain I have.Is there any
>>>alternate code I can replace it with if it is Not Optional?
>> The functionality is not optional. There is no obligation for the operating system to implement seekdir.
>>
>> Here equivalent is probably to close and reopen the directory.
>>>
>>>I can take care of le16toh/be16toh.
>>>
>>>Thanks and Rgds,
>>>S
>>
>> --
>> Sent from my Android device with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Regarding generic_buffer.c Application for Android
  2015-04-20 10:34             ` s.rawat
@ 2015-06-09  4:09               ` s.rawat
  0 siblings, 0 replies; 10+ messages in thread
From: s.rawat @ 2015-06-09  4:09 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio

Why this is happening with generic_buffer application that it
sometimes fails to open the device handles of Accelerometer and after
I follow the STEP -> sleep -> run  the application -> wakeup using the
power button of the device, the application gets the device handles
and polls the Accelerometer correctly .
The frequency of this behavior is random.
Why is it so?

Thanks and Rgds,
-S
PS: Please ignore if you get this mail twice, Some problem in sending the mail.

On Mon, Apr 20, 2015 at 4:04 PM, s.rawat <imsaurabhrawat@gmail.com> wrote:
> After I allow  the device to go into sleep(pressing power button once)
> and then run  the generic_buffer app and then make the device wake-up
> the app works fine.I don't know if going into the sleep and waking it
> up does some sort of reset to the application variables or file
> descriptor.
>
> On Mon, Apr 13, 2015 at 3:35 PM, s.rawat <imsaurabhrawat@gmail.com> wrote:
>> +closedir(dp)
>> +dp = opendir(scan_el_dir);
>>
>> This seems to work fine.But sometimes polling accel throws error :
>> failed to open /dev/iio:device0 .
>>
>> sorry for reposts : Changed the browser.Was not able to send in "Plain
>> text mode"
>>
>> On Mon, Apr 13, 2015 at 11:56 AM, Jonathan Cameron
>> <jic23@jic23.retrosnub.co.uk> wrote:
>>>
>>>
>>> On 13 April 2015 04:40:17 BST, "s.rawat" <imsaurabhrawat@gmail.com> wrote:
>>>>On Fri, Apr 10, 2015 at 11:49 AM, Jonathan Cameron <jic23@kernel.org>
>>>>wrote:
>>>>> Hit google
>>>>> http://pubs.opengroup.org/onlinepubs/009695399/functions/seekdir.html
>>>>> So for POSIX compliance they are optional.
>>>>
>>>>You mean seekdir(dp, 0); in function inline int
>>>>build_channel_array(...) is optional?If I comment it, will it have no
>>>>effect? This function is called inside main() of generic_buffer.c and
>>>>I cant get it compiled with the tool chain I have.Is there any
>>>>alternate code I can replace it with if it is Not Optional?
>>> The functionality is not optional. There is no obligation for the operating system to implement seekdir.
>>>
>>> Here equivalent is probably to close and reopen the directory.
>>>>
>>>>I can take care of le16toh/be16toh.
>>>>
>>>>Thanks and Rgds,
>>>>S
>>>
>>> --
>>> Sent from my Android device with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-06-09  4:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CALwa49vRGN_VaJ147PVF8Cf+8vnBotWVh7hmxLj=jaAba5QTTw@mail.gmail.com>
2015-04-09 17:56 ` Regarding generic_buffer.c Application for Android Jonathan Cameron
2015-04-10  4:18   ` s.rawat
2015-04-10  6:19     ` Jonathan Cameron
2015-04-13  3:40       ` s.rawat
2015-04-13  6:26         ` Jonathan Cameron
2015-04-13  9:49           ` s.rawat
2015-04-13  9:51           ` s.rawat
2015-04-13 10:05           ` s.rawat
2015-04-20 10:34             ` s.rawat
2015-06-09  4:09               ` s.rawat

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.