RadioReference on Facebook   RadioReference on Twitter   RadioReference Blog
 

Go Back   The RadioReference.com Forums > Computer Aided Monitoring and Programming > Streaming / Broadcasting / Audio Recording

Streaming / Broadcasting / Audio Recording - Interested in putting your scanner online for others to hear? Want to listen to other radios on the internet. This forum is here for you to discuss these topics related to streaming scanners online.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #161 (permalink)  
Old 07-17-2017, 12:01 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

DC31, It just occured to me that using ps -aux and a text match with the error text output from ezstream could be used as a condition to reboot (or kill and restart related processes). Just not sure how to do that yet
Reply With Quote
Sponsored links
  #162 (permalink)  
Old 07-17-2017, 4:27 AM
krokus's Avatar
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Jun 2006
Location: Southeastern Michigan
Posts: 2,850
Default

Quote:
Originally Posted by JACK26 View Post
DC31, It just occured to me that using ps -aux and a text match with the error text output from ezstream could be used as a condition to reboot (or kill and restart related processes). Just not sure how to do that yet
That depends on where the error text is placed. If the program is not running, it will not show in the results of the ps. (Which can be used to trigger a restart, via a script.) If the error goes into a log file, grepping that log could work.

Sent via Tapatalk
__________________
Generic radio geek, in southeast Michigan.
PSR-500, TM-742, TM-V71,TH-78, HTX-420, IC-2AT, IC-2E (clone), Pro-39, BC-235XLT, TK-290, XTS-5000
Reply With Quote
  #163 (permalink)  
Old 07-17-2017, 5:23 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 782
Default

Quote:
Originally Posted by JACK26 View Post
One thing with working with rpi and VNC when working with the terminal windows and trying to copy and paste long lines of text, it truncates the text to the viewable area of the window so I can't see the full content of the output messages. There is no horizontal slider tab to move the content around. Any suggestions on how to solve that problem?
TIA .
Copy and paste when using VNC is a pain. I avoid it whenever possible. Normally, i am working on a Mac and connect to the pi through an ssh connection in a Terminal window. Copy and paste works fine there. If you are working on a Windows computer, you could try using puTTY for an ssh connection. I think that copy/paste will work that way.

I have seen the "no more data" streaming error messages MANY times. I have not tried to figure them out. As i recall, the message is something like "no more data from stdin". That implies to me that the data feed (audio) into ezstream has been interrupted. So, rather than a problem with ezstream itself, it may be a problem with the data being piped from rtl to sox then to ez.

I got my bcfy stream sounding reasonably good (acceptable) toward the end of last week. Since then i have diverged into trying to get the audio into pulseaudio so I can do other things rather than just a Bcfy feed. After countless hours, i can report absolutely no progress. When I hit on the correct combination to get it to show in pulse, the audio from rtl locks up with no error messages within about 5 sec.
Reply With Quote
  #164 (permalink)  
Old 07-18-2017, 12:26 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

Quote:
Originally Posted by krokus View Post
That depends on where the error text is placed. If the program is not running, it will not show in the results of the ps. (Which can be used to trigger a restart, via a script.) If the error goes into a log file, grepping that log could work.

Sent via Tapatalk
Hi krokus,
If I run $pstree when the problem happens, the related process' still show up:

├─lxterminal─┬─bash───pstree
│ ├─bash─┬─2*[sox]
│ │ ├─2*[sudo───rtl_fm───5*[{rtl_fm}]]
│ │ └─2*[sudo───ezstream]
│ ├─gnome-pty-helpe
│ ├─{gdbus}
│ └─{gmain}

2 instances of rtl_fm, 2 instances of ezstream with 2 instances of sox. (Running 2 sdr sticks and 2 feeds to Broadcastify),

When the problem happens, the associated instance of ezstream streams an error with something like "...no more data.." The tree above is result of running the script from a terminal window. Normally I run it from .sh file that rc.local loads.
So is there a way to use ps to detect the error message from ezstream and trigger a reboot of the rpi?

Details are appreciated as I'm new to linux scripting. TIA

ps: when the problem happens, the connection to Broadcastify is lost. That's why I originally thought it was a connection issue on my end. But now I am seeing it happen on one feed and not the other even though both feeds are sourced from the same rpi. So I don't think it's an internet connection problem every time it happens.

Last edited by JACK26; 07-18-2017 at 1:06 AM..
Reply With Quote
  #165 (permalink)  
Old 07-18-2017, 12:35 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

