Infrared remote control is always used for controlling TV and Media Devices and with an Orange Pi Zero in hand it doesn’t take much time to convert it in to an IR controlled Media player. Now to make a media player we need a suitable software which can work with Orange Pi Zero and support Infrared remote control. I chose MPD (Media Player Daemon) because the main application runs in the background and the front-end clients can run unblocked and independent.

Hardware:

To get started ,you will need to have these set of hardware. The links are part of my affiliate program.

Orange Pi Zero

https://www.banggood.com/Orange-Pi-Zero-H2-Quad-Core-Open-source-512MB-Development-Board-p-1110210.html?p=W214159476515201703B

Orange PI Zero Interface board

https://www.banggood.com/Orange-Pi-Zero-Expansion-Board-Interface-Board-Development-Board-p-1115982.html?p=W214159476515201703B

IR Remote

https://www.banggood.com/HX1838-Receiver-NEC-Code-Infrared-Remote-Control-Module-IR-Controller-p-937207.html?p=W214159476515201703B

Software:

Once you have the Orange Pi hardware, you need to setup ut getting a rootfilesystem, flashing it to the sd card, and after that you will need to configure the IR Remote control with Orange Pi Zero .

apt-get install mpd mpc

music_directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "/var/lib/mpd/music" playlist_directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "/var/lib/mpd/playlists" db_file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "/var/lib/mpd/tag_cache" log_file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "/var/log/mpd/mpd.log" pid_file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "/run/mpd/pid" sticker_file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "/var/lib/mpd/sticker.sql" user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "root" group&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "root" bind_to_address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "localhost" bind_to_address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "/run/mpd/socket" input { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plugin "curl" } audio_output { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "alsa" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "My ALSA Device" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mixer_type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "software" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "hw:0,0"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # optional } filesystem_charset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "UTF-8" id3v1_encoding&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "UTF-8" decoder { plugin "mad" enabled "no" }

Here copy your audio files to the following path as defined by music_directory “/var/lib/mpd/music” . Create a playlist of the files and put it on the as defined by playlist_directory “/var/lib/mpd/playlists” . You can also put the radio station with .m3u extension here. For example, you can download your favourite station from here, https://www.internet-radio.com/ and copy to /var/lib/mpd/playlists.

/etc/asound.conf pcm.!default { type hw card 0 device 0 } ctl.!default { type hw card 0 }

Now everything should work fine, so lets restart the mpd.

/etc/init.d/mpd restart or systemctl restart mpd.service

Now plug a Speaker or headphone to the 3.5 mm Audio out jack and in the command line type the following.

mpc ls - will list all the files and playlist mpc add &lt;playlist&gt; will add a play list to the player mpc update - will update the player database about the changes mpc play - will play mpc next or mpc prev will navigate mpc volume +1 -increase the volume mpc volume -2 -increase the volume

When the music plays and you are able to navigate then you are done with this part.

Code:

Now let us try to get the IR part to make it work with your remote control. As mentioned earlier setup your IR remote control with Orange pi using this link. Copy the the following configuration to the path /etc/lirc/lircrc

begin &nbsp;&nbsp;&nbsp; prog = irexec &nbsp;&nbsp;&nbsp; button = KEY_NEXT &nbsp;&nbsp;&nbsp; config = mpc next &nbsp;&nbsp;&nbsp; repeat = 0 end begin &nbsp;&nbsp;&nbsp; prog = irexec &nbsp;&nbsp;&nbsp; button = KEY_PREVIOUS &nbsp;&nbsp;&nbsp; config = mpc prev &nbsp;&nbsp;&nbsp; repeat = 0 end begin &nbsp;&nbsp;&nbsp; prog = irexec &nbsp; button = KEY_PLAYPAUSE &nbsp; config = mpc play end begin &nbsp;&nbsp;&nbsp; prog = irexec &nbsp; button = KEY_EQUAL &nbsp; config = mpc pause end begin &nbsp;&nbsp;&nbsp; prog = irexec &nbsp; button = KEY_VOLUMEDOWN &nbsp; config = mpc volume -5 &nbsp;&nbsp;&nbsp; repeat = 1 end begin &nbsp;&nbsp;&nbsp; prog = irexec &nbsp; button = KEY_VOLUMEUP &nbsp; config = mpc volume +5 &nbsp;&nbsp;&nbsp; repeat = 1 end

Here I have used VOL+ and VOL- keys to increase and decrease volume. PREV and NEXT button to navigate between songs back and forth. And finally used PLAY button to play and EQ button to pause. There are plenty of sophistication that can be brought to this system. If you have and comments or feedback or improvement please comment them below.