Close/Exit stream2ip on connection

Asked by Chodid on 2012-04-16

Hey everybody,

stream2ip is exactly the tool I was looking for to autoconnect to my bluetooth audio dongle on startup - and it works perfectly fine.
The problem that i'm having now is that i'd like stream2ip to auto-quit after a successful connection - not just to auto-minimize. I figured it would work with the "command to run after connection" option but I couldn't find a command that would quit a specific application withoud having to identify its program-id first.
Is there a solution for that problem?

Thanks for the awesome program and thanks for any help/suggestions

Question information

Language:
English Edit question
Status:
Solved
For:
stream2ip Edit question
Assignee:
No assignee Edit question
Solved by:
Takkat
Solved:
2012-04-26
Last query:
2012-04-26
Last reply:
2012-04-16
Best Takkat (takkat-nebuk) said : #1

Thank you for contributing to the development of stream2ip.

You can terminate stream2ip after a connection was established by addding the following line to 'Command to run after connection':

    pkill -3 -f stream2ip.py

However there are some drawbacks you might want to consider:

1. Commands there will only be executed when the scanning interval is set to '0'.
2. We will not be able to restore the previous audio sink (which may not be the default sink).
3. We will not be able to reconnect in case a device is intermittently unavailable.
4. It may also be that when running stream2ip from autostart the Bluetooth device may not yet be ready. Then we can only connect to the device by manually pressing the 'Connect' button.
5. This method is **not recommended** for streaming methods other than Bluetooth as other subprocesses will not be terminated appropriately.

Because of these other streaming methods provided we are at present unable to offer a fully functional feature you asked for.

You may not have come across our forked project bt-autoconnect (https://launchpad.net/bt-autoconnect) using the same code as does stream2ip but is specifically designed for connecting Bluetooth audio devices only. It would be very easy to implement a 'quit program on connection'-feature there.

In case you like it, let me suggest you file a bug with bt-autoconnect to get a notice as soon as we have the new version out.

Chodid (philipp-chadid) said : #2

Thanks for your quick and extensive answer.
I looked into bt-autoconnect and it would perfectly fit my purpose if it would autoconnect to my bluetooth headset. But this isn't the right place to solve this problem i know.
Since stream2ip works perfectly and you recommend not to quit it - is there a way to hide the tray-icon and still keep the program running?

Chodid (philipp-chadid) said : #3

Thanks Takkat, that solved my question.

Takkat (takkat-nebuk) said : #4

Sad to hear that bt-autoconnect does not work for you. So far no idea why. Both, stream2ip, and bt-autoconnect use the same code and method to discover and connect to a device. Timing issue?

Hiding the Indicator in stream2ip is not much of a deal. I'll put this on my agenda for the next release. We may offer a setup option such as

[x ] Show status icon

Thank you for sharing your ideas.