Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

PC Based Computer music servers, crossovers, and equalization

Moode Audio Player for Raspberry Pi
Moode Audio Player for Raspberry Pi
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 10th September 2015, 05:43 AM   #601
challenge is offline challenge  Italy
diyAudio Member
 
Join Date: Jul 2015
Yeah a remote is essential IMHO, it made the experience so much better.
I used the remote from my old A/V receiver, so it has a lot of buttons (fm tuner, cd,dvd aux etc).
I also mapped the tuner numeric keys to stations like this:
Code:
begin
    prog = irexec
    button = KEY_8
    config = mpc clear; mpc add http://bbcmedia.ic.llnwd.net/stream/bbcmedia_6music_mf_p; mpc play
    repeat = 0
end
so I just hit the number and it loads the station, just like the old hi-fi I had.
User experience with the remote is very similar as before but sound quality and features are way improved.


To have lirc running I really hadn't a lot to do.

- Wire the TSOP, note the gpio pin.

- add this to your boot/config.txt
Code:
dtoverlay=lirc-rpi,gpio_in_pin=25
change 25 to your gpio number. Note it's gpio number, not pin number.

Then it's just a matter of following the usual instructions of
- installing lirc
- using irrecord to record the remote and generate a config file
- copy that config file to /etc/lirc/lircd.conf.
- create a /etc/lirc/lircrc which will store the irexec mpc binds
- sudo /etc/init.d/lirc start
you then can use irw command to see if your binds are getting received

I'm pretty sure I've seen quite a few detailed guides on volumio forum, showing all the commands.
If you don't add that line to boot/config.txt it will never work.

------
the only problem is that on the same moode partition I also have kodi running on another remote and other tools. Add all that custom configuration and the moode upgrades are becoming a little troublesome to update by hand.
Is there a plan to make it upgrade in a way we don't lose all the tweaked things and files?
Maybe starting with a stripped raspbian and then adding moode as a combination of packages from a repo and git cloning?
This way one would just upgrade the packages without starting from scratch every time?

otherwise I have to find a way to apply all my modded files and conf automatically every time I update... diff and patch maybe?
  Reply With Quote
Old 10th September 2015, 08:26 AM   #602
DRONE7 is offline DRONE7  New Zealand
diyAudio Member
 
Join Date: Aug 2008
Thanks challenge ! I will give it a try
That station mapping is just what I am looking for ! Gold !
  Reply With Quote
Old 10th September 2015, 10:45 AM   #603
hoze99 is offline hoze99  New Zealand
diyAudio Member
 
Join Date: May 2012
Location: Wellington, New Zealand
Quote:
Originally Posted by challenge View Post
About the knob.sh script and remotes (lirc)...
I remember the UI updated in realtime time ago, now I've just read it's handled by the knob.sh script.

Well.. long story short: the webUI volume wasn't updating with remote presses... it adjusted the alsa volume but not the ui. (because I was using mpc commands)

Also using alsa commands or using alsamixer doesn't update the webUI. But I don't care about that now.

Premise: I'm not a coder nor programmer, first time with bash done with 10 mins of googling and some trial and error, so don't trust this if you don't know what you're doing.
Your raspberry, your ears or your window glasses could explode

I wanted that hitting volume buttons in the remote would update the webUI too in realtime, not only the alsa volume.

I tried the usual way (binding mpc or alsa commands) but the webUi wasn't updating in real time... a manual refresh was needed.

So I had to add a bit of code to knob.sh.
This allows me to bind easy commands in lircrc AND the knob updates in realtime.
The original script worked by feeding it a volume number to set e.g.: "./knob.sh 35"
I modded it to have also "./knob.sh volup" (or voldown / mute).

To give you an idea (using steps of 3 in this example):
Code:
if [ "$1" = "volup" ]; then 
        actual=$(sed -n -e 's/^.*volume_knob_setting: //p' /var/www/tcmods.conf)
        newvol=$(echo $((actual+3)))

        # update knob setting
        sed -i '/volume_knob_setting:/c\volume_knob_setting: '$newvol /var/www/tcmods.conf

        # update ALSA volume
        if [ "$VOLTYPE" = "volume_curve_logarithmic: Yes" ]; then
                amixer set Digital -M $newvol% > /dev/null
        else
                amixer set Digital $newvol% > /dev/null
        fi

        exit
fi

