Slowed audio on RPi Broadcastify feed?

Status
Not open for further replies.

K5DVT

Member
Feed Provider
Joined
Jun 1, 2014
Messages
45
Location
Woo Pig Sooieville
Hey all, So I've got my Broadcastify feed up and going, but the audio sounds like it has been dragged out or slowed down. The only thing I can trace it to is the sound card as the aux cable I use is fine, as well as the scanner. It worked fine for a long time on the Windoze box, as well as when I went to the Pi. I'm going to try to switch sound cards, maybe that will fix it but TTD won't even detect the tones it's so dragged out. a 600 or so hertz tone was more like 200 hertz... which is why I believe it is the sound card and not the pi.

Maybe I'm wrong.

Any one else have this issue?
 

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Location
Milpitas, CA
That's probably caused by a bit rate mismatch somewhere in one of the configuration files. Doubt that would be a hardware issue.
 

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Location
Milpitas, CA
I don't know much about the usb sound card and real scanner pi combination except that it seems to work a lot better than rtl-sdr for reliability.

But I've seen that frequency change using rtl_fm and rtl-sdr if rtl_fm bit rate is different from the sox encoder bit rate.
 

K5DVT

Member
Feed Provider
Joined
Jun 1, 2014
Messages
45
Location
Woo Pig Sooieville
I just checked the Darkice config, and It seems to be that the sample rate was set to 11050 ( or the one that starts with 11000) and changed it to 22050 as recommended by Radio Reference. Rebooting now to see if that will solve the problem.
 

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Location
Milpitas, CA
Hope that fixes the problem but if it doesn't, usually the bit rate mismatch is between the audio in and the mp3 encoder bit rate. The encoder bit rate should match what ever the audio input bit rate from the sound card is.
 

K5DVT

Member
Feed Provider
Joined
Jun 1, 2014
Messages
45
Location
Woo Pig Sooieville
It doesn't appear to have fixed the problem. I used an only 2 meter HT in the past, and I wonder if perhaps I got voltage somehow from it's battery on the audio line and that's what has messed up the chip... What's an easy way to find out the sound card mp3 encoder rate? Does Alsamixer give that out? I don't remember off the top of my head...
 

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Location
Milpitas, CA
Sorry but not very familiar with this setup. DC31 can probably help you more once he sees your post.
In the meantime my only advice is try re-installing from scratch from the wiki instructions. There is something in your configuration that probably changed or a file is corrupted. Not likely a hardware problem.
 

K5DVT

Member
Feed Provider
Joined
Jun 1, 2014
Messages
45
Location
Woo Pig Sooieville
I got the problem intitally and after a few basic tests I decided to just re-flash the image. I was using the TTD image that includes Two Tone Detect as well as Darkice, already installed on there. Supposed to be plug, give your credentials and play.
 

K5DVT

Member
Feed Provider
Joined
Jun 1, 2014
Messages
45
Location
Woo Pig Sooieville
Yeah I guess what I should have said is that I did try reflashing and that didn't solve anything. That's why it looks like a hardware problem to me.
 

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Location
Milpitas, CA
Have you tried changing the USB sound card settings? Again, not familiar with this hardware but there is no way that hardware failure could possible cause a shift in frequency like that. There could be a problem with the usb's firmware settings. Is there anyway to change the usb sound card settings?
 

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Location
Milpitas, CA
This problem is almost always a problem with the mp3 encoder re-encoding at a different rate than the input audio so I still doubt that the sound card is the problem.
 
Last edited:

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Hey all, So I've got my Broadcastify feed up and going, but the audio sounds like it has been dragged out or slowed down. The only thing I can trace it to is the sound card as the aux cable I use is fine, as well as the scanner. It worked fine for a long time on the Windoze box, as well as when I went to the Pi. I'm going to try to switch sound cards, maybe that will fix it but TTD won't even detect the tones it's so dragged out. a 600 or so hertz tone was more like 200 hertz... which is why I believe it is the sound card and not the pi.

Maybe I'm wrong.

Any one else have this issue?

Can you post your darkice.cfg file?
 

K5DVT

Member
Feed Provider
Joined
Jun 1, 2014
Messages
45
Location
Woo Pig Sooieville
Sorry for the long reply. Here's my darkice config file.


# sample DarkIce configuration file, edit for your needs before using
# see the darkice.cfg man page for details

# this section describes general aspects of the live streaming session
[general]
duration = 0 # duration of encoding, in seconds. 0 means forever
bufferSecs = 5 # size of internal slip buffer, in seconds
reconnect = yes # reconnect to the server(s) if disconnected

# this section describes the audio input that will be streamed
[input]
device = hw:1,0 # OSS DSP soundcard device for the audio input
sampleRate = 22050 # sample rate in Hz. try 11025, 22050 or 44100
bitsPerSample = 16 # bits per sample. try 16
channel = 1 # channels. 1 = mono, 2 = stereo

# this section describes a streaming connection to an IceCast2 server
# there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7]
# these can be mixed with [icecast-x] and [shoutcast-x] sections
[icecast2-0]
bitrateMode = cbr # constant bit rate
bitrate = 16
format = mp3 # format of the stream: mp3
quality = .1 # quality of the stream sent to the server
lowpass = 3000 # low pass filter to save bandwidth
server = audioY.radioreference.com # host name of the server
port = 80 # 8000 port of the IceCast2 server, usually 8000
password = fubar # stream631 # source password to the IceCast2 server
mountPoint = fubar #EMR1 # mount point of this stream on the IceCast2 server
name = Madison County Fire Dispatch # name of the stream
description = # description of the stream
url = RadioReference.com - Scanner Frequencies and Radio Frequency Reference # URL related to the stream
genre = Public Safety # genre of the stream
public = yes # advertise this stream?
#localDumpFile = recording.mp3 # local dump file
#fileAddDate = yes
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Sorry for the long reply. Here's my darkice config file.


# sample DarkIce configuration file, edit for your needs before using
# see the darkice.cfg man page for details

# this section describes general aspects of the live streaming session
[general]
duration = 0 # duration of encoding, in seconds. 0 means forever
bufferSecs = 5 # size of internal slip buffer, in seconds
reconnect = yes # reconnect to the server(s) if disconnected

# this section describes the audio input that will be streamed
[input]
device = hw:1,0 # OSS DSP soundcard device for the audio input
sampleRate = 22050 # sample rate in Hz. try 11025, 22050 or 44100
bitsPerSample = 16 # bits per sample. try 16
channel = 1 # channels. 1 = mono, 2 = stereo

# this section describes a streaming connection to an IceCast2 server
# there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7]
# these can be mixed with [icecast-x] and [shoutcast-x] sections
[icecast2-0]
bitrateMode = cbr # constant bit rate
bitrate = 16
format = mp3 # format of the stream: mp3
quality = .1 # quality of the stream sent to the server
lowpass = 3000 # low pass filter to save bandwidth
server = audioY.radioreference.com # host name of the server
port = 80 # 8000 port of the IceCast2 server, usually 8000
password = fubar # stream631 # source password to the IceCast2 server
mountPoint = fubar #EMR1 # mount point of this stream on the IceCast2 server
name = Madison County Fire Dispatch # name of the stream
description = # description of the stream
url = RadioReference.com - Scanner Frequencies and Radio Frequency Reference # URL related to the stream
genre = Public Safety # genre of the stream
public = yes # advertise this stream?
#localDumpFile = recording.mp3 # local dump file
#fileAddDate = yes

Try making these changes in your [Input] section:

device = pulse # OSS DSP soundcard device for the audio input
sampleRate = 11025 # sample rate in Hz. try 11025, 22050 or 44


TTD requires pulseaudio to operate. So all sound is routed through pulse. It also converts to the 11025 sample rate. It works well even though the broadcastify preferred rate is 22050.
 

K5DVT

Member
Feed Provider
Joined
Jun 1, 2014
Messages
45
Location
Woo Pig Sooieville
Well I changed the config parameters like you gave me above and this was the error:


pi@twotonedetectv67 ~ $ sudo darkice
DarkIce 1.0 live audio streamer, Google Code Archive - Long-term storage for Google Code Project Hosting.
Copyright (c) 2000-2007, Tyrell Hungary, Tyrell Hungary Corporation
Copyright (c) 2008-2010, Akos Maroy and Rafael Diniz
This is free software, and you are welcome to redistribute it
under the terms of The GNU General Public License version 3 or
any later version.

Using config file: /etc/darkice.cfg
Using ALSA DSP input device: pulse
Using POSIX real-time scheduling, priority 98
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

DarkIce: DarkIce.cpp:1187: can't open connector [0]
pi@twotonedetectv67 ~ $



I remember now why I had it set to hw:1,0 was because it wouldn't start with pulse audio for some reason it seemed. However, one time when it reset at 3 am, it managed to get back on and streaming. I'm not very intelligent when it comes to Linux, but it seems that a setting such as that wouldn't keep it from starting.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Well I changed the config parameters like you gave me above and this was the error:


pi@twotonedetectv67 ~ $ sudo darkice
DarkIce 1.0 live audio streamer, Google Code Archive - Long-term storage for Google Code Project Hosting.
Copyright (c) 2000-2007, Tyrell Hungary, Tyrell Hungary Corporation
Copyright (c) 2008-2010, Akos Maroy and Rafael Diniz
This is free software, and you are welcome to redistribute it
under the terms of The GNU General Public License version 3 or
any later version.

Using config file: /etc/darkice.cfg
Using ALSA DSP input device: pulse
Using POSIX real-time scheduling, priority 98
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

DarkIce: DarkIce.cpp:1187: can't open connector [0]
pi@twotonedetectv67 ~ $



I remember now why I had it set to hw:1,0 was because it wouldn't start with pulse audio for some reason it seemed. However, one time when it reset at 3 am, it managed to get back on and streaming. I'm not very intelligent when it comes to Linux, but it seems that a setting such as that wouldn't keep it from starting.

What equipment and OS are you running? The most recent version of Raspbian (Stretch) does not include pulseaudio, you need to install it manually.

Another thing to try is using device = plughw:1,0
 

K5DVT

Member
Feed Provider
Joined
Jun 1, 2014
Messages
45
Location
Woo Pig Sooieville
Here's the error now. Still won't start =(


pi@twotonedetectv67 ~ $ sudo darkice
DarkIce 1.0 live audio streamer, Google Code Archive - Long-term storage for Google Code Project Hosting.
Copyright (c) 2000-2007, Tyrell Hungary, Tyrell Hungary Corporation
Copyright (c) 2008-2010, Akos Maroy and Rafael Diniz
This is free software, and you are welcome to redistribute it
under the terms of The GNU General Public License version 3 or
any later version.

Using config file: /etc/darkice.cfg
Using ALSA DSP input device: pulsehw:1,0
Using POSIX real-time scheduling, priority 98
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM pulsehw:1,0
DarkIce: DarkIce.cpp:1187: can't open connector [0]
pi@twotonedetectv67 ~ $
 
Status
Not open for further replies.
Top