Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



20 Commits

Repository files navigation

qqqr: QR code music player


Ever wished you had physical albums for all your cloud music? Tired of carrying a dozen milk crates full of vinyl records up and down stairs when you move?

qqqr is a Raspberry Pi Zero W project which uses ZBar and OpenCV to read paper QR code cards encoding Google Play Music track IDs and plays the songs over a Bluetooth speaker.

Project status: abandoned. Everything worked. But I found out that I can use the Spotify app to scan Spotify Codes, so I decided not to put more time into polishing qqqr.

Fair warning: if you go on an archaeological dig in the code, you'll see that I tried mplayer, mpg321, and mopidy for playback. I found that all of them took about 10 - 30 seconds to start playing from Google Play Music after the track ID was identified, whether streaming or pre-caching. I'm sure there's a solution but I didn't keep digging. My workaround solution was to use Spotify Connect for playback instead of local playback from Google Play Music.

Raspberry Pi config

Wi-Fi config

Raspberry PI hardware RNG

(Fixes "getrandom() initialization failed" error)

sudo apt install rng-tools

Camera focal length adjustment

video stream preview (2-3 second lag)
raspivid -t 0 -l -o tcp://
/Applications/ tcp/h264://qqpi.lan:3333

focal length adjustment

(counter-clockwise is closer focal length)


OpenCV installation

OpenCV SD card image

SD card image with precompiled OpenCV binaries

Compiling OpenCV

Instructions for compiling OpenCV on Raspberry Pi. (Turned out this takes 24+ hours on Raspberry Pi Zero so I gave up and used the ROSbots SD card image above.)

QR code scanning

Bluetooth speaker

Pairing Bluetooth speaker

Reconnect Bluetooth speaker

bluetoothctl -a
connect C0:28:8D:02:8D:8E

Play a test wav

aplay -D bluealsa:HCI=hci0,DEV=C0:28:8D:02:8D:8E,PROFILE=a2dp /usr/share/sounds/alsa/Front_Center.wav

Configure .asoundrc

pi@qqpi:~ $ cat .asoundrc
defaults.bluealsa.interface "hci0"
defaults.bluealsa.device "C0:28:8D:02:8D:8E"
defaults.bluealsa.profile "a2dp"

Auto-connect Bluetooth speaker

streaming mp3 playback


Mopidy installation and playback

(no longer using Mopidy—see explanation at top of page)

mopidy installation

sudo apt remove python-pip
wget -q
sudo python

sudo apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev
sudo apt-get install python-lxml
pip install mopidy-gmusic
sudo pip install mopidy-gmusic --ignore-installed pyasn1 --ignore-installed lxml

mopidy config

pi@qqpi:~ $ vi ~/.config/mopidy/mopidy.conf
#mixer = software
#mixer_volume =
output = alsasink device = bluealsa
#buffer_time =

#enabled = true
#hostname =
hostname = ::

#enabled = true
#library = json
media_dir = /home/pi/bluetooth_audio

control via mpd client

mpc add local:track:Untitled3.wav && mpc repeat && mpc play
mpc ls 'Google Music/Albums/The Grateful Dead - 5-8-77'
mpc add gmusic:track:7649c1b0-9499-36ef-bfe4-4f2a121ac08a && mpc play


QR code music player






No releases published


No packages published