Plugging or unplugging headphones on a Mac

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alexei,

Yes, the audio will stop, that is the correct behavior because current
pjsua doesn't support Mac's input device monitoring (such as headphone
plug/unplug).
Having said that, this can easily be fixed by using CFRunLoop as your
main loop (or putting it in your main thread).
http://developer.apple.com/library/mac/#documentation/CoreFoundation/Reference/CFRunLoopRef/Reference/reference.html
(To put it another way, coreaudio_dev does support headphone
plug/unplug but it is the application's responsibility to ensure that
the event is passed to CoreAudio).

For illustration, modify your pjsua_app.c:
add the necessary include file:
    #include <CoreFoundation/CFRunLoop.h>
and add
    CFRunLoopRun()
after the block "switch (menuin[0])", so it should look like this:
    switch (menuin[0]) {
    ...
    }
    // This should be at line 4507 if you use the latest SVN
    CFRunLoopRun();

After you rebuild, start pjsua and use the audio loopback command (cc
0 0) or simply make a call, then you can try plugging/unplugging your
headphone.

IMPORTANT NOTE: this is by no means a complete solution.

Best regards,
Ming

On Sun, Dec 19, 2010 at 8:59 AM, Alexei Kuznetsov <eofster at gmail.com> wrote:
> On Fri, Dec 17, 2010 at 16:48, Ming <ming at teluu.com> wrote:
>> For the crash, unless you can somehow reproduce it using pjsua, we
>> can't help you much since I can't reproduce it on my machine.
>
> Does audio stop for you if you plug of unplug headphones while on the
> call using pjsua?
>
> Alexei
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux