Old 17th November 2016, 19:42   #1
dexter
Junior Member
 
Join Date: Nov 2016
Posts: 4
How to Stream using darkice?

Hello All,

I am trying to broadcast my stream to shoutcast server using darkice software. I'm getting connection error. Did anyone here ever tried the same setup? Also I'm not sure where to configure the Stream ID in the darkice.cfg. Thanks for your help!
dexter is offline   Reply With Quote
Old 17th November 2016, 21:43   #2
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
darkice doesn't support DNASv2 - you need to enable legacy source compatibility in DNAS config - be aware that legacy source connects on portbase + 1

Is it just me or are shoutcast users getting dumber?
jaromanda is offline   Reply With Quote
Old 17th November 2016, 22:51   #3
dexter
Junior Member
 
Join Date: Nov 2016
Posts: 4
Hi, Below are the configurations that shoutcast RMO panel ask me to configure in my encoder. PFB

code:
In your automation software or dedicated encoder, select "SHOUTcast" (version 2, if available)

Your streaming server URL is "master.shoutcast.com"

Your port is "8000"

Your Stream ID is "790xxx"

Your stream password is your RMO password




Below is my darkice configuration file

code:
[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:Loopback,1,1
#device = hw:0,0 # OSS DSP soundcard device for the audio input
sampleRate = 44100
bitsPerSample = 16 # bits per sample. try 16
channel = 2 # channels. 1 = mono, 2 = stereo

[shoutcast-0]
format = mp3
bitrateMode = cbr
bitrate = 128
quality = 0.8
server = master.shoutcast.com
#mountPoint =
port = 8001
password = mypassword:#790xxx
name = 24/7 Radio
description = Radio Broadcast
url = http:www.shoutcast.com
genre = Spiritual
public = yes




Below is the error log when I start darkice.


code:
Using config file: /etc/darkice3.cfg
17-Nov-2016 18:30:19 Using ALSA DSP input device: hw:Loopback,1,1
17-Nov-2016 18:30:19 buffer size: 882000
17-Nov-2016 18:30:19 encoding
17-Nov-2016 18:30:19 scheduler high priority 99
17-Nov-2016 18:30:19 Using POSIX real-time scheduling, priority 4
17-Nov-2016 18:30:20 server response length: 18
17-Nov-2016 18:30:20 server response: Invalid Password

DarkIce: LameLibEncoder.cpp:75: lame lib opening underlying sink error [0]




Please let me know if I am missing anything. Thanks for your time!!
dexter is offline   Reply With Quote
Old 18th November 2016, 01:35   #4
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
Quote:
server response: Invalid Password
so it's a password issue

Is it just me or are shoutcast users getting dumber?
jaromanda is offline   Reply With Quote
Old 18th November 2016, 04:46   #5
dexter
Junior Member
 
Join Date: Nov 2016
Posts: 4
Hi,

My password is correct. After some research, looks like an issue with the darkice software. Its actually ignoring the 'Stream ID' in the password field after the '#' (Since stream ID is placed after '#' I think darkice treats it as a comment)


I just debugged the TCP packets sent from winamp and darkice.

From winamp
Quote:
mypassword:#790xxx
OK2
icy-caps:11

icy-name: Radio Broadcast
icy-genre:Spiritual
icy-url:http://www.shoutcast.com
icy-irc:N/A
icy-icq:0
icy-aim:N/A
icy-pub:1
icy-br:128
content-type:audio/mpeg

.........i......
.......... ..4....LAME3.99.5
Packet from darkice
Quote:
mypassword:
Invalid Password

Below is my darkice version in my raspberrypi


Quote:
pi@raspberrypi:~ $ darkice
DarkIce 1.2 live audio streamer, http://code.google.com/p/darkice/
Copyright (c) 2000-2007, Tyrell Hungary, http://tyrell.hu/
Copyright (c) 2008-2013, 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
DarkIce: DarkIce.cpp:155: no section [general] in config [0]
pi@raspberrypi:~ $

Any help / pointers are appreciated. Thanks!
dexter is offline   Reply With Quote
Old 18th November 2016, 22:59   #6
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
so, it's a password issue after all, just not an obvious one -

I see you've posted a bug on the github page for darkice

did you notice the same bug reported on 13th May 2015 - which was copied from a google code bug from 5th June 2013. Author was made aware of this exact bug over 3 years ago and has done exactly nothing about it

It'd be quicker to learn "C" and fix the bug yourself

It's just a matter of a little smart logic on this line of code - https://github.com/rafael2k/darkice/...ction.cpp#L137


There's a fork - https://github.com/jonlambert/darkice - which simply looks for ## instead of # as a comment - but that is a really poor solution because you'd have to change all your actual comments in the config

Is it just me or are shoutcast users getting dumber?
jaromanda is offline   Reply With Quote
Old 19th November 2016, 06:07   #7
dexter
Junior Member
 
Join Date: Nov 2016
Posts: 4
Thanks for the details Jaromanda!! Really appreciate it.

Added a small logic to ignore special characters check for 'password' field.

Below are the code changes and now its working as expected!! Yey


File: DarkIceConfig.cpp
code:
std::string str2 ("password");
if ( (ix = str.find(str2)) == str.npos ) {
/* delete everything after the first # */
if ( (ix = str.find( '#')) != str.npos ) {
str.erase( ix);
}
}




File: ConfigSection.cpp

code:
std::string str2 ("password");
if ( (ix = str.find(str2)) == str.npos ) {
/* delete everything after the first # */
if ( (ix = str.find( '#')) != str.npos ) {
str.erase( ix);
}
}




Darkice TCP Packets after fix:


Quote:
mypassword:#790xxx
OK2
icy-caps:11
icy-name: Radio Broadcast
icy-url:http:www.shoutcast.com
icy-genre:Spiritual
icy-br:128
icy-pub:1
...D...................................................................................................................................................................................................................................................... ..........................................................................................................................................................................d`].....i......
.......... ..4....LAME3.99.5

Thanks a lot for your time and support!!
dexter is offline   Reply With Quote
Old 20th November 2016, 01:44   #8
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
I went at the problem a little differently

code:
std::string::size_type ix;
std::string::size_type ixEquals;
std::string str( line);

/* delete everything after the first # */
ix = str.find('#');
if (ix != str.npos) {
if (ix == 0) {
// '#' in first position, use old logic
str.erase( ix);
}
else {
ixEquals = str.find('=');
if (ixEquals != str.npos) {
if (ix < ixEquals) {
// '#' before '=', use old logic
str.erase( ix);
}
else {
// when '#' is after '=' MUST be preceded by a space to be considered a comment
ix = str.find(" #");
if (ix != str.npos && ix > ixEquals) {
str.erase(ix);
}
}
}
else {
// no '=' so back to old logic
str.erase( ix);
}
}
}


Is it just me or are shoutcast users getting dumber?
jaromanda is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > SHOUTcast > SHOUTcast Technical Support

Tags
darkice, raspberrypi, shoutcast, streaming

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

Forum Jump