All times are UTC+01:00




Post new topic  Reply to topic  [ 14 posts ]  Go to page 1 2 Next
Author Message
 Post subject: Adding RDS to stream
PostPosted: Sun Feb 12, 2017 9:21 pm 

Joined: Sun Feb 12, 2017 9:13 pm
Posts: 11
Hello,

I am trying to add RDS and FM processing (MPX) to an existing MP3 stream coming from our icecast server.

My plan is to pipe into stereotool command line, then stream back to icecast server (as ogg-flac?)... We can then have a Raspberry Pi just playing this MPX ogg-flac stream from our icecast server, and no problems with CPU causing stuttering at our transmission point (Obviously using a 192khz sound card).

Just having a bit of trouble constructing the command to do this - Any pointers would be appreciated!

If I do the following, then run 'mplayer -inspect out.wav', out.wav looks like a 44.1khz file

mpg123 -w - http://icecast:8000/main320 | stereo_tool_cmd_64 - out.wav -s fm.sts


Top
   
 Post subject: Re: Adding RDS to stream
PostPosted: Mon Feb 13, 2017 4:08 pm 
Site Admin
User avatar

Joined: Mon Mar 17, 2008 1:40 am
Posts: 11185
I would guess that this would kinda work, but Stereo Tool isn't going to give you stereo/rds this way. And, the file will quickly get big causing the disk to get full.

You should add some command to upsample it to 192 kHz and then pipe it into Stereo Tool, and from there into a player such as aplay.

Note: I want to (soon, but I don't know how soon) release a Linux version without GUI but with sound card support, including non-Jack support. That will make this a whole lot easier.


Top
   
 Post subject: Re: Adding RDS to stream
PostPosted: Sun Mar 12, 2017 8:21 pm 

Joined: Sun Feb 12, 2017 9:13 pm
Posts: 11
Trying to get this working with LiquidSoap now (new to me but pretty neat!)

My flow now goes

1) Icecast (320kbps MP3) --> liquidsoap (output to named pipe)
2) Stereotool reading from named pipe, and outputs to anther named pipe...
3) liquidsoap reading from named pipe and streaming via ogg/flac to icecast @ 192KHz

So I guess that the named pipe going into ST will only be 44KHz - Will this cause problems with sending out the MPX/RDS from stereotool? i.e. Will ST do the upsampling ok, or just send out at 44KHz?

Feel like I'm close with this, but just one broken link in the chain!!!

This guy is doing it perfectly... http://5.35.250.101:8000/radio700-mpx.flac - If i play that straight into my exciter, RDS is all there - so it has to be possible!!! :)


Top
   
 Post subject: Re: Adding RDS to stream
PostPosted: Mon Mar 13, 2017 5:22 pm 

Joined: Tue Nov 03, 2015 10:46 am
Posts: 8
The German technician done it !
It's a 176Khz, 2,3Mbit uncompressed (flac) mono stream, perfect MPX signal with RDS...!
I tested the stream with MpxTool and looks beautiful !


Top
   
 Post subject: Re: Adding RDS to stream
PostPosted: Tue Mar 14, 2017 11:10 am 
Site Admin
User avatar

Joined: Mon Mar 17, 2008 1:40 am
Posts: 11185
Well you can of course stream MPX in Flac - that't not the issue. The issue is how you get the MPX signal this way, the problem is that the Stereo Tool command line version won't upsample - so far you're the first person who asks for this... You can make it work but you need to put something before Stereo Tool that does the upsampling, OR use the normal version of Stereo Tool that outputs to a sound card (which can be Jack).


Top
   
 Post subject: Re: Adding RDS to stream
PostPosted: Tue Mar 14, 2017 12:30 pm 

Joined: Sun Feb 12, 2017 9:13 pm
Posts: 11
Ah, ok. This makes sense and certainly gives me something to focus on!

Does command line Stereo tool show anywhere what sample rate it is recieving to help with my debugging? I'm using -V but can't see anything!

Thanks


Top
   
 Post subject: Re: Adding RDS to stream
PostPosted: Tue Mar 14, 2017 9:17 pm 

