RuneAudio as a standalone system on C1+

ODROID related support

RuneAudio as a standalone system on C1+

Postby odroider » 29 Aug 2015, 10:46

Great OS image!
Thanks for your hard work.

I've just made a standalone RuneAudio system with C1+, HiFi-Shield and a 3.2inch TFT LCD.
Image

Image

Image


Because the small LCD has low resolution 320x240, I needed to zoom in.
Image

Image


To enjoy K-pop, I also installed Korean font pack.
Image

Image


Here are brief steps what I did.
Install xorg stuff and lxde desktop
Install some Korean fonts
Install Chromium browser to render the RuneAudio UI on the LCD.
Run the Chromium with kiosk mode and open 127.0.0.1 as URL to display RuneAudio UI to see the feasibility.
Configure the system to enable auto-login to X-window (LXDE) and launch the Chromium automatically.
Add some other stuff in .bash_profile to activate the 3.2inch SPI-TFT LCD and touch screen drivers.
Use the xinput_calibrator for the resistive touch screen calibration.
Finally, the RuneAudio starts fully automatically after just turn on the system.

This is my first experience of using Arch Linux. So I spent a couple of days to find correct packages and configuration files.
It was not easy at all but I learned a lot. Finally my little kids can play music without my phone. :lol:

When I have time slot, I will make a very detail instruction how to build this fun and useful item. :D
Once again, really appreciate the official support of C1+ !
Last edited by odroider on 04 Sep 2015, 09:53, edited 2 times in total.
odroider
 
Posts: 56
Joined: 22 Jun 2015, 07:52

Re: RuneAudio as a standalone system (server and client) on

Postby gkkpch » 29 Aug 2015, 10:59

Great job!
I'm really interested in the description, just wonder if this would fit into the HK Cloud Shell somehow.
Odroid-C1+, 8Gb eMMC, 8Gb µSD with 32bit/384Khz Odroid-C1+ HiFi shield (PCM5102)
Odroid-C1, 8Gb µSD with DAC: XMOS 384K/32bit USB (PCM5102)
Other: 24bit/192Khz Audiophonics DAC Sabre ES9023 I2S
User avatar
gkkpch
 
Posts: 64
Joined: 19 May 2015, 11:58
Location: Switzerland

Re: RuneAudio as a standalone system (server and client) on

Postby odroider » 29 Aug 2015, 11:23

gkkpch wrote:Great job!
I'm really interested in the description, just wonder if this would fit into the HK Cloud Shell somehow.


Yes! 2TB HDD included standalone system will be really fantastic. :o
But the CloudShell LCD has no touch screen. So I'm very curious how to control the web UI with the IR remote controller. :cry:
odroider
 
Posts: 56
Joined: 22 Jun 2015, 07:52

Re: RuneAudio as a standalone system on C1+

Postby odroider » 31 Aug 2015, 05:16

I could use HK's official remote controller after issuing below two commands as hondagx35 explained.
Code: Select all
systemctl enable lircd
systemctl enable irexec


Volume +/- and Next/Previous keys are working as expected.
But I want to map "OK" key to "Play/Pause" function.
Is there any key-map file I can edit?


EDIT:
Oh! I found the MUTE key toggles Play and Pause. :D
FastForwad and FastRewind are missing though.
I think UP/DOWN/LEFT/RIGHT/OK keys should be mapped other ways. :?:
Repeated Vol +/- key also should be considered too.
Time to study the LIRC stuff.
odroider
 
Posts: 56
Joined: 22 Jun 2015, 07:52

Re: RuneAudio as a standalone system on C1+

Postby hondagx35 » 31 Aug 2015, 17:33

Hi odroider,

you can try these configuration files:

Code: Select all
# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.9.0(default) on Mon May 25 19:47:48 2015
#
# contributed by
#
# brand:                       lircd.conf.conf
# model no. of remote control:
# devices being controlled by this remote:
#

begin remote
 
  name  lircd.conf
  bits           16
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100
 
  header       8964  4507
  one           544  1692
  zero          544   561
  ptrail        544
  repeat       8965  2285
  pre_data_bits   16
  pre_data       0x4DB2
  gap          107872
  toggle_bit_mask 0x0
 
      begin codes
          KEY_PREVIOUS             0x53AC
          KEY_NEXT                 0x4BB4
          KEY_FORWARD              0x837C
          KEY_BACK                 0x9966
          KEY_OK                   0x738C
          KEY_HOME                 0x41BE
          KEY_MUTE                 0x11EE
          KEY_MENU                 0xA35C
          KEY_VOLUMEDOWN           0x817E
          KEY_VOLUMEUP             0x01FE
          KEY_POWER                0x3BC4
      end codes
 
end remote

/etc/lirc/lircd.conf.d/lircd.conf