if [ "$1" = "voldown" ]; then 
        actual=$(sed -n -e 's/^.*volume_knob_setting: //p' /var/www/tcmods.conf)
        newvol=$(echo $((actual-3)))

        # update knob setting
        sed -i '/volume_knob_setting:/c\volume_knob_setting: '$newvol /var/www/tcmods.conf

        # update ALSA volume
        if [ "$VOLTYPE" = "volume_curve_logarithmic: Yes" ]; then
                amixer set Digital -M $newvol% > /dev/null
        else
                amixer set Digital $newvol% > /dev/null
        fi

        exit
fi

if [ "$1" = "mute" ]; then 
        # update knob setting
        sed -i '/volume_knob_setting:/c\volume_knob_setting: '0 /var/www/tcmods.conf

        # update ALSA volume
        if [ "$VOLTYPE" = "volume_curve_logarithmic: Yes" ]; then
                amixer set Digital -M 0% > /dev/null
        else
                amixer set Digital 0% > /dev/null
        fi

        exit
fi
e.g. in lircrc now I just use the new commands:
Code:
begin
    prog = irexec
    button = KEY_VOLUMEUP
    config = /var/www/knob.sh volup
    repeat = 4
end
begin
    prog = irexec
    button = KEY_VOLUMEDOWN
    config = /var/www/knob.sh voldown
    repeat = 4
end
begin
    prog = irexec
    button = KEY_MUTE
    config = /var/www/knob.sh mute
    repeat = 4
end
It works. I'll have to fix the mute to effectively mute and unmute instead of setting the volume to 0, but I was in a hurry and tired when I did this.

Now the problem is...
Is this the best way to do it?
Or it's already implemented (to update the volume knob in realtime when using IR remotes) and I didn't notice it?




setup is raspy B+, IQaudio pidac+, moode r2.2, set to hw audio etc.

PS: also having fun with text to speech, hit a button on remote and a sweet lady voice tells me which station I'm listening to, or the song/album/artist or the volume level (dirty fix until I get a LCD )
Can I suggest a slight tweak to the knob.sh modifications to allow support for different mixer types:

In the volup and voldown code blocks, instead of:
Code:
if [ "$VOLTYPE" = "volume_curve_logarithmic: Yes" ]; then
                amixer set Digital -M $newvol% > /dev/null
else
                amixer set Digital $newvol% > /dev/null
fi
This should instead be:

Code:
if [ "$VOLTYPE" = "volume_curve_logarithmic: Yes" ]; then
                amixer set $MIXERNAME -M $newvol% > /dev/null
else
                amixer set $MIXERNAME $newvol% > /dev/null
fi
Cheers
  Reply With Quote
Old 10th September 2015, 12:30 PM   #604
yjo is offline yjo  Japan
diyAudio Member
 
Join Date: Aug 2015
Hi,

Thank you, Tim, for implementing knob.sh.

I installed lirc on Moode 2.3 and the volume control works well.
I wrote short scripts vol5up.sh and vol5dn.sh, and irexec calls these scripts for volume up/down.

vol5up.sh
Code:
#!/bin/sh
level=`mpc volume | awk -F":" '{print substr($2, 1, index($2, "%")-1)+5}'`
if [ $level -gt 100 ] ; then
  level=100
fi
mpc volume $level > /dev/null
/var/www/knob.sh $level > /dev/null
exit 0
vol5dn.sh
Code:
#!/bin/sh
level=`mpc volume | awk -F":" '{print substr($2, 1, index($2, "%")-1)-5}'`
if [ $level -lt 0 ] ; then
  level=0
fi
mpc volume $level > /dev/null
/var/www/knob.sh $level > /dev/null
exit 0
See here.

Regards,
yjo
  Reply With Quote
Old 11th September 2015, 01:58 AM   #605
DRONE7 is offline DRONE7  New Zealand
diyAudio Member
 
Join Date: Aug 2008
Hi Tim.. where is the playback history file located..? am I able to copy the history for later lookup or is that only available from a running MoOde ?

Last edited by DRONE7; 11th September 2015 at 02:27 AM.
  Reply With Quote
Old 11th September 2015, 02:35 AM   #606
TimCurtis is offline TimCurtis  United States
diyAudio Member
 
TimCurtis's Avatar
 
Join Date: Jan 2012
Location: Metro-Detroit
Quote:
Originally Posted by yjo View Post
Hi,

Thank you, Tim, for implementing knob.sh.

I installed lirc on Moode 2.3 and the volume control works well.
I wrote short scripts vol5up.sh and vol5dn.sh, and irexec calls these scripts for volume up/down.

vol5up.sh
Code:
#!/bin/sh
level=`mpc volume | awk -F":" '{print substr($2, 1, index($2, "%")-1)+5}'`
if [ $level -gt 100 ] ; then
  level=100
fi
mpc volume $level > /dev/null
/var/www/knob.sh $level > /dev/null
exit 0
vol5dn.sh
Code:
#!/bin/sh
level=`mpc volume | awk -F":" '{print substr($2, 1, index($2, "%")-1)-5}'`
if [ $level -lt 0 ] ; then
  level=0
fi
mpc volume $level > /dev/null
/var/www/knob.sh $level > /dev/null
exit 0
See here.

Regards,
yjo
Hi,

I remember that u had originally proposed an interface to the volume knob somewhere back in one of the late 1.x releases as part of your IR project so thank you for the nice idea :-)

I see u are using "mpc volume" calls so u must be using MPD Software volume control correct?

Also, thinking a bit, since mute state is similar to volume level in that both are decoupled from MPD in Moode, I should be able to add a mute interface to knob.sh.

Regards,
Tim
  Reply With Quote
Old 11th September 2015, 02:43 AM   #607
TimCurtis is offline TimCurtis  United States
diyAudio Member
 
TimCurtis's Avatar
 
Join Date: Jan 2012
Location: Metro-Detroit
Quote:
Originally Posted by DRONE7 View Post
Hi Tim.. where is the playback history file located..? am I able to copy the history for later lookup or is that only available from a running MoOde ?
Hi,

The playback history log path is:

/var/www/playhistory.log


it can be copied off, renamed to .html and opened in a browser. Its not pretty looking but should be functional.

Regards,
Tim
  Reply With Quote
Old 11th September 2015, 03:51 AM   #608
yjo is offline yjo  Japan
diyAudio Member
 
Join Date: Aug 2015
Tim,
Thank you again for implementing my proposal :-)

Quote:
I see u are using "mpc volume" calls so u must be using MPD Software volume control correct?
Right, I'm using a USB-DAC, and I didn't confirm whether it works with hardware volume control or not.

Quote:
Also, thinking a bit, since mute state is similar to volume level in that both are decoupled from MPD in Moode, I should be able to add a mute interface to knob.sh.
Yes, but I scarcely use mute function, and the priority of this issue is relatively low to me :-)

Regards,
yjo
  Reply With Quote
Old 11th September 2015, 06:53 AM   #609
shanghai2004 is offline shanghai2004  Taiwan
diyAudio Member
 
Join Date: Apr 2012
Location: Taipei
Moode Audio Player for Raspberry Pi
Default USB audio glitch while browsing library on NAS

Hi,

When I play a file to an USB device (nothing heavy 44.1k/16) and I browse a library which is mostly located on a NAS, every time I click an album, the system tries to get the artwork thumbnail. During that process, there is a short but very noticeable audio glitch, which lasts longer if the system cannot find any artwork for that album.

It doesn't matter if the file that is actually playing is from USB, SDCARD or NAS. The glitch is with a Raspberry B+ and with the Raspberry 2B.

As loading the library (going to the lib page) doesn't cause any glitch, possible the CPU priority of the thumbnail reading process was set a bit too high?

I use UAC2 device with USB audio fix present. Issue is both on XMOS and CM6631A devices.

Anything I can try to help isolate this?

Last edited by shanghai2004; 11th September 2015 at 06:55 AM. Reason: fix typo
  Reply With Quote
Old 11th September 2015, 09:24 AM   #610
f3rn4nd0d is offline f3rn4nd0d
diyAudio Member
 
Join Date: Aug 2015
Hi folks

I just got a Sense Hat and I was planning to use the lcd display to scroll the name of the song and artist (using a USB DAC, more precisely a FiiO E17). Could anybody give me some hints on how to get in python the name of the song and artist from MPD?

Another thing that I was considering was to also use the 8X8 led matrix to create a low res art image of the album art just for fun, but I guess that would be even more complicated and I don't know if feasible at all.

And the last thing I was thinking to do, if I have some time, is to use the Sense Hat Joystick to control the reproduction.

BR / Fernando
  Reply With Quote

Reply


Moode Audio Player for Raspberry PiHide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
My DAC for the Raspberry Pi usul27 Digital Line Level 156 29th April 2017 11:10 PM
DSP for the Raspberry Pi usul27 Digital Line Level 39 30th August 2016 07:29 AM
Raspberry Pi + CirrusLogic Audio Card = FAIL solderhead PC Based 31 26th January 2016 06:48 PM
RaspyFi/Volumio - Turn raspberry Pi into Audiophile audio Player mikelangeloz PC Based 295 14th June 2014 05:32 PM
miniAMP and raspberry pi kp93300 miniDSP 0 3rd March 2014 03:38 AM


New To Site? Need Help?

All times are GMT. The time now is 12:59 PM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 14.29%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Copyright ©1999-2018 diyAudio
Wiki