Joined: Mon Jan 21, 2013 3:01 pm
Posts: 126
Quote:
The German technician done it !
It's a 176Khz, 2,3Mbit uncompressed (flac) mono stream, perfect MPX signal with RDS...!
I tested the stream with MpxTool and looks beautiful !
Do you use software to create this FLAC stream? If yes, which software is this?
Thanks.


Top
   
 Post subject: Re: Adding RDS to stream
PostPosted: Tue Mar 14, 2017 9:44 pm 

Joined: Sun Feb 12, 2017 9:13 pm
Posts: 11
OK, I tried to simplify things to determine where my problem is. As mentioned, stream MPX with flac should not be an issue, so I will leave that for now.

As command line stereo tool will not resample, I created a test file to test with using Audacity...
Input file: 192kHz, WAV/PCM (S16 LE), Stereo, 16-bits per sample.

I then ran the command './stereo_tool_cmd_64 input.wav output.wav -s fm.sts -V'
It runs and processes the file, I see the ascii VU meters moving about... Feeling good so far!

I then take the out.wav and load into MPXTool to analyze (It complains that it is a stereo file, so i load out.wav into Audacity, split to mono tracks, then remove one of them, and save it again...(Is this ok?) MPX tool will now look at my (hopefully MPX output file)...

Well, the output is not what I would expect!!! Pilot clearly missing :( My sts file came from working DSP stereotool on windows... I guess/hope commandline ignores mentions of windows sound devices in there as I did just spot a mention!

Image


@Edgar, My final aim here is to take a stream from our studio, do all stereotool processing and RDS/MPX, then have this available on myicecast server, so that my only actual audio output is a raspberry pi at my transmitter point! To create flac stream I plan to use liquidsoap with %ogg(%flac,...) etc. Once I get it working, I will make a clear guide on how to do it!! (I sent a pm to Radio700 to see if they will offer a little more assistance with how they are doing it!)


Top
   
 Post subject: Re: Adding RDS to stream
PostPosted: Thu Mar 16, 2017 1:41 pm 
Site Admin
User avatar

Joined: Mon Mar 17, 2008 1:40 am
Posts: 11185
Stereo Tool ignores the .wav header - if you are feeding it 192 kHz audio you have to tell it that. (Sorry.. I need to fix that at some point). I should probably reuse Mathijs' WatchCat code that already reads and writes all kinds of formats).

For now, use the -r (or --samplerate) option to set it. Without that it will currently ALWAYS assume 44.1 input. So in your case, add -r 192000


Top
   
 Post subject: Re: Adding RDS to stream
PostPosted: Fri Mar 17, 2017 9:57 am 

Joined: Sun Feb 12, 2017 9:13 pm
Posts: 11
Thanks for this... I did try specifying the sample-rate via -r last night as advised, but the output wav generated appears to cut off above 22kHz according to MPXTool.

I did try using an inbuilt preset with -p just incase my sts file is the issue, I used FM-Radio-Europe-50 // Ibiza FM and others, which looks to have RDS stereo encoding enabled (Well, it did when I checked on the standalone version of stereotool), so I would expect to see the pilot tone at 19kHz?

Some questions:

1) Is my method of testing correct/logical? i.e. 192khz/stereo/16-bit WAV -> steretoool -> 192khz wav with all the RDS and MPX in a file?
2) MPX is mono... I presume stereotool outputs a stereo file with same MPX output on both channels?
3) Are all features of Stereotool enabling int the linux command line version? i.e. I should be able to operate as FM transmitter with RDS and stereo encoding as MPX?

As a side-note, my test WAV was originally a 44kHz MP3, which I re sampled to a 192kHz file using audacity. I shouldn't think this would be an issue, but just outlining my method in case that is where the problem lies.

Can anyone else replicate my problem? I have uploaded my input file and sts files at http://gef.org.uk/img/st-issues.zip. The command I am using now is:

./stereo_tool_cmd_64 -V new-stereo-test.wav out.wav -r 192000 -s fm.sts
and
./stereo_tool_cmd_64 -p "FM RADIO STATIONS - EUROPE/Bojcha - Ibiza FM" new-stereo-test.wav out.wav -V -r 192000

(all files are in my current working directory)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 14 posts ]  Go to page 1 2 Next

All times are UTC+01:00


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited