Implementation and Installation

This Forum is for discussion about the design and development of Sound Effects Player in the Railway Room
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Implementation and Installation

Post by TerryJC »

Installation instructions and Implementation Notes will be covered in this Topic.

Note: The initial installation described in this post proved to be deficient in a number of functions. Instead use the alternative software and installation instructions described at viewtopic.php?p=3975#p3975 below.

The player is assembled as follows:
  1. Mount the Pimoroni 'Pirate Audio 3 W Stereo Amplifier' Mini-HAT onto the GPIO Pins of the Pi Zero.
  2. Connect two loudspeakers to the terminal on the Mini-HAT.
The software is installed as described below.

Notes:
  • An HDMI compatible monitor and keyboard will be required to perform this setup.
  • A connection to the Internet will be required for Steps 4 to 8. This can be achieved using an Ethernet to USB Adaptor or a WiFI Adaptor plugged into a USB Hub. It is suggested that a standard 'official' keyboard be used, since this has a built-in USB Hub.
Proceed as follows:
  1. Copy the most recent version of The Raspberry PI OS to an 8 GB micro SD Card using the Raspberry Pi Foundation's 'imager' tool. Insert the card into the receptacle on the Pi.
  2. Apply power to the assembly using an approved Raspberry Pi PSU or a regulated 5 V DC supply of at least 2 A.
  3. Carry out the initial configuration of the OS as specified in the startup script.
  4. Type:

    Code: Select all

    sudo raspi-config
  5. Select Network Options - Hostname. Enter 'rrsepi'. Exit raspi-config and reboot when prompted.
  6. Enter:

    Code: Select all

    sudo apt update
    sudo apt upgrade
  7. On completion of the updating process reboot the Pi.
  8. Enter:

    Code: Select all

    sudo apt install git
    git clone https://github.com/pimoroni/pirate-audio
    cd pirate-audio/mopidy
    sudo ./install.sh
  9. On completion reboot the Pi.
  10. Enter:

    Code: Select all

    sudo nano /boot/config.txt
    add:

    Code: Select all

    dtoverlay=hifiberry-dac
    and

    Code: Select all

    gpio=25=op,dh
  11. Copy the tracks to be played to /home/pi/Music and reboot the Pi.
Last edited by TerryJC on 16/08/2020, 8:27, edited 1 time in total.
Terry
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Implementation and Installation

Post by TerryJC »

I now have this working but as yet, no speakers or train sound effects tracks. Once I have obtained a suitable pair of speakers and the tracks to be played, I will set up and configure the player to provide the required functionality.

Note: Once this device has been networked it will be possible to configure it using its own built in webserver.
Terry
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Implementation and Installation

Post by TerryJC »

Although the setup described above worked, it lacked two fundamental functions required for the Railway Room; automatic start on boot up and 'loop-forever'. In practice it proved to be a fair amount of work to research and implement these enhancements, but I happened to find someone who had already done it. The resulting combination is called PIpod-nano and its Git Hub page is at https://github.com/G-a-v-r-o-c-h-e/PIpod-Nano. The developer had used a UPS-Lite Power HAT Board to allow the device to be portable - his isn't needed for the Railway Room since mains power will always be available.

The PIpod-nano also provides one more function which is very useful; it is possible to safely shut-down the Pi by pressing and holding the Play/Pause button for more than three seconds, thus reducing the risk of SD Card corruption.

The installation process is, if anything, simpler than the official Pimoroni Tutorial reproduced in the first post. It recommended that the instructions given at the above link be followed since they will be more likely to be up to date and also if the Git Hub page is taken down, then it will not be possible to follow any instructions given here anyway. Initial setup of the OS is as follows:

Notes:
  • An HDMI compatible monitor and keyboard will be required to perform this setup.
  • A connection to the Internet will be required for Steps 4 to 8. This can be achieved using an Ethernet to USB Adaptor or a WiFI Adaptor plugged into a USB Hub. It is suggested that a standard 'official' keyboard be used, since this has a built-in USB Hub.
