Re: [pulseaudio-discuss] How to find the latest created bluetooth sink/source via event hook?
'Twas brillig, and Lin, Mengdong at 19/05/11 03:09 did gyre and gimble: Great thanks for your advice, Col! Please note that there already exists a module called module-switch-on-connect which does this task, but for all new sinks, not just BT sinks. ... I found module-switch-on-connect.c is not in 0.9.22 tar ball but in git. When will this module be released? My work is still based on 0.9.22 and need upgrade to use this module. Indeed it's not in 0.9.22 It will be trivial to back port, I think it's only one git commit. The Makefile.am may need a little tweaking but it should be very easy. So even if it's not in the version you need to use, I'd backport it then improve it as you need and we can still ultimately take those improvement patches with little trouble :) We're hoping to get git master out pretty soon, within the next month or so, but depends on various stabilising efforts and peoples time :) Just so you know, I will am intending on shaking up the routing system in PA after v1 is released which will hopefully make this kind of thing easier to implement and manage. ... but essentially the routing will be based on priority lists of devices rather than just setting a single device to use. It sounds great! Could you share more information on this new design, maybe in a new thread? Arun already replied with the link that I forgot to put in the first mail... :p -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mageia Contributor [http://www.mageia.org/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] How to find the latest created bluetooth sink/source via event hook?
Hi, 'Twas brillig, and Lin, Mengdong at 18/05/11 04:43 did gyre and gimble: I’m developing an routing module to automatically set a new created Bluetooth sink as the default sink when a Bluetooth headset is connected. Please note that there already exists a module called module-switch-on-connect which does this task, but for all new sinks, not just BT sinks. I suspect it would be trivial to modify it to accept arguments which control things (e.g. device_types=all|bluetooth|usb|network - or a combination of those i.e. device_types=bluetooth,usb) rather than create a whole new module. If you want your work upstreamed, I would personally take this approach as I'd rather not get too much duplication of code in different modules. So I need to get the new BT sink when it’s created. Just so you know, I will am intending on shaking up the routing system in PA after v1 is released which will hopefully make this kind of thing easier to implement and manage. Feel free to ask if you want more details, but essentially the routing will be based on priority lists of devices rather than just setting a single device to use. But when I hook event “ PA_CORE_HOOK_SINK_NEW”, I found that the sink pointer for the callback function is **not** the real sink pointer value. Correct. This hook is fired before the sink is created to allow you to modify critical details about the sink before it is created. If you want a hook that informs you *after* the sink is created, then you can use PA_CORE_HOOK_SINK_PUT as shown in module-switch-on-connect.c code. So could anyone share some hint on how to find the new created sink/source? Shall I iterate the core’s sink/source list and compare pointers in sink/source state change callback function? I suspect the *_PUT hook is what you want :) Cheers Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mageia Contributor [http://www.mageia.org/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] How to find the latest created bluetooth sink/source via event hook?
Great thanks for your advice, Col! Please note that there already exists a module called module-switch-on-connect which does this task, but for all new sinks, not just BT sinks. ... I found module-switch-on-connect.c is not in 0.9.22 tar ball but in git. When will this module be released? My work is still based on 0.9.22 and need upgrade to use this module. Just so you know, I will am intending on shaking up the routing system in PA after v1 is released which will hopefully make this kind of thing easier to implement and manage. ... but essentially the routing will be based on priority lists of devices rather than just setting a single device to use. It sounds great! Could you share more information on this new design, maybe in a new thread? Thanks Amanda ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] How to find the latest created bluetooth sink/source via event hook?
On Thu, 2011-05-19 at 10:09 +0800, Lin, Mengdong wrote: Great thanks for your advice, Col! Please note that there already exists a module called module-switch-on-connect which does this task, but for all new sinks, not just BT sinks. ... I found module-switch-on-connect.c is not in 0.9.22 tar ball but in git. When will this module be released? My work is still based on 0.9.22 and need upgrade to use this module. Just so you know, I will am intending on shaking up the routing system in PA after v1 is released which will hopefully make this kind of thing easier to implement and manage. ... but essentially the routing will be based on priority lists of devices rather than just setting a single device to use. It sounds great! Could you share more information on this new design, maybe in a new thread? http://colin.guthr.ie/2010/02/this-is-the-route-to-hell/ Cheers, Arun ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss