Moode Forum
[SOLVED] Cambridge Audio Amplifier Control - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: [SOLVED] Cambridge Audio Amplifier Control (/showthread.php?tid=6946)



Cambridge Audio Amplifier Control - pkdick - 09-27-2024

Hello,

Using Moode 8.3.7 32 bit I could switch on my Cambridge Audio Amplifier using its Control bus (I found the enclosed python scripts after an internet search): since I switched to Moode 9.10 64 bit, the python script does not work anymore and as a linux newbie, I am unable to debug the issue. Could someone give me a piece of advice ? I tried to let a message on the web page of the developer but without success until now...

Thank you in advance.


RE: Cambridge Audio Amplifier Control - TheOldPresbyope - 09-27-2024

(09-27-2024, 11:10 AM)pkdick Wrote: Hello,

Using Moode 8.3.7 32 bit I could switch on my Cambridge Audio Amplifier using its Control bus (I found the enclosed python scripts after an internet search): since I switched to Moode 9.10 64 bit, the python script does not work anymore and as a linux newbie, I am unable to debug the issue. Could someone give me a piece of advice ? I tried to let a message on the web page of the developer but without success until now...

Thank you in advance.

There's no meat here, not even a bone here for us to chew on. The Python scripts look reasonable on the face of it but have dependencies and need configuration. What specifically have you done in your moOde 9.10 installation????

Looking through the REAME.md file, the only thing which jumps out at me is that the scripts assume you are user "pi" with home directory "/home/pi".

Regards
Kent


RE: Cambridge Audio Amplifier Control - pkdick - 09-28-2024

Dear Kent,

My raspberry is connected to my Cambridge Audio Amplifier through a GPIO to the Amplifier 's control bus. Using a 32 bit version of Moode, I could switch on my amplifier using the "ca_amp_ctrl_rpigpio.py" script: changing to the 64 bit version of Moode, and doing exactly the same action, it does nothing; no message error but the Amplifier does not start.
The command that I use, using SSH, under the directory where I extracted the zip, is "python3 ca_amp_ctrl_rpigpio.py --pin 21 ampon".
"Pi" seems to me the right user, and I will move the script to /home/pi directory to check if that changes anything.
Best regards,


RE: Cambridge Audio Amplifier Control - Nutul - 09-29-2024

If you specified another user(as it is the modern way of doing it, after the security rework of the PI team) and you create a brand new (as it woun't exist...) /home/pi directory, you'll run into a new pile of problems.
The best way of fixing the problem would be that of replacing all the occurrencies of /home/pi with /home/<your username>. Although it is a quick and dirty fix, this I agree upon.


RE: Cambridge Audio Amplifier Control - Tim Curtis - 09-29-2024

(09-27-2024, 11:10 AM)pkdick Wrote: Hello,

Using Moode 8.3.7 32 bit I could switch on my Cambridge Audio Amplifier using its Control bus (I found the enclosed python scripts after an internet search): since I switched to Moode 9.10 64 bit, the python script does not work anymore and as a linux newbie, I am unable to debug the issue. Could someone give me a piece of advice ? I tried to let a message on the web page of the developer but without success until now...

Thank you in advance.

Post a link to the dev's webpage.


RE: Cambridge Audio Amplifier Control - pkdick - 10-01-2024

(09-29-2024, 12:26 PM)Nutul Wrote: If you specified another user(as it is the modern way of doing it, after the security rework of the PI team) and you create a brand new (as it woun't exist...) /home/pi directory, you'll run into a new pile of problems.
The best way of fixing the problem would be that of replacing all the occurrencies of /home/pi with /home/<your username>. Although it is a quick and dirty fix, this I agree upon.

Hello Nutul,

Thank you for your comments. 

When I flashed the Moode Software on my SSD, I used "pi" as the user, si I hope doing this way allowed me to  avoid the issues that you described. As a Linux newbie, I also do not know to check whether or not I have such problems in my Moode installation.

Best regards


RE: Cambridge Audio Amplifier Control - pkdick - 10-01-2024

(09-29-2024, 10:19 PM)Tim Curtis Wrote:
(09-27-2024, 11:10 AM)pkdick Wrote: Hello,

Using Moode 8.3.7 32 bit I could switch on my Cambridge Audio Amplifier using its Control bus (I found the enclosed python scripts after an internet search): since I switched to Moode 9.10 64 bit, the python script does not work anymore and as a linux newbie, I am unable to debug the issue. Could someone give me a piece of advice ? I tried to let a message on the web page of the developer but without success until now...

Thank you in advance.

Post a link to the dev's webpage.

Hello Tim,

Please find the developer's link : https://github.com/damirsamardzic/pi_hifi_ctrl

As far I understood the script, this is a fork to a first script from Andrew bolin that was using the pigpio library replacing it with the RPI.GPIO library as The default pigpio collides with HAT DACs, for example HiFiBerry DAC2 Pro. Using RPi.GPIO there is no such issue".

Thank you for the support you may bring to me.

Best regards,


RE: Cambridge Audio Amplifier Control - Tim Curtis - 10-01-2024

It looks like that script is using Broadcom physical pin numbering and not GPIO channel numbering otherwise there would be this line of code 


Code:
# Use SoC pin (GPIO channel) numbering
GPIO.setmode(GPIO.BCM)

so in your command

Code:
python3 ca_amp_ctrl_rpigpio.py --pin 21 ampon

Pin 21 refers to physical pin number 21 on the 40-pin header. This maps to GPIO 9 (MISO). According to the link below GPIO 9 is part of the SPI (Serial Peripheral Interface) and MISO stands for Master In Slave Out.
https://www.tomshardware.com/reviews/raspberry-pi-gpio-pinout,6122.html

I don't know what this means since I don't have much experience with GPIO programming but maybe a pin other than 21 needs to be used?


RE: Cambridge Audio Amplifier Control - pkdick - 10-01-2024

Hello Tim,

Following your advice I plug the "standard" GPIO indicated by the developer (i.e. GPIO 4 so number 7 according BCM), and it works ! I do not why it worked before with the 32 bit version of Moode, but never mind !

Thank you again for ypur support!