RadioReference on Facebook   RadioReference on Twitter   RadioReference Blog
 

Go Back   The RadioReference.com Forums > Software > 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
  #21 (permalink)  
Old 03-24-2013, 5:01 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 332
Default

Quote:
Originally Posted by aaknitt View Post
That's actually a slightly different error than the one above. I suspect this may have to do with whatever causes "pulse" to show up as index 2 sometimes and index 3 other times. I think it may be index 2 but when TTD tries to use index 3 it throws this error. The next time you run the program it's back to index 3, for whatever reason. If it does it repeatedly, try running LevelMeter.pyc and see if the index of the "pulse" devices has changed.

Andy
Okay, that may be the issue. The last time i had the meter open it showed Index 2 so i changed the program setting. That may be why i am now getting the error much more frequently.
Reply With Quote
Sponsored links
  #22 (permalink)  
Old 03-24-2013, 8:51 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 332
Default

I have TTD59Pi up and running on the RPi now. All is working well except that the audio is terrible. I have been fooling with all sorts of settings trying to improve it. Attached are links to two audio recordings of the same dispatch, one off v56 running on an old WinXP computer at the firehouse and the second one off the Pi. I would love to be able to duplicate that audio quality on the Pi. Anyone have any suggestions for the audio settings? On the Windows computer I have the audio in volume on the computer set as low as it will go and control the volume with the knob on the scanner. Also there is a check box called AGC I think that has been cleared.

On the Pi I have the input level of the microphone set to 18%.

http://dl.dropbox.com/u/96733977/Sun..._recording.mp3

http://dl.dropbox.com/u/96733977/Sun..._recording.mp3
Reply With Quote
  #23 (permalink)  
Old 03-24-2013, 11:18 AM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Aug 2005
Posts: 841
Default

Quote:
Originally Posted by DC31 View Post
I have TTD59Pi up and running on the RPi now. All is working well except that the audio is terrible. I have been fooling with all sorts of settings trying to improve it. Attached are links to two audio recordings of the same dispatch, one off v56 running on an old WinXP computer at the firehouse and the second one off the Pi. I would love to be able to duplicate that audio quality on the Pi. Anyone have any suggestions for the audio settings? On the Windows computer I have the audio in volume on the computer set as low as it will go and control the volume with the knob on the scanner. Also there is a check box called AGC I think that has been cleared.

On the Pi I have the input level of the microphone set to 18%.

http://dl.dropbox.com/u/96733977/Sun..._recording.mp3

http://dl.dropbox.com/u/96733977/Sun..._recording.mp3
Are you running your USB at 2.0 (default) or have you changed it to 1.0? I had similar-sounding audio (although not that bad) before setting mine to 1.0. It would cause it to miss tones because of the distortion. See the very bottom of the web page (under USB audio input issues) for instructions on how to change it to 1.0 if you haven't already.

Andy
__________________
Using TwoToneDetect? Show us where! Add yourself to the user map here or PM me with your location and I'll add you.

If you need help with TwoToneDetect please read this post first
Reply With Quote
  #24 (permalink)  
Old 03-24-2013, 11:41 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 332
Default Not really sure...

Not really sure what I might have done but I just sat down at the computer and the terminal had this displayed:

Freq: 527 Level: 3053
Freq: 510 Level: 3053
Freq: 521 Level: 3053
Freq: 521 Level: 3053
Freq: 532 Level: 3053
Freq: 516 Level: 3053
Freq: 451 Level: 3053
Freq: 677 Level: 3053
Expression 'alsa_snd_pcm_poll_descriptors_revents( self->pcm, pfds, self->nfds, &revents )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3597
Expression 'PaAlsaStreamComponent_EndPolling( &self->capture, capturePfds, &pollCapture, &xrun )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3793
Expression 'PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4338
Traceback (most recent call last):
File "TwoToneDetect59Pi.py", line 683, in <module>
File "TwoToneDetect59Pi.py", line 672, in record
File "/usr/lib/pymodules/python2.7/pyaudio.py", line 564, in read
return pa.read_stream(self._stream, num_frames)
IOError: [Errno Unanticipated host error] -9999
pi@raspberrypi ~/TTD59/dist $

The log doesn't show any problem prior to that. It looks like it shut TTD down.

I have been working on sound settings this morning but hadn't touched anything for an hour or so before this happened.

Now when I try to restart TTD I get the name "stream" error. This makes it look like it changed Index numbers mid-stream?

You are correct that I hadn't put the line in from the Audio issues comment at the end of the instructions. Will do that now.

Jim
Reply With Quote
  #25 (permalink)  
Old 03-24-2013, 11:45 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 332
Default

Quote:
Originally Posted by DC31 View Post

You are correct that I hadn't put the line in from the Audio issues comment at the end of the instructions. Will do that now.