Code: Select all
## irexec
begin irexec
  begin
     prog = irexec
     button = KEY_POWER
     ignore_first_events = 30
     config = php /srv/http/command/ui_notify.php Power "Power down = press OK\nReboot = press UP" simplemessage
     mode = powerdown
     repeat = 0
  end

  begin
     prog = irexec
     button = KEY_PREVIOUS
     config = mpc prev && mpc play
     repeat = 0
  end

  begin
     prog = irexec
     button = KEY_NEXT
     config =  mpc next && mpc play
     repeat = 0
  end

  begin
     prog = irexec
     button = KEY_VOLUMEUP
     config = mpc volume +2
     repeat = 1
  end

  begin
     prog = irexec
     button = KEY_VOLUMEDOWN
     config = mpc volume -2
     repeat = 1
  end

  begin
     prog = irexec
     button = KEY_FORWARD
     config = mpc seek +00:00:05
     repeat = 1
  end

  begin
     prog = irexec
     button = KEY_BACK
     config = mpc seek -00:00:05
     repeat = 1
  end

  begin
     prog = irexec
     button = KEY_MUTE
     config = mpc toggle
     repeat = 0
  end
end irexec

begin powerdown
  begin
     prog = irexec
     button = KEY_OK
     ignore_first_events = 10
     config = /srv/http/command/rune_shutdown; shutdown now -h
     repeat = 0
  end

  begin
     prog = irexec
     button = KEY_PREVIOUS
     ignore_first_events = 10   
     config = /srv/http/command/rune_shutdown; reboot
     repeat = 0
  end

  begin
     prog = irexec
     button = KEY_VOLUMEUP
     mode = irexec
     repeat = 0
  end

  begin
     prog = irexec
     button = KEY_VOLUMEDOWN
     mode = irexec
     repeat = 0
  end

  begin
     prog = irexec
     button = KEY_FORWARD
     mode = irexec
     repeat = 0
  end

  begin
     prog = irexec
     button = KEY_BACK
     mode = irexec
     repeat = 0
  end

  begin
     prog = irexec
     button = KEY_RIGHT
     mode = irexec
     repeat = 0
  end

  begin
     prog = irexec
     button = KEY_LEFT
     mode = irexec
     repeat = 0
  end

  begin
     prog = irexec
     button = KEY_MUTE
     mode = irexec
     repeat = 0
  end
end powerdown
/etc/lirc/lircrc

The following functions are included:
- volume up = "+"
- volume down = "-"
- next song = "arrow down" (so it matches to Queue)
- prev song = "arrow up"
- seek forward = "arrow right"
- seek backward = "arrow left"
- toggle play/pause = "mute"
- power down = "power" (4 seconds) + "OK" (2 seconds)
- reboot = "power" (4 seconds) + "arrow up" (2 seconds)
- if player is stopped next or prev song (arrow down or up) starts the player.

As you can see:
- "/etc/lirc/lircd.conf.d/lircd.conf" is the configuration for your remote
- "/etc/lirc/lircrc" maps your keys to mpd functions

Frank
User avatar
hondagx35
 
Posts: 3016
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: RuneAudio as a standalone system on C1+

Postby odroider » 01 Sep 2015, 04:04

Thank you for the configuration files.
It works greatly. :D

A couple of minor things.
1. The seek speed is too much fast. I changed the skip value to 2 seconds from 5 seconds. It is nice for me.
2. Next track (DOWN key) works very well but Previous track(UP key) doesn't frequently.
After changing the config of KEY_PREVIOUS, it is slightly better now. But I'm not sure. :|
Code: Select all
 
     button = KEY_PREVIOUS
     config = mpc consume off;mpc prev && mpc play
odroider
 
Posts: 56
Joined: 22 Jun 2015, 07:52

Re: RuneAudio as a standalone system on C1+

Postby hondagx35 » 03 Sep 2015, 14:21

Hi odroider,

inspired by your work i did something similar.
What i did different is:

- used matchbox-window-manager instead of lxde
- used midori instead of chromium

It works great and doesn't consume much resources.

Code: Select all
[root@runeaudio ~]# free -h
          total     used      free    shared  buff/cache   available
Mem:      923M      55M       675M    14M     191M         756M
Normal installation

Code: Select all
[root@runeaudio ~]# free -h
          total     used      free     shared  buff/cache   available
Mem:      923M      83M       646M     14M     192M        727M
with matchbox and midori running

standalone2.jpg
standalone2.jpg (116.12 KiB) Viewed 9478 times
Normal installation
standalone1.jpg
standalone1.jpg (118.21 KiB) Viewed 9486 times
with matchbox and midori running

Please can you report your memory and cpu consumption.

Frank
User avatar
hondagx35
 
Posts: 3016
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: RuneAudio as a standalone system on C1+

Postby odroider » 04 Sep 2015, 09:50

Hello Frank,

Below results were measured when I played 44.1Khz/24bit FLAC music.
Code: Select all
[root@runeaudio ~]# free -h                                                     
              total        used        free      shared  buff/cache   available
Mem:           836M        314M        232M         11M        289M        403M


rune_stand.png
rune_stand.png (90.6 KiB) Viewed 9409 times


Yes, the matchbox and midori are much more light.

