Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplestream fixes #671

Merged
merged 3 commits into from
Apr 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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