Jim
My memory is becoming shorter than my...

Yes, I did put the line in cmdline.txt when I originally set it up.
Reply With Quote
Sponsored links
  #26 (permalink)  
Old 03-24-2013, 12:13 PM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 332
Default

Quote:
Originally Posted by DC31 View Post

Yes, I did put the line in cmdline.txt when I originally set it up.
ok i found another cheap chinese sound card and replaced the Plantronics one that i was using. From my dummy tone test, it sounds much better, only it seems to be missing several seconds of message up front. Time to get on to something else for a while and let some real tones come through to see what happens.
Reply With Quote
  #27 (permalink)  
Old 03-24-2013, 8:43 PM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 332
Default

Quote:
Originally Posted by aaknitt View Post
I do remember running in to this, but can't remember what i did to get it working. Is your USB sound card plugged into a hub or directly into the Pi? I had some issues with my hub and had to plug it straight in to get it working.

Andy
A few more bits, andy:

1. The usb sound card is now in the hub and is working fine. The problem was in the configuration in pavumeter. There was an ALSA input of some sort that i disabled.

2. I also ran into very erratic keybard/mouse behavior when i plugged them in to the pi's usb port. When i plugged them into the usb hub they worked normally again.
Reply With Quote
  #28 (permalink)  
Old 03-24-2013, 11:57 PM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Aug 2005
Posts: 841
Default

Quote:
Originally Posted by DC31 View Post
From my dummy tone test, it sounds much better, only it seems to be missing several seconds of message up front.
Other people have reported that issue with the regular (non-Pi) v59. I'm still trying to troubleshoot it having a hard time reproducing it here.

Andy
__________________
Using TwoToneDetect? Show us where! Add yourself to the user map here or PM me with your location and I'll add you.

If you need help with TwoToneDetect please read this post first
Reply With Quote
  #29 (permalink)  
Old 03-24-2013, 11:59 PM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Aug 2005
Posts: 841
Default

Quote:
Originally Posted by DC31 View Post
2. I also ran into very erratic keybard/mouse behavior when i plugged them in to the pi's usb port. When i plugged them into the usb hub they worked normally again.
I had similar issues when I had the keyboard, mouse, and sound card all plugged in to the same hub. I can't get my hub to work at all in 1.0 mode, so I just ditched the keyboard and mouse in favor of SSH after switching to 1.0.

Andy
__________________
Using TwoToneDetect? Show us where! Add yourself to the user map here or PM me with your location and I'll add you.

If you need help with TwoToneDetect please read this post first
Reply With Quote
Sponsored links
  #30 (permalink)  
Old 03-25-2013, 10:24 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 332
Default

Quote:
Originally Posted by aaknitt View Post
I had similar issues when I had the keyboard, mouse, and sound card all plugged in to the same hub. I can't get my hub to work at all in 1.0 mode, so I just ditched the keyboard and mouse in favor of SSH after switching to 1.0.

Andy
I have been using SSH also. I moved my equipment to the firehouse last night to get the audio in from the scanner there which has a much better antenna. I can also ssh in at the FH. So i left it set up there last night and got no page detections although v56 got several. Not sure what the issue is. How do i know that TTD is running? Once i exit Terminal, i just have to hope that it stayed running. When i again log in thru ssh, i go right to a linux prompt and then have to start TTD. When i exit Terminal, does it stop the Python program?
Reply With Quote
  #31 (permalink)  
Old 03-26-2013, 5:47 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 332
Default

Quote:
Originally Posted by DC31 View Post
I have been using SSH also. I moved my equipment to the firehouse last night to get the audio in from the scanner there which has a much better antenna. I can also ssh in at the FH. So i left it set up there last night and got no page detections although v56 got several. Not sure what the issue is. How do i know that TTD is running? Once i exit Terminal, i just have to hope that it stayed running. When i again log in thru ssh, i go right to a linux prompt and then have to start TTD. When i exit Terminal, does it stop the Python program?
The NOHUP command does the trick.
Reply With Quote
  #32 (permalink)  
Old 03-28-2013, 6:35 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 332
Default

Quote:
Originally Posted by aaknitt View Post
Hi everyone,

I finally had some time to put together a page showing how I got TwoToneDetect running on a Raspberry Pi. Along with a cheap receiver, this could allow you to have a TTD setup up and running that uses very little power for under $100.

I'm by no means a Linux guru, so if you run into problems trying to duplicate this I'm not sure how much help I'll be, but feel free to post here if you'd like. I thought I'd start a new thread to keep the Linux stuff separate from the main Windows version of TTD.

Regards,

