{"id":3849,"date":"2021-11-22T19:41:33","date_gmt":"2021-11-22T18:41:33","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=3849"},"modified":"2025-09-24T12:52:36","modified_gmt":"2025-09-24T10:52:36","slug":"music-streaming","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/","title":{"rendered":"Arduino Music Streaming mit live555 ?"},"content":{"rendered":"<h3>Introduction<\/h3>\n<p>I wanted to make some <strong>music streaming<\/strong> functionality available on <strong>Arduino<\/strong>. There are plenty of private music services using custom protocols which are out of reach. Fortunately there are also the <strong>open source protocols<\/strong> RTP and RTSP:<\/p>\n<ul>\n<li><strong>RTP<\/strong> is the transport protocol for real-time data. It provides timestamp, sequence number, and other means to handle the timing issues in real-time data transport. <\/li>\n<li><strong>RTSP<\/strong> is a control protocol that initiates and directs delivery of streaming multimedia data from media servers.<\/li>\n<\/ul>\n<p>So, I took the effort to make the <a href=\"http:\/\/www.live555.com\/\">LIVE555<\/a> library also available for Arduino. For the time being I only support the <strong>ESP32<\/strong> microcontroller.<\/p>\n<p><em>At some point of time I thought I had it working, but the sound is breaking up very badly. I spent a couple of days to resolve the issue, but so far did not have any success!<\/em> It would be interesting to hear from you if you get the same issue &#8211; so that I can exclude my home infrastructure as cause of the problem.<\/p>\n<h3>LIVE555<\/h3>\n<p><strong>LIVE555<\/strong> is a set of open source (LGPL) C++ libraries developed by Live Networks, Inc. for multimedia streaming. The libraries support open standards such as RTP\/RTCP and RTSP for streaming, and can also manage video RTP payload formats such as MPEG, AAC, AMR, AC-3 and Vorbis.<\/p>\n<p>It is used internally by well-known software such as <strong>VLC and MPlayer<\/strong>.<\/p>\n<p>In order to make the library available for Arduino I have<\/p>\n<ul>\n<li>Created the <strong>src directory<\/strong> with symlinks to all source files<\/li>\n<li><strong>Deactivated exceptions<\/strong> (with the help of #defines)<\/li>\n<li>Used <strong>lwip<\/strong> as network interface<\/li>\n<li>Replaced printf(stderr, &#8230;) with a separate <strong>LOG()<\/strong> method, so that we can handle them properly in Arduino<\/li>\n<li>Renamed inet.c to inet.cpp so that we can use c++ classes<\/li>\n<li>Implemented plenty of <strong>platform specific corrections<\/strong><\/li>\n<li>Provided a <strong>file abstraction layer<\/strong> to replace the stdio.h operations so that we can use different SD libraries<\/li>\n<\/ul>\n<p>The biggest challenge was with the last point. Unfortunately Arduino does not provide a proper stdio.h implementation that can be used to access files. On the other hand most projects assume that stdio.h is available and therefore do not use any additional abstraction layer: live555 is here not an exception.<\/p>\n<h3>Example Arduino Sketch<\/h3>\n<p>I have also created a <strong>simple mp3 streaming API<\/strong>. Here is an example that uses the <a href=\"https:\/\/github.com\/greiman\/SdFat\">SdFat library<\/a> from Bill Greiman to access the <strong>mp3 files on a SD card<\/strong>:<\/p>\n<pre><code>#include \"FileAccessSdFat.hh\"\n#include \"SimpleStreamer.hh\"\n\nSimpleMP3Streamer mp3(new FileAccessSdFat());\n\nvoid setup() {\n  Serial.begin(115200);\n\n  auto cfg = mp3.defaultConfig();\n  cfg.destinationAddress = \"192.168.1.255\";\n  cfg.filePath = \"\/Music\/Conquistadores.mp3\";\n  cfg.isAutoRestart = true;\n  cfg.ssid = \"SSID\";\n  cfg.password = \"password\";\n\n  if (mp3.begin(cfg)){\n    mp3.play();\n  }\n}\n\n\nvoid loop() {\n  mp3.doEventLoop();\n}\n<\/code><\/pre>\n<p>In the constructor of the <a href=\"https:\/\/pschatzmann.github.io\/live555\/html\/class_simple_m_p3_streamer.html\">SimpleMP3Streamer<\/a> we indicate the file access class. For starting the streaming we need to provide the file and the destination ip address: <code>192.168.1.255<\/code> is a broadcast address.<br \/>\nIf we did not start the network yet we need to provide the ssid and password.<br \/>\nThe <code>cfg.isAutoRestart = true;<\/code> is making shure that when the end of the file is reached that we restart again.<\/p>\n<h3>VLC Player<\/h3>\n<p>The VLC Player can be used to receive the streamed music. Just use -> File -> Open Network and enter the <code>udp:\/\/@:6666<\/code> address.<\/p>\n<h3>Github<\/h3>\n<p>The project can be found on <a href=\"https:\/\/github.com\/pschatzmann\/live555\">Github<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction I wanted to make some music streaming functionality available on Arduino. There are plenty of private music services using custom protocols which are out of reach. Fortunately there are also the open source protocols RTP and RTSP: RTP is the transport protocol for real-time data. It provides timestamp, sequence [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3850,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[20,22],"tags":[46,61],"class_list":["post-3849","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-machine-sound","tag-communications","tag-rtsp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Arduino Music Streaming mit live555 ? - Phil Schatzmann<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Arduino Music Streaming mit live555 ? - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"Introduction I wanted to make some music streaming functionality available on Arduino. There are plenty of private music services using custom protocols which are out of reach. Fortunately there are also the open source protocols RTP and RTSP: RTP is the transport protocol for real-time data. It provides timestamp, sequence [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-22T18:41:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-24T10:52:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/11\/live555.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"143\" \/>\n\t<meta property=\"og:image:height\" content=\"167\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/22\\\/music-streaming\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/22\\\/music-streaming\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Arduino Music Streaming mit live555 ?\",\"datePublished\":\"2021-11-22T18:41:33+00:00\",\"dateModified\":\"2025-09-24T10:52:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/22\\\/music-streaming\\\/\"},\"wordCount\":504,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/22\\\/music-streaming\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/live555.jpeg\",\"keywords\":[\"Communications\",\"RTSP\"],\"articleSection\":[\"Arduino\",\"Machine Sound\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/22\\\/music-streaming\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/22\\\/music-streaming\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/22\\\/music-streaming\\\/\",\"name\":\"Arduino Music Streaming mit live555 ? - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/22\\\/music-streaming\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/22\\\/music-streaming\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/live555.jpeg\",\"datePublished\":\"2021-11-22T18:41:33+00:00\",\"dateModified\":\"2025-09-24T10:52:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/22\\\/music-streaming\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/22\\\/music-streaming\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/22\\\/music-streaming\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/live555.jpeg\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/live555.jpeg\",\"width\":143,\"height\":167},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/22\\\/music-streaming\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Arduino Music Streaming mit live555 ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Arduino Music Streaming mit live555 ? - Phil Schatzmann","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/","og_locale":"en_US","og_type":"article","og_title":"Arduino Music Streaming mit live555 ? - Phil Schatzmann","og_description":"Introduction I wanted to make some music streaming functionality available on Arduino. There are plenty of private music services using custom protocols which are out of reach. Fortunately there are also the open source protocols RTP and RTSP: RTP is the transport protocol for real-time data. It provides timestamp, sequence [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/","og_site_name":"Phil Schatzmann","article_published_time":"2021-11-22T18:41:33+00:00","article_modified_time":"2025-09-24T10:52:36+00:00","og_image":[{"width":143,"height":167,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/11\/live555.jpeg","type":"image\/jpeg"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Arduino Music Streaming mit live555 ?","datePublished":"2021-11-22T18:41:33+00:00","dateModified":"2025-09-24T10:52:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/"},"wordCount":504,"commentCount":0,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/11\/live555.jpeg","keywords":["Communications","RTSP"],"articleSection":["Arduino","Machine Sound"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/","url":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/","name":"Arduino Music Streaming mit live555 ? - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/11\/live555.jpeg","datePublished":"2021-11-22T18:41:33+00:00","dateModified":"2025-09-24T10:52:36+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/11\/live555.jpeg","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/11\/live555.jpeg","width":143,"height":167},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/22\/music-streaming\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Arduino Music Streaming mit live555 ?"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/3849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=3849"}],"version-history":[{"count":27,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/3849\/revisions"}],"predecessor-version":[{"id":3879,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/3849\/revisions\/3879"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/3850"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=3849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=3849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=3849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}