Skip to content

Commit

Permalink
Merge pull request #671 from aaknitt/patch-9
Browse files Browse the repository at this point in the history
Simplestream fixes
  • Loading branch information
robotastic authored Apr 30, 2022
2 parents dd3e6bf + 72f786d commit a488a46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/CONFIGURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,11 @@ pulseaudio is the default sound system on many Linux computers, including the Ra

An example command to set up pulseaudio to receive 8 kHz audio (digital audio) from simplestream on TCP port 9125:
```
pacmd load-module module-simple-protocol-tcp sink=1 playback=true port=9125 format=s16be rate=8000 channels=1
pacmd load-module module-simple-protocol-tcp sink=1 playback=true port=9125 format=s16le rate=8000 channels=1
```
An example command to set up pulseaudio to receive 16 kHz audio (analog audio) from simplestream on TCP port 9125:
```
pacmd load-module module-simple-protocol-tcp sink=1 playback=true port=9125 format=s16be rate=16000 channels=1
pacmd load-module module-simple-protocol-tcp sink=1 playback=true port=9125 format=s16le rate=16000 channels=1
```
The matching simplestream config to send audio from talkgroup 58918 to TCP port 9125 would then be something like this:
```yaml
Expand All @@ -358,7 +358,7 @@ The matching simplestream config to send audio from talkgroup 58918 to TCP port
"TGID":58918,
"address":"127.0.0.1",
"port":9125,
"sendTGID":true,
"sendTGID":false,
"shortName":"CountyTrunked",
"useTCP":true}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/simplestream/simplestream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ class Simple_Stream : public Plugin_Api {
int start(){
BOOST_FOREACH (auto& stream, streams){
if (stream.tcp == true){
io_service my_tcp_io_service;
ip::tcp::socket *my_tcp_socket = new ip::tcp::socket{my_tcp_io_service};
stream.tcp_socket = my_tcp_socket;
stream.tcp_socket->connect(ip::tcp::endpoint( boost::asio::ip::address::from_string(stream.address), stream.port ));
Expand All @@ -113,6 +112,7 @@ class Simple_Stream : public Plugin_Api {
int stop(){
BOOST_FOREACH (auto& stream, streams){
if (stream.tcp == true){
stream.tcp_socket->shutdown(boost::asio::ip::tcp::socket::shutdown_both);
stream.tcp_socket->close();
}
}
Expand Down

0 comments on commit a488a46

Please sign in to comment.