Andy
Andy, i thought it time to give you a quick update. I have learned more Linux this week than i ever thought that I would. Making it even more interesting is the fact that I am remoting in to the pi from out of state on my iPad. This is also new to me. I seem to have it running flawlessly now. Six tone sets detected overnight last night with complete audio recording, no missed audio. I am also running v56 on another computer and that shows me that i didn't miss any detections. I am still not pleased with the audio quality from the pi, i believe it to be related to Mic-in on the usb sound card. I tried turning the scanner volume down and the mic level up. That did improve it considerably. I plan on tinkering with this some more when i get home.
Reply With Quote
  #33 (permalink)  
Old 03-28-2013, 10:47 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: May 2012
Posts: 9
Default Problem recording audio - file is empty

Greetings,

First, love the program. I'm really hoping to use this in conjunction with the Raspberry Pi for a local department - helping them get it set up.

I ordered my Pi this morning and won't have it for a while. In the meantime, I thought I'd follow your tutorial in Linux and see how it all works. I have everything working EXCEPT for recording of audio - the files that are being generated are empty (0 bytes).

This is what I see on the screen during the recording process -
Code:
done writing WAV Fire Department 1 11:42:38
ffmpeg version 0.8.5-6:0.8.5-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
  built on Jan 24 2013 14:49:20 with gcc 4.7.2
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
[wav @ 0x13798c0] max_analyze_duration reached
Input #0, wav, from './audio/Fire_Department_1_2013-03-2811_42_38_782109.wav':
  Duration: 00:00:27.86, bitrate: 176 kb/s
    Stream #0.0: Audio: pcm_s16le, 11025 Hz, 1 channels, s16, 176 kb/s
Output #0, mp3, to './audio/Fire_Department_1_2013-03-2811_42_38_782109.mp3':
    Stream #0.0: Audio: [0][0][0][0] / 0x0000, 11025 Hz, 1 channels, s16, 200 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Encoder (codec id 86017) not found for output stream #0.0
done converting to MP3 Fire Department 1 11:42:38
Any ideas?
Reply With Quote
  #34 (permalink)  
Old 03-28-2013, 11:07 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: May 2012
Posts: 9
Default