Proceed as follows:
  1. Copy the most recent version of The Raspberry PI OS to an 8 GB micro SD Card using the Raspberry Pi Foundation's 'imager' tool. Insert the card into the receptacle on the Pi.
  2. Apply power to the assembly using an approved Raspberry Pi PSU or a regulated 5 V DC supply of at least 2 A.
  3. Carry out the initial configuration of the OS as specified in the startup script.
  4. Type:

    Code: Select all

    sudo raspi-config
  5. Select Network Options - Hostname. Enter 'rrsepi'. Exit raspi-config and reboot when prompted.
  6. Enter:

    Code: Select all

    sudo apt update
    sudo apt upgrade
  7. On completion of the updating process reboot the Pi.
  8. Proceed as described at https://github.com/G-a-v-r-o-c-h-e/PIpo ... atic-setup
  9. On completion reboot the Pi.
Notes:
  • At the time of writing, the author of the code is aware of a mismatch between the Python Versions used when the Lite version of the OS is installed, (see the Issues tab at the GitHub page).
  • There is an as yet unfixed bug in the code which means that when the Volume is set up at boot up, it is then overwritten before playback commences, (see the Issues tab at the GitHub page). This was overcome in the deployed software by modifying the file /usr/local/lib/python3.7/dist-packages/mopidy_raspberry_gpio/ by adding the following just before the while loop:

    Code: Select all

    #Set startup Volume
    #Wait for PIpod-nano startup script to finish
    time.sleep(20)
    os.system("mpc volume 19")
Terry
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Implementation and Installation

Post by TerryJC »

From a software and electronic point of view, the Sound Effects Player is now ready. We now need to agree how it should be packaged and presented for installation. I have recorded a brief video. which shows the device and the current arrangement.
Railway_Room_Sound_Effects.m4v
(2.53 MiB) Downloaded 89 times
If you look closely at the player itself, you will see that it is standing on four pillars with threaded ends. This is the way I did the previous systems; the devices were mounted on a baseboard which was then screwed to the underside of the layout. Is this what we want to do for this? I don't have any suitable 3D printed baseboards, as I did for the Underground and the Milk Shake Train, so this baseboard would have to be cut from a piece of scrap plywood or similar.

The player should be located somewhere accessible to the Duty Manager, because although the playback starts up automatically at boot up, the volume is set to a default value. If this needs to be changed. then the bottom two buttons on the player allow this in real time. Also, although I should be able to ensure that the data on the Pi's SD Card is safe from an uncontrolled shutdown, it might be better for the Pi to be shut down cleanly at the end of each day, rather than just Turning the power off. Unlike the other Pis in the Railway Room, there is some disc access needed at times while running. Shutdown is achieved by pressing and holding the top-left button on the player until the display goes blank (approximately 3 seconds). Power may then be removed when the green LED stops flashing about 10 seconds later.

The speaker wires are retained at the Player end using special clips. Unfortunately, to access these clips requires that the player module is separated from the Pi, so I propose to put four chocolate block terminals on the baseboard so that the speaker cables can be routed under the layout.

Does anyone have any thoughts or comments on the above?
Terry
peter
Posts: 37
Joined: 05/02/2019, 10:11

Re: Implementation and Installation

Post by peter »

Hi Terry
the speakers you have shown look way too big for the purpose of background sound
the idea of sound to the left and right seems good but are you making provision for small speakers at different points so that location specific sounds eg. choir singing in church can occur or bell ringing
is the proposal shown a first step?
would it be possible to add announcements at the station operating on a timed sequence
similarly at the underground station
I think I understood you saying 6 sound outlets
this is what I was trying to get across as what we were looking at would be beyond the sequences of the Toilets for example.
We seem to have thought beyond the brief that Greg was thinking.
so far so good
take care
Peter Hardacre
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Implementation and Installation

Post by TerryJC »