Quote:
Originally Posted by DC31 View Post
Copy and paste when using VNC is a pain. I avoid it whenever possible. Normally, i am working on a Mac and connect to the pi through an ssh connection in a Terminal window. Copy and paste works fine there. If you are working on a Windows computer, you could try using puTTY for an ssh connection. I think that copy/paste will work that way.

I have seen the "no more data" streaming error messages MANY times. I have not tried to figure them out. As i recall, the message is something like "no more data from stdin". That implies to me that the data feed (audio) into ezstream has been interrupted. So, rather than a problem with ezstream itself, it may be a problem with the data being piped from rtl to sox then to ez.

I got my bcfy stream sounding reasonably good (acceptable) toward the end of last week. Since then i have diverged into trying to get the audio into pulseaudio so I can do other things rather than just a Bcfy feed. After countless hours, i can report absolutely no progress. When I hit on the correct combination to get it to show in pulse, the audio from rtl locks up with no error messages within about 5 sec.
Thanks for the tip on putty. I was using that in the beginning but the newer Pixel for rpi gives a nice desktop style GUI and you can quickly do things easier than everything at the command line level. Also use pixel with VNC on my ads-b feeder which is an rpi2.

Turns out that it's possible to use VNC and ssh in parallel. So I can use putty for a full size command window and use VNC for convenience for other things.

Sorry I know nothing about pulse audio yet. Still determined to solve the up time reliability problem of the rpi rtl-sdr feeding Broadcastify. Good luck with that .
Reply With Quote
Sponsored links
  #166 (permalink)  
Old 07-18-2017, 1:58 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

One follow up question I have is, is there some kind of obscure requirement to feed Broadcastify at a 22.05Khz sample rate? My latest iteration of the rpi feed only needs 16Khz to feed high quality audio.
When I look at my statistics page it shows my feed at 22.05 Khz. Is that a potential problem if I feed at 16Khz?
Reply With Quote
  #167 (permalink)  
Old 07-18-2017, 4:11 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

Currently streaming here with USB sdr sticks on rpi here until it breaks again
https://www.broadcastify.com/listen/feed/23831
https://www.broadcastify.com/listen/feed/25781

ps the feed sample rate is 16KHz not 22.05KHz. Is that a problem? I did change that parameter in the ezstream files to 16KHz.

pps: Follow up. The broadcastify stats changed to the 16KHz stat, so that is not a problem

Last edited by JACK26; 07-18-2017 at 4:33 AM..
Reply With Quote
  #168 (permalink)  
Old 07-18-2017, 4:38 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 782
Default

Quote:
Originally Posted by JACK26 View Post
Currently streaming here with USB sdr sticks on rpi here until it breaks again
https://www.broadcastify.com/listen/feed/23831
https://www.broadcastify.com/listen/feed/25781

ps the feed sample rate is 16KHz not 22.05KHz. Is that a problem? I did change that parameter in the ezstream files to 16KHz.

pps: Follow up. The broadcastify stats changed to the 16KHz stat, so that is not a problem
The bcfy standard is 22050.

My two streams have run at 11025 for years
Reply With Quote
  #169 (permalink)  
Old 07-18-2017, 5:12 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 782
Default

Quote:
Originally Posted by JACK26 View Post
So is there a way to use ps to detect the error message from ezstream and trigger a reboot of the rpi?

Details are appreciated as I'm new to linux scripting. TIA

.
Jack,

Take a read of the following:

https://broadcastify.zendesk.com/hc/...-Documentation

Using the feed method returns the details of your feed with one of the parameters being whether it is on-line or off-line. "status":1 indicates on-line and "status":0 indicates off-line. It might be a good learning exercise to write a script that monitors that state and triggers a restart when it detects an off-line status. I would use the script that I posted a few days ago as a starting point and run it via a cron job every minute or two. I experimented a little with the feed method and there seems to be a lag of a minute or two also between when the feed goes off-line and when the status parameter actually changes.

This isn't the ideal solution but gives you a starting point.
Reply With Quote
Sponsored links
  #170 (permalink)  
Old 07-18-2017, 5:53 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

Quote:
Originally Posted by DC31 View Post
Jack,

Take a read of the following:

https://broadcastify.zendesk.com/hc/...-Documentation

Using the feed method returns the details of your feed with one of the parameters being whether it is on-line or off-line. "status":1 indicates on-line and "status":0 indicates off-line. It might be a good learning exercise to write a script that monitors that state and triggers a restart when it detects an off-line status. I would use the script that I posted a few days ago as a starting point and run it via a cron job every minute or two. I experimented a little with the feed method and there seems to be a lag of a minute or two also between when the feed goes off-line and when the status parameter actually changes.

