<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Mangal;
        panose-1:0 0 4 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Times;
        panose-1:2 2 6 3 5 4 5 2 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
h1
        {mso-style-priority:9;
        mso-style-link:"Überschrift 1 Zchn";
        margin-top:24.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:14.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
h2
        {mso-style-priority:9;
        mso-style-link:"Überschrift 2 Zchn";
        margin-top:10.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:13.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
p.MsoTitle, li.MsoTitle, div.MsoTitle
        {mso-style-priority:10;
        mso-style-link:"Titel Zchn";
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:15.0pt;
        margin-left:0cm;
        mso-add-space:auto;
        border:none;
        padding:0cm;
        font-size:26.0pt;
        font-family:"Calibri",sans-serif;
        letter-spacing:.25pt;
        mso-fareast-language:EN-US;}
p.MsoTitleCxSpFirst, li.MsoTitleCxSpFirst, div.MsoTitleCxSpFirst
        {mso-style-priority:10;
        mso-style-link:"Titel Zchn";
        mso-style-type:export-only;
        margin:0cm;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        border:none;
        padding:0cm;
        font-size:26.0pt;
        font-family:"Calibri",sans-serif;
        letter-spacing:.25pt;
        mso-fareast-language:EN-US;}
p.MsoTitleCxSpMiddle, li.MsoTitleCxSpMiddle, div.MsoTitleCxSpMiddle
        {mso-style-priority:10;
        mso-style-link:"Titel Zchn";
        mso-style-type:export-only;
        margin:0cm;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        border:none;
        padding:0cm;
        font-size:26.0pt;
        font-family:"Calibri",sans-serif;
        letter-spacing:.25pt;
        mso-fareast-language:EN-US;}
p.MsoTitleCxSpLast, li.MsoTitleCxSpLast, div.MsoTitleCxSpLast
        {mso-style-priority:10;
        mso-style-link:"Titel Zchn";
        mso-style-type:export-only;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:15.0pt;
        margin-left:0cm;
        mso-add-space:auto;
        border:none;
        padding:0cm;
        font-size:26.0pt;
        font-family:"Calibri",sans-serif;
        letter-spacing:.25pt;
        mso-fareast-language:EN-US;}
p.MsoSubtitle, li.MsoSubtitle, div.MsoSubtitle
        {mso-style-priority:11;
        mso-style-link:"Untertitel Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;
        letter-spacing:.75pt;
        mso-fareast-language:EN-US;
        font-style:italic;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.MsoSubtleEmphasis
        {mso-style-priority:19;
        color:windowtext;
        font-style:italic;}
span.berschrift1Zchn
        {mso-style-name:"Überschrift 1 Zchn";
        mso-style-priority:9;
        mso-style-link:"Überschrift 1";
        font-family:"Arial",sans-serif;
        font-weight:bold;}
span.berschrift2Zchn
        {mso-style-name:"Überschrift 2 Zchn";
        mso-style-priority:9;
        mso-style-link:"Überschrift 2";
        font-family:"Arial",sans-serif;
        font-weight:bold;}
span.TitelZchn
        {mso-style-name:"Titel Zchn";
        mso-style-priority:10;
        mso-style-link:Titel;
        font-family:"Arial",sans-serif;
        letter-spacing:.25pt;}
span.UntertitelZchn
        {mso-style-name:"Untertitel Zchn";
        mso-style-priority:11;
        mso-style-link:Untertitel;
        font-family:"Arial",sans-serif;
        letter-spacing:.75pt;
        font-style:italic;}
span.E-MailFormatvorlage24
        {mso-style-type:personal-compose;
        font-family:"Verdana",sans-serif;
        font-variant:normal !important;
        color:black;
        text-transform:none;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;
        vertical-align:baseline;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">I'm currently trying simulate a SCO connection for the bluetooth module of pulseaudio, without any BT device connected.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">Therefore I have recreated a part of ofonos DBus API in Python. The DBus communication is working and I can pass a file descriptor to pulseaudio as
 return value of "Acquire".<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">But I still have some issues with the setup of the bluetooth socket.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">I create the socket like:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">self.soc = socket.socket(socket.AF_BLUETOOTH,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">                                                           socket.SOCK_SEQPACKET | socket.SOCK_CLOEXEC | socket.SOCK_NONBLOCK,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">                                                           socket.BTPROTO_SCO) #These params are taken from ofono<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">self.soc.bind(self.address)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">fd = self.soc.fileno() #fd will be sent to Pulseaudio<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">But then calling accept() or connect() on the socket (in my script) will result in an Error.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">Only when i don't set the socket to non-blocking, connect() does not throw an error, but it blocks endlessly.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">From Pulseaudio I the following Log messages:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">without calling connect():<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">319 D: [bluetooth] module-bluez5-device.c: Stream properly set up, we're ready to roll! (libpulsecommon-12.0.so(pa_log_levelv_meta+0x8b7) [0x7f915c40cf67])                                                
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">320 E: [bluetooth] module-bluez5-device.c: Failed to write data to SCO socket: Transport endpoint is not connected (libpulsecommon-12.0.so(pa_log_levelv_meta+0x8b7)
 [0x7f915c40cf67])<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">321 D: [bluetooth] module-bluez5-device.c: IO thread failed (libpulsecommon-12.0.so(pa_log_levelv_meta+0x8b7) [0x7f915c40cf67])<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">or
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">306 D: [bluetooth] module-bluez5-device.c: Stream properly set up, we're ready to roll! (libpulsecommon-12.0.so(pa_log_levelv_meta+0x8b7) [0x7f5d8303ff67])                                         
        <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">307 I: [bluetooth] module-bluez5-device.c: FD error: POLLHUP  (libpulsecommon-12.0.so(pa_log_levelv_meta+0x8b7) [0x7f5d8303ff67])<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">308 D: [pulseaudio] sink.c: bluez_sink.B8_27_EB_FF_15_F9.headset_head_unit: state: INIT -> IDLE (libpulsecommon-12.0.so(pa_log_levelv_meta+0x8b7) [0x7f5d8303ff67])<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">309 D: [bluetooth] module-bluez5-device.c: Audio stream torn down (libpulsecommon-12.0.so(pa_log_levelv_meta+0x8b7) [0x7f5d8303ff67])<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">when my program is stuck in socket.connect()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">I have also tried to use a BluetoothSocket from PyBluez with similar results.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">Can someone please help me to set the socket up properly?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">Best regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">Matthias Mirbeth<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:DE">Mit freundlichen Grüßen • Best regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:DE"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:115%"><b><span style="font-size:10.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:FR">Matthias Mirbeth<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="FR" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:FR">Bachelorand</span><span lang="FR" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR" style="font-size:8.0pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:FR">T. +49 (0)841 88390-5169
</span><span style="font-size:8.0pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:FR">Expleo Germany GmbH • Despagstraße 4 • 85055 Ingolstadt • Germany<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:justify;line-height:115%"><span style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:DE"><img width="167" height="33" style="width:1.7395in;height:.3437in" id="Image_x0020_1" src="cid:image001.png@01D58B40.037B2EB0"></span><b><span lang="EN-US" style="font-size:14.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:#6846C6;mso-fareast-language:FR"><o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-align:justify;line-height:115%"><b><span lang="EN-US" style="font-size:5.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:#6846C6;mso-fareast-language:FR"><o:p> </o:p></span></b></p>
<p class="MsoNormal" style="text-align:justify;line-height:115%"><b><u><span style="font-size:10.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:#6846C6;mso-fareast-language:FR"><a href="http://www.expleogroup.com/"><span style="color:#6846C6">expleogroup.com</span></a></span></u></b><b><u><span style="font-size:10.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:#6846C6;mso-fareast-language:FR"><br>
<br>
<o:p></o:p></span></u></b></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DE">Assystem Technologies ist jetzt Expleo</span><span style="color:black;mso-fareast-language:DE"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<span style="color:#353535">_____________________________________________________________________________________<br>
</span><br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#353535">Expleo Germany GmbH<br>
Sitz der Gesellschaft | Corporate Headquarters: München<br>
Handelsregister | Commercial Register: Amtsgericht München HRB 83252<br>
Geschäftsführung | Management: Ralph Gillessen, Josef Mitterhuber<br>
<br>
This message contains information that may be privileged or confidential. It is intended only for the person to whom it is addressed.<br>
If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof.
<br>
If you receive this message in error, please notify the sender immediately and delete all copies of this message.
</span><br>
<span style="color:#353535">_________________________________________________________<br>
</span><br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#353535">EMAIL LEGAL MENTION / DISCLAIMER<br>
<br>
This message contains information that may be privileged or confidential and is the property of the Expleo Services SAS, RCS Versailles 831 178 348, located, 3 avenue des Prés, 78180 Montigny Le Bretonneux - France. It is intended only for the person to whom
 it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete
 all copies of this message.<br>
<br>
Ce message contient des informations qui peuvent être privilégiées ou confidentielles et elles sont de la propriété d'Expleo Services SAS, RCS Versailles 831 178 348, situé, 3 avenue des Prés, 78180 Montigny le Bretonneux-France. Il est destiné uniquement à
 la personne à qui est adressé. Si vous n'êtes pas le destinataire visé, vous n'êtes pas autorisé à lire, imprimer, conserver, copier, diffuser, distribuer ou utiliser ce message ou toute partie de celui-ci. Si vous recevez ce message par erreur, veuillez en
 avertir immédiatement l'expéditeur et supprimer toutes les copies de ce message.
</span>
</body>
</html>