peter wrote: 21/08/2020, 14:04the speakers you have shown look way too big for the purpose of background sound
the idea of sound to the left and right seems good but are you making provision for small speakers at different points so that location specific sounds eg. choir singing in church can occur or bell ringing
is the proposal shown a first step?
This is nothing to do with the Plans that you shared with us a week or so ago. As I mentioned to you in the original email that I sent you on the 14th:
A week or two back Greg asked me to develop a replacement for the Sound Effects player which I have now almost completed. The idea of this is to replace the CD Player that was broken at the time, although I gather that a work-round has been found. The main benefit of this will be that this will have true stereo, so the effects will appear to move from left to right and vice versa, instead of simply coming from the CD players twin speakers that are only a few inches apart.
When the work on this was commenced, I had no idea about your aspirations for the future; you told me those in your response to that email.

The speakers were removed from the Cafe area. Greg mentioned that there was a set there. Smaller speakers would cost money (and presumably be quite poor at reproducing the deeper 'chuff chuff' sounds of the trains).
peter wrote: 21/08/2020, 14:04would it be possible to add announcements at the station operating on a timed sequence
similarly at the underground station
I think I understood you saying 6 sound outlets
this is what I was trying to get across as what we were looking at would be beyond the sequences of the Toilets for example.
We seem to have thought beyond the brief that Greg was thinking.
so far so good
I have no idea what Greg was thinking; he simply asked me to replace the broken player for the train sounds. That is what I have done.

You told me in your earlier response that these requirements were not for this year, but for 21/22 or 22/23, so I hadn't even started thinking about how we would do it, I simply commented on the feasibility. When we get nearer the time, I will need more detail on exactly what you want.

I'm not sure when I mentioned six sound outlets.

Please let me know what you want me to do with the sound system that I have produced.
Terry
peter
Posts: 37
Joined: 05/02/2019, 10:11

Re: Implementation and Installation

Post by peter »

Hi Terry
Yes please if this is available now we will use this currently until we can afford to sort out the ideas that I have mentioned
my apologies for misunderstanding
with regard to six outlets it might have been one of the online projects I looked at for ideas.
Sorry for the misunderstanding

I am concerned about the need to shut the Pi down as a separate action and wait for the screen to go blank. Need to have ready access to switch by
the person closing down at night and switching on in morning
Are still in need of a ply board and if so what size?

Regards
Peter
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Implementation and Installation

Post by TerryJC »

Peter,

There is a button on the player which will shut the Pi down, so as long as the player is accessible to the Duty Manager, it shouldn't be a problem. There are also two buttons to change the volume and one to skip to the next track.

I have some unused floor panels that I can cut up. They are quite thick, but I need that to accommodate the ends of the pillars. The baseboard will be about 10x6 cm or so and there will 4 terminals for the speakers.

I am in the middle of another project at the moment, but I should be able to complete this in the coming week.
Terry
peter
Posts: 37
Joined: 05/02/2019, 10:11

Re: Implementation and Installation

Post by peter »

Hi Terry
sounds like all angles are covered - well done
If you let us know when you are installing then some one could assist you
i will be away from 3rd sept until the following week but Geoff might be able to assist you

regards
Peter
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Implementation and Installation

Post by TerryJC »

peter wrote: 23/08/2020, 12:01If you let us know when you are installing then some one could assist you
i will be away from 3rd sept until the following week but Geoff might be able to assist you
Peter,

Despite the Government's ending of shielding, we are still doing so; my wife's kidney transplant means that she is at a particularly high risk of a serious outcome if she catches the virus. It is for that reason that we have been shielding as a household (we have no granny-flat or other place where Lynn could go to shield on her own). For that reason, I am afraid that I am unable to install the player myself.

However, 'Installation' consists only of screwing the baseboard to a suitable surface, running the speaker cables, connecting them to the terminals, plugging the PSU Brick into the Mains and the other end into the USB Power socket on the Pi. The player will self-start and play the train sound effects in a loop. Shutdown is very easy; I'll post a video here showing what to do.

Sorry about that.
Terry
Post Reply