{"id":18750079,"url":"https://github.com/msergo/mplayer-pi","last_synced_at":"2026-05-19T15:03:32.207Z","repository":{"id":53471767,"uuid":"307710442","full_name":"msergo/mplayer-pi","owner":"msergo","description":"Player app for listening web radio streams on Raspberry Pi with a bluetooth speaker","archived":false,"fork":false,"pushed_at":"2024-12-11T20:05:46.000Z","size":2336,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-28T22:27:57.750Z","etag":null,"topics":["python","rasppbery","webradio"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msergo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-27T13:33:18.000Z","updated_at":"2024-12-11T20:05:51.000Z","dependencies_parsed_at":"2024-05-06T22:28:28.656Z","dependency_job_id":"2ca2a20c-0dda-4da2-8b7c-98aea13b505f","html_url":"https://github.com/msergo/mplayer-pi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msergo%2Fmplayer-pi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msergo%2Fmplayer-pi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msergo%2Fmplayer-pi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msergo%2Fmplayer-pi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msergo","download_url":"https://codeload.github.com/msergo/mplayer-pi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239635534,"owners_count":19672190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","rasppbery","webradio"],"created_at":"2024-11-07T17:10:06.544Z","updated_at":"2026-05-19T15:03:22.193Z","avatar_url":"https://github.com/msergo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Player app for listening internet radio streams on Raspberry Pi Zero W with an external bluetooth speaker\n\n### Motivation\nI need a browser-accessible app to play radio streams on my bluetooth speaker.\n\nSee the blog post about this app https://msergo.github.io/2022/09/10/internet-radio-pi-zero.html  \n\n\u003cimg src=\"https://raw.githubusercontent.com/msergo/mplayer-pi/master/screenshot.png\" width=\"380\"\u003e\n\n\n### How it works\nAn instance of `cvlc` is spawned using python's `subprocess.Popen` which playes the stream. \n\n### Features\n* Extremely lightweight, built with bottle.py library\n* Can play \"classic\" streams and streams from m3u8 playlists\n* Can be configured as a *systemd* service in order to start automatically\n\n### Setting up\n#### Find and pair the bluetooth speaker (tested with JBL Flip 2)\n```bash\n$ bluetoothctl scan on\nDiscovery started\n[CHG] Controller 22:11:F9:18:8C:C8 Discovering: yes\n[NEW] Device D8:9C:67:B4:33:18 SOME_OTHER_DEVICE\n[NEW] Device B8:08:EB:7A:AC:C3 SPEAKER_HERE\n# pair the SPEAKER_HERE device\nbluetoothctl pair \"B8:08:EB:7A:AC:C3\"\nbluetoothctl trust \"B8:08:EB:7A:AC:C3\"\n```\n\n#### Install PulseAudio Bluetooth profile loader\n\n```bash\n$ sudo apt install pulseaudio-module-bluetooth\n# add pi user to bluetooth group\n$ sudo usermod -a -G bluetooth pi\n```\n#### Install bluez-alsa\n\n```bash\n$ sudo apt install pulseaudio-module-bluetooth\n$ sudo apt-get install bluealsa\n$ vi ~/.asoundrc\n# add the default config\ndefaults.bluealsa.service \"org.bluealsa\"\ndefaults.bluealsa.device \"XX:XX:XX:XX:XX:XX\" # MAC of the speaker\ndefaults.bluealsa.profile \"a2dp\"\ndefaults.bluealsa.delay 10000 \n```\n\n#### Install player and verify that sound works\n```bash\n$ sudo apt install cvlc\ncvlc -A alsa --alsa-audio-device bluealsa file_example.wav \n```\n\n#### Run the app\nNB!: tested with python version 3.8\n```bash \nvirtualenv -p /usr/bin/python3.8 env\n. env/bin/activate\npip install -r requirements.txt\npython main.py \n```\n\nNB! You might need to adjust the `VOLUME_LEVEL_COMMAND` in the `.env` file in order to match your BT device name.\n\n#### Configuring as a systemd service \n##### 1. Create file /etc/systemd/system/mplayer-pi.service\n```\n[Unit]\nDescription=mplayer-pi service\n\n[Service]\nUser=pi\nWorkingDirectory=/path/to/mplayer-pi\nExecStart=/path/to/mplayer-pi/env/bin/python3 -m main\n\n[Install]\nWantedBy=multi-user.target\n```\n\n##### 2. Enable service\n```bash\nsystemctl enable mplayer-pi.service\n```\n\n##### 3. Start service\n```bash\nsystemctl start mplayer-pi.service\n```\n\n### Images credits:\n* google.com\n* radio station web portals\n* soma.fm","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsergo%2Fmplayer-pi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsergo%2Fmplayer-pi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsergo%2Fmplayer-pi/lists"}