Menu

http streaming

2006-04-23
2013-04-25
  • Tomas Vanek

    Tomas Vanek - 2006-04-23

    Hi developers

    I've investigated possibility of playing http streams (e.g. icecast) on my P900.
    I haven't found more than couple of payed apps for listening net radio broadcast (presumably with hardwired lists of url)

    My idea is to replace limited space for music on mem stick duo card (max 128MB on P900).
    I have wireless router (OpenWrt) with HDD and Bluetooth dongle connected. So at home I can access all my music collection (>30GB) as http streams from web server of my router. And whole internet over ADSL as well.
    The only thing I miss is a player with reasonable user interface to select and play desired url.

    Naturally OggPlay was the first candidate to play with as it's good and open source - huge thanks to all developers!
    After some tinkering to compile again UIQ version from current cvs I made some changes:
    - m3u parser accepts url
    - COggPlayback::Open() can contact http server, skip headers and pass socket to decoder
    (I deliberately avoided using symbian http client api for the beginning)
    - ogg decoder can read source from prepared socket
    A big surprise: it really works even without any modifications to buffering scheme and without enlarging buffers.
    I tested 80 and 112kbps ogg streams served from file at router. It works on P900 phone connected thru BT (gnubox used)and also on wins emulator. I also tested 30 and 60kbps live radio ogg streams from internet thru BT and ADSL. I also managed
    get live radio over GPRS. As expected all but local 80kbps streams have some drop-outs at beginning - playback should wait for buffering enough to overcome network latency. Sounds as quite promising "technology preview".
    Of course there is lot TODOs: error handling, synchronization for live streams, getting attributes from icecast headers etc...

    Please let me know if you want such extension to OggPlay.

    My blocker problem is now mp3. I know that ogg vorbis is better, but I don't want to duplicate all music files in second format as I need mp3 as source for mp3 hw player. P900 has no MMF. I noticed #ifdef PLUGIN_SYSTEM for pre MMF SOS 6.1
    and 2 years ago abandoned mad decoder in source code. Can someone estimate the amount of work left to get mp3 working on UIQ as a MMF-like plugin? Maybe buing new phone with MMF is much easier - but I'm afraid of new "security" enhancements of symbian (like withrawing MMF from SDK...).

     
    • Stuart Fisher

      Stuart Fisher - 2006-04-23

      Hi Tom,

      Absolutely we want this in OggPlay!

      Some background:
      You are the first developer to do any work on the P900 UIQ code for 2-3 years or so. The PLUGIN_SYSTEM and MP3 support was abandoned about the same time. None of it works at all now, it won't even compile. That's not to say that it didn't work at some point, just that the person doing it (Pascal) didn't get around to checking in a working version :-(

      I'm not sure how recently you grabbed the "current CVS". I've been making changes to the build process and also to the code that may hinder your efforts to get an MP3 decoder working. I even removed the MP3 files from the MMP file, presuming that they were never going to be used again! You can't add #defines to the MMP files anymore (Carbide limitation) so you have to add #defines to the platform file instead (in your case OggUIQSony.h) and build from groupUIQSony. You know this already though?

      The main issue for building MAD is that I've removed libc completely from the build because of issues with Carbide and S60 V3. Please don't put it back in, it took me ages to get rid of it! It shouldn't be a big deal anyway as we now implement most of the essential libc functions ourselves (see vorbis\Symbian.cpp). You could just put it back in for the MAD dll if you need libc functions we don't currently have, but I'd be happier if we didn't use libc at all.

      I think you have three options:
      1. Buy a new V3 phone.
      Advantages:
      V3 phones will have 3G and Wi-fi so they are much better suited for http streaming

      Disadvantages: OggPlay hasn't been ported to S60V3 yet, although I've made a start. Porting OggPlay to UIQ3 requires even more work and there are no UIQ3 phones available at the moment (the UIQ3 Walkman phone, for example, isn't due until Q3 2006).

      2. Buy an S60 V2 phone! Then you'd get an MP3 plugin, but I don't know if S60V2 MMF plugins support http streaming. To be honest I don't even know if V3 ones do.

      3. Get the Mad plugin working on the P900.
      This would be my choice. I don't think it's a huge amount of work. There are two approaches you can take:

      i. Convert the OggVorbis dll and the Mad MP3 dll to use the PLUGIN_SYSTEM API. Then change the main OggPlay code to always use the plugin adaptor instead of the OggTremor class. This could be really fiddly because the plugin system and mmf codes (MMF_AVAILABLE and OS70S) are all mixed together in weird and wonderful ways!
      In this case #define MP3_SUPPORT and PLUGIN_SYSTEM.

      2. Make the Mad MP3 dll export the same functions as the OggVorbis dll. The non-MMF version already has a kind of plugin system already (called "MDecoder", it's essentially a C-->C++ interface) so you could just use that. This will be less work to get mp3 working on it's own (convert OggPlay into MP3Play) but then you'll have to do some work to get both dlls working at the same time. The file you want to look at is vorbis\TremorDecoder.cpp and also src\OggTremor.cpp. In this case you want to #define MP3_SUPPORT but not PLUGIN_SYSTEM

      Personally I'd forget about MMF plugins and the PLUGIN_SYSTEM and stick with your P900, but we should probably discuss this further. You also need to send Leif an email and get signed up as a developer!

      Regards,
      Stuart

      P.S. I've just looked in the Mad code and I can see that Pascal has written the MadDecoder / MDecoder interface (mad\src\MadDecoder.cpp) so I'd definitely try this out first and forget about the PLUGIN_SYSYEM

       
      • Tomas Vanek

        Tomas Vanek - 2006-04-23

        Hi Stuart,

        many thanks for your comprehensive info. I've already grasped some basic orientation in the project, however I'm really happy having a cookbook to consult in the case I loose the right way.

        Some comments:

        > 3. Get the Mad plugin working on the P900.

        Yes, this was also my choice. Unfortunately in the meantime I tested ogg streams of bigger bitrates (average 160, 192 and 240kbps). And results was not as promising as with low bitrates - even 160 got drop-outs and maximal distance of BT dongle was about 2 meters. Bigger rates have problems even with phone close to BT dongle. I should make some test to find out where the bottleneck is - BT bandwith (I expect the real bandwith is substantialy lower than theoretical 723kbps) or processor load. I'd bet that 156MHz ARM has not enough power to encode ogg and concurrently feed audio out and keep BT and ppp/tcp/ip stacks going. As my music collection contains mainly vbr mp3 with max bitrate limit 224kbps it seems like the only way to stream it to phone is to make lower bitrate duplicates (or get the phone with WLAN). In the case of duplicating music source I can use ogg format with no problem. So the question is to be or not to be (mp3 capable).

        > i. Convert the OggVorbis dll and the Mad MP3 dll to use the PLUGIN_SYSTEM API.

        My idea was if we get PLUGIN_SYSTEM working on UIQ we can get rid of most of old dll code and it will be easier to keep development of all #ifdef branches up to date. http source in OggTremor.cpp couldn't be used by MMF version. Maybe I was too optimistic: S60 V3 shows that non MMF version may have use in future.
        And I have no idea what surprises are in UIQ V3 (coming P990).

        > In this case #define MP3_SUPPORT and PLUGIN_SYSTEM.

        I've already tried to compile with #define PLUGIN_SYSTEM and find out that OggAbsPlayback.h needs definition of CMMFFormatImplementationInformation class which is nowhere in UIQ sdk. I'd appreciate if you can send me a appropriate header(s) (MdaAudioSampleEditor.h?) to vanekt<at-domain>volny(dot)cz (I'm not too eager to download and install megabytes of nokia SDK to get one header file). Maybe there is more classes needed from MMF. They probably compiled non-MMF versions on MMF sdk, didn't they?
        >
        > 2. Make the Mad MP3 dll export the same functions as the OggVorbis dll.
        > P.S. I've just looked in the Mad code and I can see that Pascal has written
        > the MadDecoder / MDecoder interface (mad\src\MadDecoder.cpp) so I'd definitely
        > try this out first and forget about the PLUGIN_SYSYEM
        Yes, this is definitively easiest way to mp3 on p900. But it will complicate things if http source should be available generally.

        Cheers
            Tom

         
    • Alex Kanavin

      Alex Kanavin - 2006-04-24

      Hi folks,

      Nokia has just released the reference implementation of HTTP Internet Radio streaming (Shoutcast) for S60 3rd Edition, under BSD license. I think it would be better to integrate that into OggPlay, rather than write it ourselves. Check it out:
      http://opensource.nokia.com/projects/s60internetradio/index.html

      I hope to get a S60v3 phone soon, then I plan to
      a) port oggplay to the platform
      b) add shoutcast support, based on Nokia implementation

      But of course Tom can do it first :)

      Alex

       
    • Tomas Vanek

      Tomas Vanek - 2006-05-24

      An experimental version of OggPlay with http streaming support compiled for UIQ and tested on SE P900 (should work also on P800 and P910) is here:

      http://www.volny.cz/vanekt/OggPlay.p900.SIS (190kB)

      Just make a m3u list with url addresses, send it to the phone and play.
      Both ogg and mp3 formats are decoded.

      Comments welcomed.

      Enjoy
            Tom

       
      • Joel Lehtonen

        Joel Lehtonen - 2006-05-28

        I tried your SIS-file with my P800. I have a m3u file downloaded directly from my Icecast server. It contains only one line (just the URL) and works with mplayer, for an example.

        At Oggplay the playlist can be found from the playlist menu item, but it is just like an empty directory. I can find the m3u file also from menu item "files" but when I click it Symbian kills oggplay _instantly_ with the following error message: USER error number 130.

        Your version plays ogg-files perfectly and the player plays files correctly. The playlist contains URL to an Ogg Vorbis stream. I use GPRS connection.

        By the way, where's the source?

         
        • Tomas Vanek

          Tomas Vanek - 2006-05-28

          Hmm, strange. Can you quote the m3u file? Is the target url publicly accessible?

          The only API needed for validating urls in m3u is TUriParser class. Look to HttpSource.cpp function COggHttpSource::IsNameValid().

          From Symbian doc:
          Panic USER 130 is raised when an index value passed to a member function of a RArray or a RPointerArray identifying an array element, is out of bounds.

          The panic is probably caused by accessing first element of zero length playlist (you said the playlist is displayed as empty).

          Up-to-date source is http-streaming-branch in cvs.

          Tom

           
          • Joel Lehtonen

            Joel Lehtonen - 2006-05-29

            I'll keep my icecast server running for couple of days for testing purposes. It broadcasts a public radio station from Finland :-)

            http://zouppen.iki.fi:8000/

            I also tried playlists exported from xmms but in my phone the playlist is empty like the one from this icecast server. Playlist from kohina.com is not working either.

            I'm very interested about http streaming capability and i've needed it for years. In Finland we have quite reasonable GPRS rates.

            I think the problem is with my P800. My software version is CXC162002 R2F.

             
            • Tomas Vanek

              Tomas Vanek - 2006-05-29

              Hi,
              I pointed my p900's web browser to your icecast and downloaded m3u. After "Find new files" the m3u appeared in playlists and is not empty. Now I'm listening Finnish radio from my phone (good blues is playing now but poor sound quality at 16kbps).
              So the problem is definitely in using an API not implemented (or not functional) on P800. Try eliminate using TUriParser class.

              Tom

               
              • Joel Lehtonen

                Joel Lehtonen - 2006-05-29

                I have no development tools for UIQ on my computer (yet) and my knowledge of Symbian is quite limited. So I need precompiled binary (.sis) for testing. I'd be very happy to see this thing working with my phone!

                It's annoying that APIs and implementations differ this way. :(

                 

Log in to post a comment.