In reference to my previous post, I corrected the e-mail issue by encoding my password to base64 (the Windows version of the program does this for you, then saves in Config - just entering my password plain in config seems to break everything. Also fixed the issue of empty audio files by running
Code:
sudo apt-get install ffmpeg libavcodec-extra-53
Still getting this message when recording -
Code:
done writing WAV Fire Department 1 11:58:12
ffmpeg version 0.8.5-6:0.8.5-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
  built on Jan 24 2013 14:49:20 with gcc 4.7.2
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
[wav @ 0x1d2bae0] max_analyze_duration reached
Input #0, wav, from './audio/Fire_Department_1_2013-03-2811_58_12_452712.wav':
  Duration: 00:00:27.86, bitrate: 176 kb/s
    Stream #0.0: Audio: pcm_s16le, 11025 Hz, 1 channels, s16, 176 kb/s
[mp3 @ 0x1d2dd20] Unsupported sample rate.
Output #0, mp3, to './audio/Fire_Department_1_2013-03-2811_58_12_452712.mp3':
  Metadata:
    TSSE            : Lavf53.21.0
    Stream #0.0: Audio: libmp3lame, 11025 Hz, 1 channels, s16, 200 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press ctrl-c to stop encoding
size=     219kB time=28.00 bitrate=  64.0kbits/s    
video:0kB audio:219kB global headers:0kB muxing overhead 0.014730%
done converting to MP3 Fire Department 1 11:58:12
Reply With Quote
  #35 (permalink)  
Old 03-28-2013, 9:49 PM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Aug 2005
Posts: 841
Default

Quote:
Originally Posted by nightmicu View Post
In reference to my previous post, I corrected the e-mail issue by encoding my password to base64 (the Windows version of the program does this for you, then saves in Config - just entering my password plain in config seems to break everything. Also fixed the issue of empty audio files by running
Code:
sudo apt-get install ffmpeg libavcodec-extra-53
Still getting this message when recording -
Code:
done writing WAV Fire Department 1 11:58:12
ffmpeg version 0.8.5-6:0.8.5-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
  built on Jan 24 2013 14:49:20 with gcc 4.7.2
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
[wav @ 0x1d2bae0] max_analyze_duration reached
Input #0, wav, from './audio/Fire_Department_1_2013-03-2811_58_12_452712.wav':
  Duration: 00:00:27.86, bitrate: 176 kb/s
    Stream #0.0: Audio: pcm_s16le, 11025 Hz, 1 channels, s16, 176 kb/s
[mp3 @ 0x1d2dd20] Unsupported sample rate.
Output #0, mp3, to './audio/Fire_Department_1_2013-03-2811_58_12_452712.mp3':
  Metadata:
    TSSE            : Lavf53.21.0
    Stream #0.0: Audio: libmp3lame, 11025 Hz, 1 channels, s16, 200 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press ctrl-c to stop encoding
size=     219kB time=28.00 bitrate=  64.0kbits/s    
video:0kB audio:219kB global headers:0kB muxing overhead 0.014730%
done converting to MP3 Fire Department 1 11:58:12
That message is normal, looks like it's working. I may play around with switching from ffmpeg to libav at some point in the future to get rid of that warning, we'll see.

Andy
__________________
Using TwoToneDetect? Show us where! Add yourself to the user map here or PM me with your location and I'll add you.

If you need help with TwoToneDetect please read this post first
Reply With Quote
Sponsored links
  #36 (permalink)  
Old 03-28-2013, 9:56 PM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: May 2012
Posts: 9
Default

Quote:
Originally Posted by aaknitt View Post
That message is normal, looks like it's working. I may play around with switching from ffmpeg to libav at some point in the future to get rid of that warning, we'll see.

Andy
Hey Andy,
The bit that worries me is this -
** THIS PROGRAM IS DEPRECATED ***

Also, what do you make of the mp3 sample out of range error? It's highlighted red in the terminal
Reply With Quote
  #37 (permalink)  
Old 04-03-2013, 9:57 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: May 2012
Posts: 9
Default Recording quality?

I have been experimenting with this configuration for the past couple of days and cannot seem to get the same quality as on a regular Linux machine running the same USB sound cards that I've been testing with.

Here are two recordings - the first from this sound card - Syba SD-CM-UAUD Amazon.com: Syba SD-CM-UAUD USB Stereo Audio Adapter, C-Media Chipset, RoHS: Computers & Accessories
and the second from the same sound card used in your How To manual.

Recording 1 - https://s3.amazonaws.com/tevfd-recor..._22_708715.mp3
Recording 2 - https://s3.amazonaws.com/tevfd-recor..._57_245594.mp3

The volumes are different (perhaps when you switch sound cards Pulse Audio changes levels around?) but the underlying quality is about the same. There is some crackling and at times it seems like it's freezing a bit.

I tried your suggestion to change USB to 1 in boot but it did not seem to make any difference. I also tried increasing the MP3 bitrate to 48000. Is this about as good as it gets or is there something else I can try?

Thanks
Reply With Quote
  #38 (permalink)  
Old 04-03-2013, 11:28 AM
motomeso's Avatar
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Dec 2002
Location: Ontario
Posts: 874
Default

Just to add to this thread I'm running an ESXi server which is based on Linux with 6 virtual windows machines and all are running these sound cards with no issues at all.

USB 3D Sound Adapter (Color Assorted) - Free Shipping - DealExtreme

The only issues that I had with bad audio was when I ran mine through a hub also.
Reply With Quote
  #39 (permalink)  
Old 04-03-2013, 9:24 PM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Aug 2005
Posts: 841
Default

There seem to still be lots of issues with USB audio support on the Pi. Some USB cards seem to work better than others, and it doesn't seem like there are any sure fire ways to get them all working, based on what I've seen on the Raspberry Pi forums. Hopefully they'll come out with some updates to address this at some point. In the mean time, all I can do is tell you what I did to get it working decent with my particular sound card.

Andy
__________________
Using TwoToneDetect? Show us where! Add yourself to the user map here or PM me with your location and I'll add you.

If you need help with TwoToneDetect please read this post first
Reply With Quote
  #40 (permalink)  
Old 04-06-2013, 4:18 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 332
Default Making progress

Quote:
Originally Posted by DC31 View Post
I have TTD59Pi up and running on the RPi now. All is working well except that the audio is terrible. I have been fooling with all sorts of settings trying to improve it. Attached are links to two audio recordings of the same dispatch, one off v56 running on an old WinXP computer at the firehouse and the second one off the Pi. I would love to be able to duplicate that audio quality on the Pi. Anyone have any suggestions for the audio settings? On the Windows computer I have the audio in volume on the computer set as low as it will go and control the volume with the knob on the scanner. Also there is a check box called AGC I think that has been cleared.

On the Pi I have the input level of the microphone set to 18%.

http://dl.dropbox.com/u/96733977/Sun..._recording.mp3

http://dl.dropbox.com/u/96733977/Sun..._recording.mp3
I bought another cheap usb sound card off ebay with a line in port in addition to mic in. After a little tinkering with the settings in pavucontrol it seems to have fixed the audio problems that i was experiencing. The audio is now nearly identical to that coming from TTD on the desktop unit with the internal sound card. I will post some samples later today.

Here is the card: External USB 2 0 Virtual 7 1 Channel CH 3D Audio Sound Card Converter Adapter W | eBay
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 7:36 PM.


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