Hey Nick,

Since you've brought it up.
I am working on OMAP which doesn't have the /dev/H* uart device node, so
does that mean the bluedroid will try and call hciattach_legacy ?
Aren't things in bluedroid becoming too specific to msm ?

regards,
Pavan

On Tue, Feb 3, 2009 at 9:39 PM, Nick Pelly <[email protected]> wrote:

>
>
> On Tue, Feb 3, 2009 at 12:18 AM, Sidharth Malhotra <[email protected]>wrote:
>
>>
>> Hi Nick,
>>
>> Thanks for the detailed reply.
>>
>> Yes, I am running hcid and hciattach manually. The problem is that all
>> the bluetooth modules (bluetooth.ko, l2cap.ko, etc.) are not present
>> as built-in modules.
>>
>
> These should be compiled into the kernel, and are in the git
> android-msm-2.6.27 that we use both internally and publicly.
>
>
>> So, I need to do an insmod after the Android
>> image boots up on my device. Should I try using the built-in method
>> instead while I compile the kernel?
>>
>> By the way, I had put my own log messages in hcid, and it seems that
>> token parsing was not happening fine. Now, I have solved that and hcid
>> is running as "bluetooth" user. I can also initiate pairing from
>> remote device now.
>
>
> Glad it works :)
>
> Nick
>
>
>>
>>
>> Thanks,
>> Sidharth
>>
>> On Feb 3, 11:18 am, Nick Pelly <[email protected]> wrote:
>> > Hi Sidharth,
>> >
>> > I don't know exactly what is going wrong for you, but here are some
>> ideas.
>> >
>> > - The control sockets should be created by init for the hcid daemon in
>> > /dev/socket/bluetooth and /dev/socket/dbus_bluetooth. If they are not
>> there
>> > then you have a problem.
>> > - Your init.rc file looks ok.
>> > - If you have the high speed uart drive in your kernel (/dev/ttyHS0
>> exists)
>> > then you don't need the hciattach_legacy entry in your board init.rc
>> file.
>> > That entry was just there during the transition from low speed to high
>> speed
>> > driver.
>> >
>> > This one is important...
>> > running hcid manually is _not_ the same as running it through the
>> init.rc
>> > file. Those entries in the init.rc file like 'socket ....' tell init to
>> > create the /dev/socket entry AND to set some environment variables so
>> that
>> > hcid can pick up a file descriptor to /dev/socket when it is run from
>> init.
>> > You wont have a file descriptor to those control sockets if you try and
>> run
>> > hcid manually.
>> >
>> > That probably explains your error message, which is a red herring for
>> the
>> > real problem.
>> >
>> > To find the real issue you will want to run hcid via logwrapper in the
>> > init.rc file. logwrapper --help will explain. I think you may find the
>> > control socket is actually ok.
>> >
>> > And are you running hciattach?
>> >
>> > Nick
>> >
>> > On Mon, Feb 2, 2009 at 8:25 PM, Sidharth Malhotra <[email protected]>
>> wrote:
>> >
>> > > Hi Pavan
>> >
>> > > Thanks for the quick reply. I am essentially using this init.rc file
>> > > only, as fasr as hcid and hciattach go. That should help me for the
>> > > moment, right?
>> > > I did not understand how does adding another service hciattacth_legacy
>> > > help in running hcid? I'm sorry if I missed something.
>> >
>> > > I checked the /data/misc/hcid, and only the BD_ADDR of my device is
>> > > showing there. Any guess on how I can add the socket there? I just
>> > > need a way to get past that message:
>> > > hcid[681]: Unable to get the control socket for 'bluetooth'
>> >
>> > > The one that you also faced sometime back. :)
>> >
>> > > Thanks,
>> > > Sidharth
>> >
>> > > On Feb 3, 9:08 am, pavan savoy <[email protected]> wrote:
>> > > > Hi,
>> >
>> > > > Find the init.rc from the zoom2 product directory below.
>> >
>> > > >
>> http://git.omapzoom.org/?p=repo/android/vendor/ti/zoom2.git;a=blob;f=...
>> >
>> > > > Recently I've added a new service by name hciattach_legacy which has
>> the
>> > > > same definition as hciattach in init.rc, that's all.
>> > > > And 1 more thing, hcid.conf path might have changed, and I've
>> changed
>> > > that
>> > > > in my local init.rc file.
>> >
>> > > > Sockets as far as I know should be created in /data/misc/hcid/, I
>> suppose
>> > > > [or somewhere there..]
>> >
>> > > > On Tue, Feb 3, 2009 at 9:33 AM, Sidharth Malhotra <[email protected]
>> >
>> > > wrote:
>> >
>> > > > > Hi Pavan,
>> >
>> > > > > I am aware of this flag and have unset this to ensure that sockets
>> can
>> > > > > be opened by hcid. But, I am still struggling with how to bring up
>> > > > > hcid.
>> > > > > By the way, can you share the init.rc file and the hcid source you
>> are
>> > > > > running. It seems you also had certain problems earlier.
>> >
>> > > > > Since yesterday, I have been able to open the socket, but I am now
>> > > > > stuck on  -
>> > > > > hcid[681]: Unable to get the control socket for 'bluetooth'
>> >
>> > > > > Were you able to resolve this one? I also saw that there is no
>> > > > > Bluetooth entry in /dev/socket. What to do now?
>> >
>> > > > > Thanks,
>> > > > > Sidharth
>> >
>> > > > > On Feb 2, 6:15 pm, pavan savoy <[email protected]> wrote:
>> > > > > > hciattach & hcid should be running as user "bluetooth" with both
>> of
>> > > them
>> > > > > in
>> > > > > > group bluetooth & net_bt_admin.
>> > > > > > If you are in development....
>> > > > > > just remove the ANDROID_PARANOID_NETWORK option from your
>> kernel.
>> >
>> > > > > > regards,
>> > > > > > Pavan
>> >
>> > > > > > On Mon, Feb 2, 2009 at 5:40 PM, Sidharth Malhotra <
>> [email protected]>
>> > > > > wrote:
>> >
>> > > > > > > Hi Nick,
>> >
>> > > > > > > I have been a silent observer of this group till now, but now
>> I am
>> > > > > > > kinda stuck. I am able to run hciattach, hciconfig, hcitool,
>> etc.
>> > > but
>> > > > > > > while running hcid I get this error message:
>> >
>> > > > > > > "
>> > > > > > > bash-3.2# hcid
>> > > > > > > hcid[1155]: Bluetooth HCI daemon
>> > > > > > > hcid[1155]: Create and Bind socket
>> > > > > > > hcid[1155]: Can't open HCI socket: Operation not permitted (1)
>> > > > > > > hcid[1155]: Cant open HCI socket: Bad file number (9
>> > > > > > > "
>> >
>> > > > > > > Can you tell me how to avoid this? I can run hcid (start hcid)
>> with
>> > > > > > > "bluetooth" user, but I guess since hcid is not running in
>> root
>> > > user
>> > > > > > > mode, I am facing this error. The relevant hcid entry in
>> init.rc
>> > > file
>> > > > > > > is:
>> > > > > > > service hcid /system/bin/logwrapper /system/bin/hcid -d -s -n
>> -f
>> > > > > > > system/etc/hcid.conf
>> > > > > > >    socket bluetooth stream 660 bluetooth bluetooth
>> > > > > > >    socket dbus_bluetooth stream 660 bluetooth bluetooth
>> > > > > > >    # init.rc does not yet support applying capabilities, so
>> run as
>> > > > > > > root and
>> > > > > > >    # let hcid drop uid to bluetooth with the right linux
>> > > capabilities
>> > > > > > >    group bluetooth net_bt_admin misc
>> > > > > > >    user root
>> > > > > > >    group bluetooth net_bt_admin misc
>> > > > > > > #   disabled
>> > > > > > >    oneshot
>> >
>> > > > > > > Still, when I do a ps, I cannot see hcid running.
>> >
>> > > > > > > Thanks,
>> > > > > > > Sidharth
>> >
>> > > > > > > On Dec 9 2008, 2:34 am, Nick Pelly <[email protected]> wrote:
>> > > > > > > > This is some Android specific magic.
>> >
>> > > > > > > > When two linux processes wish to communicate via a unix
>> domain
>> > > socket
>> > > > > on
>> > > > > > > a
>> > > > > > > > traditional linux distribution they often use /tmp. However
>> on
>> > > > > Android we
>> > > > > > > > got rid of /tmp for security and storage accountability
>> reasons.
>> > > > > Instead
>> > > > > > > a
>> > > > > > > > mechanism was introduced for daemons to request a unix
>> domain
>> > > socket
>> > > > > in
>> > > > > > > > /dev/socket than the init process creates on behalf of the
>> > > daemon.
>> > > > > The
>> > > > > > > > daemon just picks up the file descriptor from the
>> environment.
>> >
>> > > > > > > > See
>> > > > > > > > /dev/socket
>> > > > > > > > #define ANDROID_SOCKET_DIR
>> > > > > > > > system/core/init/readme.txt keyword socket
>> >
>> > > > > > > > The error you show here seems to indicate that hcid was
>> unable to
>> > > > > open
>> > > > > > > the
>> > > > > > > > socket provided by init. Perhaps you did not use the socket
>> > > syntax in
>> > > > > > > your
>> > > > > > > > init.rc
>> >
>> > > > > > > > Nick
>> > > > > > > > Android Systems Engineer
>> >
>> > > > > > > > On Mon, Dec 8, 2008 at 1:16 PM, pavan savoy <
>> > > [email protected]>
>> > > > > > > wrote:
>> > > > > > > > > Hi,
>> >
>> > > > > > > > > I started the bluez hcid as root, after disabling the
>> kernel
>> > > > > feature
>> > > > > > > that
>> > > > > > > > > blocks creation of sockets
>> [CONFIG_ANDROID_PARANOID_NETWORK] in
>> > > the
>> > > > > > > kernel,
>> >
>> > > > > > > > > Now If I start off hcid, I realise that the SDP server,
>> isn't
>> > > being
>> > > > > > > > > initialised properly.
>> >
>> > > > > > > > > I get the error...
>> >
>> > > > > > > > > # hcid -f /etc/hcid.conf -d -n
>> > > > > > > > > hcid[681]: Bluetooth HCI daemon
>> > > > > > > > > hcid[681]: Enabling debug information
>> > > > > > > > > hcid[681]: Starting SDP server
>> > > > > > > > > hcid[681]: Adding rec : 0x3b628
>> > > > > > > > > hcid[681]: with handle : 0x1
>> > > > > > > > > hcid[681]: Adding rec : 0x3b788
>> > > > > > > > > hcid[681]: with handle : 0x0
>> > > > > > > > > hcid[681]: Service classes 0x00
>> > > > > > > > > hcid[681]: Unable to get the control socket for
>> 'bluetooth'
>> > > > > > > > > hcid[681]: Server initialization failed
>> >
>> > > > > > > > > What is the reason ? where is android_get_control_socket
>> > > defined,
>> > > > > why
>> > > > > > > do we
>> > > > > > > > > need it ?
>> >
>> > > > > > > > > regards,
>> > > > > > > > > Pavan- Hide quoted text -
>> >
>> > > > > > > > - Show quoted text -- Hide quoted text -
>> >
>> > > > > > - Show quoted text -
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to