The CPU usage seems to be fine for me because the tiny LCD screen resolution is only 320x240.
In fact, I bought a 480x320 4-inch IPS LCD for better visibility and it will be here early next week.
I will try it with the matchbox and midori too. I need to find how to zoom in/out the UI on the midori.

I want to make a RuneAudio powered network player at around US$200 including C1+, HiFi-Shield, Micro-SD UHS, LCD Screen, Power supply and Aluminium case. Is it really affordable? :twisted:
I will share all the cost and schematics when it is realized.


Edit.
If we change this Kernel parameter in the boot.ini file, we can have ~110MB of additional system RAM. :)
Code: Select all
# Disable VPU (Video decoding engine, Saves RAM!!!)
# 0 = disabled
# 1 = enabled
setenv vpu "1"


Now, I have enough RAM to play.
Code: Select all
[root@runeaudio ~]# free -h                                                     
              total        used        free      shared  buff/cache   available
Mem:           948M        182M        520M         12M        244M        647M
odroider
 
Posts: 56
Joined: 22 Jun 2015, 07:52

Re: RuneAudio as a standalone system on C1+

Postby gkkpch » 02 Oct 2015, 18:27

odroider wrote:Great OS image!
Thanks for your hard work.
......
When I have time slot, I will make a very detail instruction how to build this fun and useful item. :D
....
!

and thank YOU for this nice piece of work, any chance on a detail instruction yet? :mrgreen:

Odroid-C1+, 8Gb eMMC, 8Gb µSD with 32bit/384Khz Odroid-C1+ HiFi shield (PCM5102)
Odroid-C1, 8Gb µSD with DAC: XMOS 384K/32bit USB (PCM5102)
Other: 24bit/192Khz Audiophonics DAC Sabre ES9023 I2S
User avatar
gkkpch
 
Posts: 64
Joined: 19 May 2015, 11:58
Location: Switzerland

Re: RuneAudio as a standalone system on C1+

Postby odroider » 03 Oct 2015, 10:12

I had no time.. Sorry.

Here is brief guide I wrote on my notepad. Please try it ant let me know what's not working or missing.

Let's try it with a HDMI TV or monitor first. I will write another guide for the small 3.2inch TFT LCD later.

Install the RuneAudio OS image for C1+ on your eMMC or SD
RuneAudio_odroid-c1_0.3-dev_20150824_2GB.img

Use the serial console (with ODROID USB-UART kit) or SSH to the IP address given to the board by your router.

Install video driver files (one for HDMI and the other one for TFT-LCD)
Code: Select all
pacman -S xf86-video-odroid-c1 xf86-video-fbdev


Install xorg server
Code: Select all
pacman -S xorg-server


Install xorg-xinit, which provides both xinit and startx.
Code: Select all
pacman -S xorg-xinit


Install lxde Desktop GUI
Code: Select all
pacman -S lxde


Install an extra font if you need. I installed Korean font because I want to display the song information in our character set.
Code: Select all
pacman -S ttf-baekmuk


Download a working Chromium browser and install it. (Official ALARM package didn't work)
Code: Select all
wget http://odroidxu.leeharris.me.uk/chromium-44.0.2403.107-1-armv7h.pkg.tar.xz
sudo pacman -U chromium-44.0.2403.107-1-armv7h.pkg.tar.xz

If you edit /etc/pacman.conf and set
Code: Select all
IgnorePkg   = chromium
it won't get upgraded accidentally.

Reboot your ODROID and Run LXDE on the command line on the HDMI screen.
Code: Select all
lxdm


Test the RuneAudio UI on the HDMI screen. It should work with below command.
Code: Select all
chromium --user-data-dir --kiosk 127.0.0.1


How to do "auto-login" on the HDMI console.
Run
Code: Select all
systemctl edit getty@tty1

And copy and paste below lines and save it.
Code: Select all
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin root --noclear %I 38400 linux


How to do "auto-start lxde". Make .bash_profile in /root/ directory with below contents.
Code: Select all
#
# ~/.bash_profile
#

echo Run me first
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
exec lxdm
fi


Enable auto login of LXDE
"nano /etc/lxdm/lxdm.conf" and edit the second line like this
Code: Select all
## uncomment and set autologin username to enable autologin
autologin=root


Auto start the Chromium browser in full screen mode
Edit this file.
Code: Select all
nano /etc/xdg/lxsession/LXDE/autostart


Add this line at the end.
Code: Select all
@chromium --user-data-dir --kiosk 127.0.0.1


You can see the RuneAudio Web UI on the HDMI just after power-on your ODROID fully automatically.


If it works, I will prepare an additional instruction to work with 3.2inch TFT screen as well as touch screen.
Last edited by odroider on 03 Oct 2015, 10:26, edited 3 times in total.
odroider
 
Posts: 56
Joined: 22 Jun 2015, 07:52

support RuneAudio Donate with PayPal

Next

Return to ODROID

Who is online

Users browsing this forum: No registered users and 1 guest