Author Topic: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed  (Read 198 times)

Offline Reys Dad

  • Newbie
  • *
  • Join Date: May 2018
  • Location: SJC
  • Posts: 37
  • Kudos: 1
EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« on: February 11, 2019, 09:22:03 PM »
Last year I noticed a problem with my HiFi Berry Amp2 starting to play at 1/2 speed. I figured I had developed a hardware problem but didn't want to deal with it at Christmas. After the holiday and several emails with HiFi Berry support they thought it was a software issue. So I reinstalled a fresh build of FPP 2.6 and the Amp2 started right up and played with no issues. Fast forward to last night. I realized after the fresh FPP install my EDM RDS was not working because it couldn't locate the pigpiod file. I went in and reinstalled the EDM RDS with all the proper script modifications and the RDS started functioning again, however at the same time the issue with the HiFi Berry Amp2 playing at 1/2 speed came back  :( I thought maybe the HiFi Berry was using a pin that conflicted with the pins used by the EDM cable but that wasn't the case. Amp2 uses pins 3,4,5,12,35,38,40 and they said the Pi 3B reserves pins 28,28. My EDM RDS cable uses pins 16,18 which are GPIO 23 & 24 so no conflicts that I can tell (I have these remapped in the rd-song.py file)
I'm hoping someone can look at the EDM plug in and figure out what's going on and if it can be fixed or not. I'm not sure how to log a bug on this so posting here for help.Thanks


Online CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 9,618
  • Kudos: 197
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #1 on: February 12, 2019, 10:25:36 AM »
The EDM plugin install script tries to install pigpio from http://abyz.co.uk/rpi/pigpio/VERSIONS/pigpio-V22.zip but that hostname does not exist in DNS anymore.  It looks like it should be using abyz.me.uk.  The latest version on the web site is v68 while the plugin tries to install v22.  Which version are you using?  It may be that a different/newer version is required on the newer FPP Raspbian/Debian Stretch based SD images.  If we can know what it takes to get it working, we can clone the EDM plugin repo and get a fix committed and get the plugin re-added to the plugin list.  Currently this plugin is not in the list for the master FPP branch because it needs to be updated.
-
Chris

Offline dkulp

  • Developer
  • ******
  • Join Date: Sep 2013
  • Location: Framingham, MA
  • Posts: 1,376
  • Kudos: 76
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #2 on: February 12, 2019, 11:23:51 AM »
Well, the question is whether "apt-get install pigpio" gets a version that works.....
Dan Kulp

Offline Reys Dad

  • Newbie
  • *
  • Join Date: May 2018
  • Location: SJC
  • Posts: 37
  • Kudos: 1
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #3 on: February 12, 2019, 11:55:57 AM »
I had followed the instructions from amcknight on this thread
https://falconchristmas.com/forum/index.php/topic,8329.msg87563.html#msg87563
That seems to have corrected the abyz.co.uk address to abyx.me.uk but I can't really tell what version it is trying to get now. However, the reference to V22 was deleted in the instructions.

Delete this line-->> /usr/bin/wget http://abyz.co.uk/rpi/pigpio/VERSIONS/pigpio-V22.zip
rm pigpio.tar
/usr/bin/wget abyz.me.uk/rpi/pigpio/pigpio.tar
I'm at work right now but if someone can let me know how to check which version I have loaded up I can try and check tonight. Also curious if the latest version of pigpio doesn't work is there a way to force it to pick up an older version that does?
Thanks



Step 2: Modifying the plug-in's install files

a.  Log in to your FPP locally and from the command line navigate to the "edmrds" folder by typing: cd /home/fpp/media/plugins/edmrds

b. At the command line, type: sudo nano fpp_install.sh and make the following changes to this file (shown in bold red, other notes in bold blue).

 #!/bin/bash

pushd $(dirname $(which $0))

sudo cp pigpiod /etc/init.d
sudo chmod 755 /etc/init.d/pigpiod
sudo chmod +x /home/fpp/media/plugins/edmrds/callbacks.py
sudo chmod +x /home/fpp/media/plugins/edmrds/rds-song.py

Delete this line-->> /usr/bin/wget http://abyz.co.uk/rpi/pigpio/VERSIONS/pigpio-V22.zip
rm pigpio.tar
/usr/bin/wget abyz.me.uk/rpi/pigpio/pigpio.tar
Delete this line-->> sudo mv pigpio-V22.zip pigpio.zip
Delete this line-->> unzip pigpio.zip
tar xf pigpio.tar
cd PIGPIO/
sudo sed '2619s/data/str(data)/' -i pigpio.py
make
sudo make install

cd /etc/init.d
sudo update-rc.d pigpiod defaults 99
complete -W "$(ls /etc/init.d/)" service

Delete this line-->> service pigpiod start
sudo pigpiod
sudo systemctl enable pigpiod
sudo python /home/fpp/media/plugins/edmrds/rds-song.py -i

popd

Offline Reys Dad

  • Newbie
  • *
  • Join Date: May 2018
  • Location: SJC
  • Posts: 37
  • Kudos: 1
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #4 on: February 12, 2019, 12:08:50 PM »
Just to clarify.
1 The EDM plugin works fine with amcknight's instructions no matter if the hifiberry amp2 is plugged in or not.
2 The HiFi Berry Amp2 works fine if the pigpiod file from the EDMRDS plugin is not installed, however the RDS doesn't work
3 If the pigpiod is installed the RDS works as expected but the HiFiBerry Amp2 sounds like it is running at 1/2 speed

Online CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 9,618
  • Kudos: 197
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #5 on: February 12, 2019, 04:52:04 PM »
It looks like that tarball includes v68.  It looks like apt-get installs v64.  Can you go back to the PIGPIO directory and run "sudo make uninstall", then run "sudo apt-get -y install pigpio" to install the packaged v64 version.  Then restart the Pi and see if that works.

Offline Reys Dad

  • Newbie
  • *
  • Join Date: May 2018
  • Location: SJC
  • Posts: 37
  • Kudos: 1
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #6 on: February 12, 2019, 08:03:45 PM »
Thanks for the reply, I ran the two commands you mentioned. I've posted a screenshot below.
Here is what happened:
The good news - The HiFiBerry Amp2 started working again correctly
The bad news - The EDM Plugin can no longer find the pigpio file so the RDS doesn't work. This time it also stopped my USB DAC from working as well so no sound over the radio although I can still see the USB dac in the FPP interface and select it.
FYI I have two Dacs, the HiFi Berry Amp2 to power my outdoor speakers and the USB dac drives the EDM transmitter. I use the fpp on my iphone to switch between the two when I want to play the outdoor speakers instead of the radio

Online CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 9,618
  • Kudos: 197
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #7 on: February 13, 2019, 07:41:10 AM »
OK, try the following two commands to install the python code.  That is in separate packages.

Code: [Select]
sudo apt-get -y install python-pigpio python3-pigpio

I should have put those on the other install line I gave you.

Offline Reys Dad

  • Newbie
  • *
  • Join Date: May 2018
  • Location: SJC
  • Posts: 37
  • Kudos: 1
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #8 on: February 13, 2019, 09:52:50 AM »
Hi, That took care of the pigpio error from before but I'm getting a different error now, its something about missing attribute type.
As far as the hardware after this latest change:
Amp2 works
USB dac and RDS does not
I have to run to work so that's all the details I can provide right now.



Online CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 9,618
  • Kudos: 197
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #9 on: February 13, 2019, 10:10:23 AM »
Have you rebooted?  Can you run the following and paste the output in a 'code' tag to preserve the formatting?

Code: [Select]
sudo i2cdetect -y 1

Those errors look like the plugin can't talk to the EDM.

Offline Reys Dad

  • Newbie
  • *
  • Join Date: May 2018
  • Location: SJC
  • Posts: 37
  • Kudos: 1
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #10 on: February 13, 2019, 11:42:01 AM »
I did reboot. If you can let me know what a "code tag" is then I can run and try to paste it this evening

Offline Reys Dad

  • Newbie
  • *
  • Join Date: May 2018
  • Location: SJC
  • Posts: 37
  • Kudos: 1
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #11 on: February 13, 2019, 09:13:22 PM »
Still not sure what a code tag is but I ran the command and here is what came up.

fpp@FPP:~/media/plugins/edmrds/pigpio $ sudo i2cdetect -y 1     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f                                                                                                                     00:          -- -- -- -- -- -- -- -- -- -- -- -- --                                                                                                                     10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                                                                                                                     20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                                                                                                                     30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                                                                                                                     40: -- -- -- -- -- -- -- -- -- -- -- -- -- UU -- --                                                                                                                     50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                                                                                                                     60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                                                                                                                     70: -- -- -- -- -- -- -- --                                                                                                                                             

Offline Reys Dad

  • Newbie
  • *
  • Join Date: May 2018
  • Location: SJC
  • Posts: 37
  • Kudos: 1
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #12 on: February 13, 2019, 09:27:04 PM »
Code: [Select]
fpp@FPP:~/media/plugins/edmrds/pigpio $ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- UU -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
fpp@FPP:~/media/plugins/edmrds/pigpio $

Online CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 9,618
  • Kudos: 197
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #13 on: February 15, 2019, 12:20:52 PM »
Thanks, I see you found the code tag before I could reply.  :)

