High-Quality Sound Streaming – A Summary

CESNET technical report 28/2010

Miloš Wimmer

Received 2. 12. 2010

Other formats: PDF, EPUB

Abstract

This report sums up the development and operation of a streaming system we use to deliver live broadcasts of Czech Radio stations over the Internet. It discusses major goals addressed by the project throughout its duration. The essential concept of our streaming system involves processing and broadcasting audio streams compressed by Ogg Vorbis and FLAC compression formats. We have designed and implemented a universal streaming audio transcoder capable of receiving loss-less FLAC streams and generating multiple output streams with different formats and bitrates. We have also experimented with streaming multi-channel audio. We have always relied on free formats and software products available in Linux.

Keywords: high-quality audio, streaming, broadcasting, Ogg Vorbis, FLAC

1  Developing the System

The project started with an agreement between CESNET and the Czech Radio, who decided to co-operate in designing an experimental system capable of broadcasting Czech Radio's programs live at high-quality over the internet. Before then, Czech Radio was distributing the signals of its most popular stations at 10–32 kb/s using Real Audio and Windows Media technologies. Obviously, this provided only poor quality sound.

A new system was designed and implemented within CESNET's long-term research plan to enable uninterrupted high-quality Internet broadcasts. Following and experimental phase, the system entered production and has now been in use, subject continuous improvement, for several years.

Essential requirements for the system were as follows:

These requirements were reflected in actual technology solutions we were considering. Early versions of our system were relying solely on free software, adopting the Ogg Vorbis compression format, ogg stream producers and Icecast streaming servers.

Ogg Vorbis compression was, at that point, fresh and – compared to MP3 – almost unknown and rarely used for streaming. On the other hand it gave better results and there were no patents and licenses pending on it. That was why we have chosen it as the core of our streaming system.

Even the early designs [1] were separated into two distinguished parts – a producer of streams generated from input audio signals and a streaming server distributing the streams among end user clients. This separation gives us a wider choice of applications for any of the to parts, provides for very good scalability of the system and makes it easier to achieve fault tolerance.

The first implementation of the system used two physical servers. The encoding server had several audio adapters receiving the output from FM tuners tuned to receive the signal of Czech Radio channels ČRo1-Radiožurnál, ČRo2-Praha and Čro3-Vltava. Ogg Vorbis streams at 128 kb/s and 256 kb/s were generated and transported to a streaming server by the Darkice application. Distribution was done by the Icecast application server.

We were able to achieve better quality later by tapping to another source of input signal. Analog tuners were replaced by a DVB-S adapter and we were receiving Czech Radio signal directly from Eurobird 1 [2] via a satellite link. Compared to FM tuners the resulting sound was clearer, provided more detail and more thorough separation of audio channels.

Changing the input signal source lead to necessary changes in stream production. With satellite broadcasts, one needs to process the signal of multiple radio stations at once. That was why we had to employ a vls application server capable of receiving all channels within the given packet (Czechlink in our case), separating them and – maintaining the MPEG-TS format – forwarding them further for processing. Individual MPEG-TS streams were transcoded to Ogg Vorbis by a combination of vlc and Ices2 running on the same encoding server. Ices2 was used at the same time to transport the resulting streams to the streaming server.

There were problems with continuously growing latency of ices2 encoders when running for a long time. That was why we have decided to insert an oggenc encoder between vlc and ices2 and use that to produce Ogg Vorbis streams instead.

As the time went, new applications emerged and we tested new approaches, which allowed us to replace the vls application server in its stream receiver role with getstream, which is more stable and consumes fewer system resources. The task of generating Ogg Vorbis streams was re-assigned to an internal encoder of the improved vlc, and the producer once again consisted of vlc and ices2. Vlc receives MPEG-TS streams from source, transcodes them to Ogg Vorbis and forwards them to ices2 which, in turn, delivers them to the streaming server. This setup allowed us to achieve minimum latency that never increases and automated reconnection by the producer to the streaming server in case of service interruptions or network outages.

We are now streaming additional Czech Radio stations, too; namely D-dur, Rádio Česko, Leonardo and Radio Wave.

2  Improving the Fault Tolerance of the Streaming System

Transmission of high-quality digital audio signal does not emphasize just sound quality but fault tolerance as well. We have achieved high reliability by minimizing the number of encoding and streaming server components, making individual components of the system more robust, and employing intelligent software (see [3] and [4].

As far as the source of the input signal is concerned, we have achieved improved reliability by employing three independent solutions: digital satellite broadcast (DVB-S), digital terrestrial broadcasts (DVB-T) and low-bitrate backup streams provided by Czech radio.

In producers – encoding servers – better reliability is achieved by making them redundant and positioning them in various geographic locations with each of them forwarding its output Ogg Vorbis streams to two independent streaming servers. The encoding servers also run a control tool to monitor the encoding process and restart the whole production chain for the affected stream in case of any trouble. Our streaming servers are configured to use so-called fallbacks, allowing a streaming server to detect an interrupted stream and switch all active users to a backup stream without having to reconnect.

Improved reliability of streaming servers is also achieved by redundancy, by using different locations, and by connecting them to a shared virtual LVS cluster, which makes them available to clients under a single IP address corresponding with DNS name radio.cesnet.cz. End user clients are required to connect to that address. As soon as a streaming server loses connectivity or interrupts streaming, it is removed from the pool and the load switches automatically to the other server. The affected server is reconnected to the LVS cluster only after it came back up.

The whole system, then, consists of three encoding servers and two streaming servers. It can handle simultaneous failures of two producers and one streaming server. The emergency response as well as the subsequent restoration of the system are automated and do not require human intervention.

3  Streaming with Loss-Less FLAC Compression Encoding

Greater availability of high-speed Internet connections made streaming in loss-less formats more relevant. Loss-less compression formats ensure that the audio signal is not modified in any way throughout its distribution from the producer to the end-user's client. It is an experimental technology, not yet used in production, but it has a great potential. That is why we have extended our streaming system to support the loss-less FLAC format [5].

To achieve maximum quality of the audio stream we have connected the encoding server directly to the ADAT output of the dispatch system at Czech Radio's D-dur station. The ADAT digital output is in no way affected by lossy compression. The addcastv3 application is used to generate a FLAC stream at 500 kb/s, store it the Ogg transport container and forward it to an Icecast application streaming server, running locally on the same hardware. The finalized stream is then received by a production streaming server. We have decided for this design since – unlike the ices2 producer used to generate Ogg Vorbis streams – the oddcastv3 encoder does not support automated reconnection to the target streaming server upon upon link failure. Opposed to that, Icecast servers feature a very reliable reconnection function. As an added bonus, the resulting FLAC stream can also be received by other clients within Czech Radio's network for further processing.

Contemporary audio players are usually able to play static FLAC files but there are just a few clients that can play FLAC streams. According to our experience, the best among them are free clients foobar2000 and vlc.

The loss-less FLAC stream carrying the signal of Czech Radio's D-dur station is available from CESNET's streaming server radio.cesnet.cz. It gives the listeners a rare chance to listen to sound at maximum quality, identical to that produced by Czech Radio's dispatch system. It represents a significant improvement in quality even compared to DVB-S and DVB-T digital broadcasts since it eliminates lossy compression altogether from the whole delivery chain.

[Image]

Figure 1. Streaming System Topology

4  Universal Audio Streaming Transcoder from FLAC to Other Formats

Our experience with generating FLAC streams has inspired us to design and implement a universal transcoder that could receive a loss-less FLAC stream in real time, decode the original PCM signal and use that to produce streams in different formats and bitrates [6]. Those could be made available to streaming servers or end-user clients.

We have succeeded in implementing an open modular system whose individual components are easy to combine or replace with others. This comes as an advantage namely in output stream producers, which do not depend on a single encoding application anymore, and which can now employ a whole range of applications to generate an output stream with required parameters. The whole transcoder relies exclusively on free technologies.

We have successfully tested transcoders designed for minimum latency as well as those designed for maximum reliability. An encoding server transcoding six input FLAC streams into fourteen output Ogg Vorbis and MP3 streams had no performance issues and there were no outages or defects in the output streams.

5  Conclusion

Being – at first – just a free-software-based experimental streaming system relying on the relatively unknown Ogg Vorbis encoding format, our solution has proved its qualities over the years and its output streams are advertised on Czech Radio's live streaming web page as top quality broadcasts. At peak load the system can serve over 1,000 concurrent listeners. The redundancy-oriented design of all its components makes it highly fault-tolerant. Extending the portfolio of its services with a loss-less FLAC stream presented listeners with a unique chance to receive sound at reference quality. The streaming system makes its services available over IPv4 and Ipv6.

The streaming system outlined in this Report can process and transmit sound in a quality very close to the original, relying on streams encoded by Ogg Vorbis at 128 or 256 kb/s, or even in the original quality by employing the lossless FLAC encoder to produce transport streams. The resulting quality of the stream decoded on the client side depends, quite naturally, on the quality of the user's audio equipment. It is up to any user to visit Czech Radio's Live Broadcast Web page to compare the qualities of individual streams produced by various encoders at various bitrates and to judge their relative benefits.

6  Acknowledgment

This work has been carried out in cooperation by Cesnet z.s.p.o., Multimedia transmissions and collaborative environments group and the Czech Radio.

References

[1] WIMMER, M. Vysílání a přenos audio signálu ve velmi vysoké kvalitě do sítě Internet. [In Czech: Streaming and Transmitting High-Quality Audio Signal to the Internet.] Technical report 24/2003, Praha: CESNET, 2003.
[2] WIMMER, M. Vysílání a přenos audio signálu ve velmi vysoké kvalitě do sítě Internet – rozvoj projektu. [In Czech: Streaming and Transmitting High-Quality Audio Signal to the Internet – Project Development.] Technical report 16/2004, Praha: CESNET, 2004.
[3] WIMMER, M. Vysílání a přenos audio signálu ve velmi vysoké kvalitě. [In Czech: Streaming and Transmitting High-Quality Audio Signal.] Technical report 28/2005, Praha: CESNET, 2005.
[4] WIMMER, M. Improving Reliability of a Streaming System. Technical report 24/2006, Praha: CESNET, 2006.
[5] WIMMER, M. Broadcasting and Transmitting Audio Signals Using the Lossless FLAC Compression Encoding. Technical report 18/2008, Praha: CESNET, 2008.
[6] WIMMER, M. Universal Trancoder to Convert FLAC Streaming Audio to Other Formats. Technical report 20/2009, Praha: CESNET, 2009.
další weby:fond rozvojemetacentrumCzechLightpřenosyvideoservereduroameduID.cz