[Icecast-dev] Problem in iPhone streaming

Romain Beauxis toots at rastageeks.org
Thu Nov 13 02:45:24 PST 2008


Le Thursday 13 November 2008 10:08:19 Pavol Grešša, vous avez écrit :
> Hi,

	Hi !

> i'm developing an internet radio client for iPhone and as server is  
> used Icecast2. My problem is that every time when client connects to  
> some source(mount) Icecast2 sends correct HTTP 1.0 header and after  
> header delimiter(two empty lines(\r\n\r\n))  should be data ( mp3  
> samples). But every time in the first packet in the beginnig of data  
> section there are some bytes to which iPhone audio parser cannot  
> undestand( Becasue every mp3 sample starts with mp3 header (0xFFF) ).  
> This happens only to first packet. I'm sure of that, because i have  
> stream in what i'm sure that raw sound data begins with prefix 0xFFF3  
> and every time when i parse whole data in first packet and get only  
> those mp3 sample, stream will became stable and iPhone is playing that  
> radio for rest of time without any parsing.
>
>   I'm debugging icecast source code for 2 days and i still did'n find  
> function or procedure or whatever is it, where in start of client  
> streaming icecast2 push in the begining , right after header, these  
> bytes, which have everytime different lenght. I don't really know what  
> is it.
>
> So please , can you help me locate source of this problem?

Icecast doesn't do any modification on the streamed data in mp3, as far as I 
know, so you'll only get the stream at its current position, be it a mp3 
header or not..

mp3 data may have a lot of garbage at its beginning, like id3 tags, LAME 
headers and so on..

Also, ICY metadata update, if you enabled it, will add metadata information at 
a regular byte rate, so you also have to seperate these data from the audio 
data.

Hence, you should code an interface with the iPhone audio decoder that 
collects only audio data and send only this data to the decoder, starting 
with the first mp3 header it encounters..


Romain



More information about the Icecast-dev mailing list