So that confirms the EDM is seen on the bus.  Can you run the following commands and paste the results?  These are what the plugin runs, but the plugin does squelch any error messages so they may not be visible.

Code: [Select]
python /home/fpp/media/plugins/edmrds/rds-song.py -n
python /home/fpp/media/plugins/edmrds/rds-song.py -l

If those don't work, try running them with 'sudo' in front of them.  The plugin doesn't need sudo, but its possible it needs it now.

Offline Reys Dad

  • Newbie
  • *
  • Join Date: May 2018
  • Location: SJC
  • Posts: 37
  • Kudos: 1
Re: EDM RDS causing HiFi Berry Amp2 to play at 1/2 speed
« Reply #14 on: February 15, 2019, 07:34:46 PM »
Thanks here they are:
Code: [Select]
fpp@FPP:~ $ python /home/fpp/media/plugins/edmrds/rds-song.py -n                                                                                                       
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                                                           
Can't connect to pigpio at localhost(8888)                                                                                                                             
                                                                                                                                                                       
Did you start the pigpio daemon? E.g. sudo pigpiod                                                                                                                     
                                                                                                                                                                       
Did you specify the correct Pi host/port in the environment                                                                                                             
variables PIGPIO_ADDR/PIGPIO_PORT?                                                                                                                                     
E.g. export PIGPIO_ADDR=soft, export PIGPIO_PORT=8888                                                                                                                   
                                                                                                                                                                       
Did you specify the correct Pi host/port in the                                                                                                                         
pigpio.pi() function? E.g. pigpio.pi('soft', 8888)                                                                                                                     
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                                                           
Traceback (most recent call last):                                                                                                                                     
  File "/home/fpp/media/plugins/edmrds/rds-song.py", line 24, in <module>                                                                                               
    s = bb_I2C.I2C(pi, 23, 24, 600)                                                                                                                                     
  File "/home/fpp/media/plugins/edmrds/bb_I2C.py", line 209, in __init__                                                                                               
    pi.set_mode(SCL, pigpio.OUTPUT)                                                                                                                                     
  File "/usr/lib/python2.7/dist-packages/pigpio.py", line 1296, in set_mode                                                                                             
    return _u2i(_pigpio_command(self.sl, _PI_CMD_MODES, gpio, mode))                                                                                                   
  File "/usr/lib/python2.7/dist-packages/pigpio.py", line 983, in _pigpio_command                                                                                       
    sl.s.send(struct.pack('IIII', cmd, p1, p2, 0))                                                                                                                     
AttributeError: 'NoneType' object has no attribute 'send'                                                                                                               
fpp@FPP:~ $ python /home/fpp/media/plugins/edmrds/rds-song -l
python: can't open file '/home/fpp/media/plugins/edmrds/rds-song': [Errno 2] No such file or directory                                                                 
fpp@FPP:~ $ python/home/fpp/media/plugins/edmrds/rds-song.py -l                                                                                                         
-bash: python/home/fpp/media/plugins/edmrds/rds-song.py: No such file or directory
[code]fpp@FPP:~ $ python /home/fpp/media/plugins/edmrds/rds-song.py -l                                                                                                       
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                                                           
Can't connect to pigpio at localhost(8888)                                                                                                                             
                                                                                                                                                                       
Did you start the pigpio daemon? E.g. sudo pigpiod                                                                                                                     
                                                                                                                                                                       
Did you specify the correct Pi host/port in the environment                                                                                                             
variables PIGPIO_ADDR/PIGPIO_PORT?                                                                                                                                     
E.g. export PIGPIO_ADDR=soft, export PIGPIO_PORT=8888                                                                                                                   
                                                                                                                                                                       
Did you specify the correct Pi host/port in the                                                                                                                         
pigpio.pi() function? E.g. pigpio.pi('soft', 8888)                                                                                                                     
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                                                           
Traceback (most recent call last):                                                                                                                                     
  File "/home/fpp/media/plugins/edmrds/rds-song.py", line 24, in <module>                                                                                               
    s = bb_I2C.I2C(pi, 23, 24, 600)                                                                                                                                     
  File "/home/fpp/media/plugins/edmrds/bb_I2C.py", line 209, in __init__                                                                                               
    pi.set_mode(SCL, pigpio.OUTPUT)                                                                                                                                     
  File "/usr/lib/python2.7/dist-packages/pigpio.py", line 1296, in set_mode                                                                                             
    return _u2i(_pigpio_command(self.sl, _PI_CMD_MODES, gpio, mode))                                                                                                   
  File "/usr/lib/python2.7/dist-packages/pigpio.py", line 983, in _pigpio_command                                                                                       
    sl.s.send(struct.pack('IIII', cmd, p1, p2, 0))                                                                                                                     
AttributeError: 'NoneType' object has no attribute 'send'                                                                                                               
fpp@FPP:~ $

 

Back to top