This isn't the ideal solution but gives you a starting point.
Was hoping to hack away at a solution for this application, but now feel resigned to actually learning how to write linux script from a tutorial to solve the problems as no one else has yet.
ps: Thanks for that link .

Last edited by JACK26; 07-18-2017 at 5:58 AM..
Reply With Quote
  #171 (permalink)  
Old 07-18-2017, 6:12 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

Live on these two channels with the rpi and two rtl-sdr type USB sticks for now. It sounds way better than SDR#, The only remaining issue is reliability.
https://www.broadcastify.com/listen/feed/23831
https://www.broadcastify.com/listen/feed/25781
Reply With Quote
  #172 (permalink)  
Old 07-19-2017, 6:14 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

Quote:
Originally Posted by DC31 View Post
Jack,

Take a read of the following:

https://broadcastify.zendesk.com/hc/...-Documentation

Using the feed method returns the details of your feed with one of the parameters being whether it is on-line or off-line. "status":1 indicates on-line and "status":0 indicates off-line. It might be a good learning exercise to write a script that monitors that state and triggers a restart when it detects an off-line status. I would use the script that I posted a few days ago as a starting point and run it via a cron job every minute or two. I experimented a little with the feed method and there seems to be a lag of a minute or two also between when the feed goes off-line and when the status parameter actually changes.

This isn't the ideal solution but gives you a starting point.
Started looking at this api info and still have not figured out how to form a fully working url yet. I think that "feedid" is the mount value less the / and the user id is whatever your actual user id and the password is your logon password and not the password used by the feed?
Got past the "access denied" messages but still don't know how to query for online status. That link is not exactly detailed and all but one of the comments have to do with actually getting it to work. lol.
Any suggestions? TIA .

Last edited by JACK26; 07-19-2017 at 6:30 AM.. Reason: grammar mistake changed the meaning
Reply With Quote
  #173 (permalink)  
Old 07-19-2017, 6:19 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

Did an experiment to see if it was the USB sdr stick that was causing the problem by just pulling it out while everything was running and could not duplicate the problem that way. The app detected the event and attempted to exit the related processes. So it's not a problem with the stick itself.
Reply With Quote
  #174 (permalink)  
Old 07-19-2017, 6:44 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

Also, if the api query gives you more real time offline status, that's good because then it gives you a little time to get back online before your feed shows up as offline. Offline for more than about a minute or so triggers offline status and takes about 1 minute or so once you get back online before the Bcstfy servers show your feed as online again. No doubt that is intentional.

ps: Are you saying that the api status is 1 minute behind the actual online feed status to the public? If that's the case then it's not very useful. Hopefully you meant that the public status lagged a minute behind the api status.

Last edited by JACK26; 07-19-2017 at 7:18 AM..
Reply With Quote
  #175 (permalink)  
Old 07-19-2017, 8:47 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

Joking aside, this is interesting. But I am lost with the valid parameters and a working URL..please give more examples
https://broadcastify.zendesk.com/hc/...-Documentation
Reply With Quote
Sponsored links
  #176 (permalink)  
Old 07-19-2017, 9:29 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 782
Default

Quote:
Originally Posted by JACK26 View Post
Started looking at this api info and still have not figured out how to form a fully working url yet. I think that "feedid" is the mount value less the / and the user id is whatever your actual user id and the password is your logon password and not the password used by the feed?
Got past the "access denied" messages but still don't know how to query for online status. That link is not exactly detailed and all but one of the comments have to do with actually getting it to work. lol.
Any suggestions? TIA .
Feedid are the numbers at the end of your links posted two posts above.

23831
And
25781

Userid and password are your user name and password used to sign in to use the RR forums. jack26 and your password.
Reply With Quote
  #177 (permalink)  
Old 07-19-2017, 9:44 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

DC31 thanks for answering that exact question with the apparent exact answer
Reply With Quote
  #178 (permalink)  
Old 07-19-2017, 9:46 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

Just kidding
Reply With Quote
  #179 (permalink)  
Old 07-19-2017, 9:47 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

I want to visit the Bunny Ranches of Northern Nevada
Reply With Quote
  #180 (permalink)  
Old 07-20-2017, 1:52 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Dec 2016
Location: CA
Posts: 121
Default

Sorry about that last post, too much to drink. Please delete #178, 179 and this one if possible.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 9:32 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
All information here is Copyright 2012 by RadioReference.com LLC and Lindsay C. Blanton III.Ad Management by RedTyger
Copyright 2015 by RadioReference.com LLC Privacy Policy  |  Terms and Conditions