implement start/stop command #201

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
3 participants
@MaZderMind
Contributor

MaZderMind commented Apr 3, 2013

Hi

I use this to turn on/off my stereo via gpio using the perl script. implementing this in your 1.0-dev codebase is quite simple, as long as you regard player.c to be the correct place to call those commands.

Regards

@MaZderMind

This comment has been minimized.

Show comment Hide comment
@MaZderMind

MaZderMind Apr 3, 2013

Contributor

Hmm well I should have testet that in the wild before; fails with

Shutting down...
Got SIGTERM, quitting.
failed to accept connection: Interrupted system call
failed to accept connection: Interrupted system call

on my raspi, have to check why

Contributor

MaZderMind commented Apr 3, 2013

Hmm well I should have testet that in the wild before; fails with

Shutting down...
Got SIGTERM, quitting.
failed to accept connection: Interrupted system call
failed to accept connection: Interrupted system call

on my raspi, have to check why

@abrasive

This comment has been minimized.

Show comment Hide comment
@abrasive

abrasive Apr 8, 2013

Owner

Did you get this one working?

Owner

abrasive commented Apr 8, 2013

Did you get this one working?

@MaZderMind

This comment has been minimized.

Show comment Hide comment
@MaZderMind

MaZderMind Apr 8, 2013

Contributor

No but I know what the problem is: launching the subprocess from the player thread makes it receive signals from that subprocess. One of these signales interrupt a connect()-call somewhere else in the code.

I see that I'm novice when it comes to unix multithreading, so I'll have to try different solutions:

Contributor

MaZderMind commented Apr 8, 2013

No but I know what the problem is: launching the subprocess from the player thread makes it receive signals from that subprocess. One of these signales interrupt a connect()-call somewhere else in the code.

I see that I'm novice when it comes to unix multithreading, so I'll have to try different solutions:

@abrasive

This comment has been minimized.

Show comment Hide comment
@abrasive

abrasive Apr 8, 2013

Owner

You need to be careful here - signals are essential to the RTSP multiple connection handling functionality. Also if your external script takes too long at startup, the connection might run into trouble.

fork() would be a better choice from an isolation point of view, but then you start getting SIGCHLD instead - which is currently used to detect death of the mDNS advertising subprocess.

Any idea if SIGCHLD is delivered to the parent thread of the subprocess, or to any old thread that has SIGCHLD unblocked?

Owner

abrasive commented Apr 8, 2013

You need to be careful here - signals are essential to the RTSP multiple connection handling functionality. Also if your external script takes too long at startup, the connection might run into trouble.

fork() would be a better choice from an isolation point of view, but then you start getting SIGCHLD instead - which is currently used to detect death of the mDNS advertising subprocess.

Any idea if SIGCHLD is delivered to the parent thread of the subprocess, or to any old thread that has SIGCHLD unblocked?

@abrasive

This comment has been minimized.

Show comment Hide comment
@abrasive

abrasive Apr 8, 2013

Owner

You could block SIGCHLD globally (in the main() before threads are spawned) and then add a thread in the mDNS handler that does nothing but waitpid()... but there'd need to be a wait somewhere else to mop up all the dead subprocesses too.

Owner

abrasive commented Apr 8, 2013

You could block SIGCHLD globally (in the main() before threads are spawned) and then add a thread in the mDNS handler that does nothing but waitpid()... but there'd need to be a wait somewhere else to mop up all the dead subprocesses too.

@abrasive

This comment has been minimized.

Show comment Hide comment
@abrasive

abrasive May 13, 2013

Owner

I'd like to have this functionality in the 1.0 release. We need to figure out how to do this right.

Owner

abrasive commented May 13, 2013

I'd like to have this functionality in the 1.0 release. We need to figure out how to do this right.

@chappy72

This comment has been minimized.

Show comment Hide comment
@chappy72

chappy72 May 14, 2013

I am interested in using a gpio to switch inputs on my radio already got the circuitry figured out and working but, I am super new to all things unix so i dont think i will be of much help as far as the coding goes, but i figured i would say something ...

I am interested in using a gpio to switch inputs on my radio already got the circuitry figured out and working but, I am super new to all things unix so i dont think i will be of much help as far as the coding goes, but i figured i would say something ...

abrasive added a commit that referenced this pull request Jun 3, 2013

provide -B/-E for running shell commands on begin/end of playing
Implements functionality described by MaZderMind <github@mazdermind.de>
in issue #201.
@abrasive

This comment has been minimized.

Show comment Hide comment
@abrasive

abrasive Jun 3, 2013

Owner

Implemented. Thanks for the patch!

Owner

abrasive commented Jun 3, 2013

Implemented. Thanks for the patch!

@abrasive abrasive closed this Jun 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment