2007-05-12 18:27:41

by Petteri Räty

[permalink] [raw]
Subject: [Bluez-devel] a2dpd getting into an endless loop when it fails to get a socket and not dying on CTRL+c

betelgeuse@pena ~ $ a2dpd -n -v -o -g -b
A2DPD[21:17:29.577]: init_ipc: Selected IPC: inet, addr=127.0.0.1,
bcst=127.0.0.255, port=8000
A2DPD[21:17:29.577]: make_daemon_process: a2dpd [May 12 2007 19:46:25]
starting ...
A2DPD[21:17:29.577]: main: (errno=13:Permission denied)a2dpd
addr=00:13:17:70:3E:A0 timer=0 us [May 12 2007 19:46:26]
A2DPD[21:17:29.577]: a2dpd_signal_init: Getting on DBUS
A2DPD[21:17:29.579]: a2dpd_signal_init: Installing watch
A2DPD[21:17:29.579]: add_dbus_watch: Added watch 0 0x80a3770 disabled
A2DPD[21:17:29.579]: add_dbus_watch: Added watch 1 0x80a3798 enabled
A2DPD[21:17:29.579]: a2dpd_signal_init: Registering object path:
/com/access/a2dpd
A2DPD[21:17:29.579]: a2dpd_signal_init: Acquiring service: com.access.a2dpd
A2DPD[21:17:29.580]: a2dpd_signal_init: OK
A2DPD[21:17:29.580]: a2dpd_signal_init: OK
A2DPD[21:17:29.580]: a2dpd_register_sdp: Start
A2DPD[21:17:29.580]: add_avrtg:
A2DPD[21:17:29.580]: add_a2source:
A2DPD[21:17:29.580]: a2dpd_register_sdp: OK
A2DPD[21:17:29.580]: main_loop:
A2DPD[21:17:29.581]: make_server_socket:
A2DPD[21:17:29.581]: a2dp_make_listen_socket: (errno=13:Permission
denied)Cannot bind socket 6 for psm 25
A2DPD[21:17:29.581]: main_loop: Cannot get AVDTP socket
A2DPD[21:17:30.581]: main_loop:
A2DPD[21:17:30.581]: make_server_socket:
A2DPD[21:17:30.581]: main_loop: (errno=98:Address already in use)Cannot
get UNIX socket
A2DPD[21:17:31.581]: main_loop:
A2DPD[21:17:31.581]: make_server_socket:
A2DPD[21:17:31.581]: main_loop: (errno=98:Address already in use)Cannot
get UNIX socket
A2DPD[21:17:32.581]: main_loop:
A2DPD[21:17:32.581]: make_server_socket:
A2DPD[21:17:32.581]: main_loop: (errno=98:Address already in use)Cannot
get UNIX socket
A2DPD[21:17:33.514]: sigint_handler: handling SIGINT
A2DPD[21:17:33.514]: main_loop: (errno=4:Interrupted system call)
A2DPD[21:17:33.514]: make_server_socket:
A2DPD[21:17:33.514]: main_loop: (errno=98:Address already in use)Cannot
get UNIX socket
A2DPD[21:17:33.968]: sigint_handler: handling SIGINT

Basically it seems to go into an endless loop when it can't get the
socket and I must then kill it with kill -9 <pid>.

I tried to change various things in .a2pdrc but didn't make a difference.

Regards,
Petteri


Attachments:
signature.asc (252.00 B)
OpenPGP digital signature
(No filename) (286.00 B)
(No filename) (164.00 B)
Download all attachments

2007-05-13 18:20:25

by Petteri Räty

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dpd getting into an endless loop when it fails to get a socket and not dying on CTRL+c

Petteri Räty kirjoitti:
> Petteri Räty kirjoitti:
>> Basically it seems to go into an endless loop when it can't get the
>> socket and I must then kill it with kill -9 <pid>.
>>
>
> Attached is a patch that fixes this.
>
> Regards,
> Petteri
>
>

Can someone explain why this code is in the main loop in the first
place. I would think that the sockets need to be created only once.

// Master socket
sockfd = make_server_socket();
if(sockfd<0) {
DBG("Cannot get UNIX socket");
return -1;
}

avdtpfd = a2dp_make_listen_socket(25);
if(avdtpfd<0) {
DBG("Cannot get AVDTP socket");
return -1;
}

Regards,
Petteri


Attachments:
signature.asc (252.00 B)
OpenPGP digital signature
(No filename) (286.00 B)
(No filename) (164.00 B)
Download all attachments

2007-05-13 17:55:09

by Petteri Räty

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dpd getting into an endless loop when it fails to get a socket and not dying on CTRL+c

Petteri Räty kirjoitti:
>
> Basically it seems to go into an endless loop when it can't get the
> socket and I must then kill it with kill -9 <pid>.
>

Attached is a patch that fixes this.

Regards,
Petteri


Attachments:
a2dpd-sigint.patch (438.00 B)
signature.asc (252.00 B)
OpenPGP digital signature
(No filename) (286.00 B)
(No filename) (164.00 B)
Download all attachments