logo elektroda
logo elektroda
X

Volumio on Raspberry Pi 4B and Zero 2W - my battles with Volumio.

slawekscorp 2928 41
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • Waveshare touchscreen with Volumio interface playing internet radio

    I picked up a Volumio a couple of years ago. I wrote a bit about it in my topic on guitar amplifiers. For the project I purchased a Rasberry Pi4 B, a Hifiberry DAC2 Pro and an "official" 7-inch touchscreen display. The system that was installed was Volumio 2.917 and I hooked up an encoder and IR receiver. I was going to do the enclosure but the topic was constantly put off until I finally let it go. The Volumio was used successfully for those four years. In time Volumio 3 appeared, but in its initial development phase it lacked the plug-ins I wanted and I let the update go. The topic of Volumio was revived quite recently. I asked my colleague Radek to design an advanced power supply that could switch the Raspberry Pi on and off without fear of damaging the data on the SD card due to improper system shutdown. More on that later.
    On the occasion that I returned to the Volumio theme I decided to make myself one such player for work. Here I felt bad about packing 4B so I purchased a Pi Zero 2W. As a result of various turbulence I have two Pi4B's and two Pi Zero2W's.
    For the 4B I purchased a 3.5inch Waweshare LCD touch panel (B) which communicated with the RPi 4B via SPI. It turned out to be a maximum failure. I passed it on to a colleague who managed it but as far as I know did not run it with Volumio. I went the other way and bought a Waveshare 16340, 4 inch, HDMI, SPI is only used for touch in it. It took a while to get it up and running but I managed. Let me just add that I know Linux poorly, but somehow managed.
    For the Pi Zero2W I purchased OLED 1106 and 1109 displays, one of the 1106s I accidentally crashed so it flew into the rubbish.
    A few words about the DACs. Given the lack of sound on the headphone output of the Hifiberry DAC2 Pro I decided not to buy a dac from that brand. For the small Pi zero2W I bought a Waveshare DAC based on the PCM 5122 from majfrends matching the size of the PI Zero2W, for the large PI 4B I bought two DACs. The first is an IQaudio DAC PLUS and the second is an IQaudio DAC Pro based on the 5242 DACs. All three cards/dACs work without any problems with Volumio, each exposing sound to the headphone jack without any software combinations. In addition, as a test, I connected a small DAC based on the 5102, which you can buy on their portals for 6PLN and on ours for 15PLN. It worked without any problem, I set it up in Volumio as a Hifiberry DAC PLUS.
    I should add that I am not constructing any audiophile equipment here, just utility equipment.
    Now a bit about the Volumio versions. On RPi4B ver1.3 I had version 2.917 installed, the new PI4B I have is ver1.5 and does not allow Volumio 2.917 to be installed.
    So I started installing newer versions and it turns out that the most stable in my case for both versions of Pi4B is 3.832. Earlier versions, except 2.917 were throwing an error installing the touchpad plugin.
    For Pi Zero2W, the best version turned out to be Voumio 3.251. Ver. 3.832 did run on the small PI, but the GPIO Buttons and GPIO Control plugins did not work properly. Some strange states were appearing on the GPIO. Changing to the 3.251 brought an immediate solution. I will be using GPIO control on both the 4B and 2W and this simply has to work if only because the two GPIO signals will work with the power supply.
    Now a bit about the power supply, I'll quote myself from the tube topic:
    "Radek sent drawings of the board. They are already ordered. The atmega board is nearing completion as far as I know. I have ordered all the components for the power supply. Assembly is a matter of 2-3 weeks.
    Why is the power supply so complicated? The whole thing is that I wanted a few more features, Radek added a few more from himself, and it got complicated.
    The principle is simple: pressing the on/off button is to turn on the power to the RPi, during startup is to turn on the backlighting of the buttons and volume knob and to make things more difficult, I proposed to control the LEDs with PWM waveform from 0 to 100%. Pressing the on/off button again will switch off the RPi but this is to be done according to a certain procedure. First, the power supply controller issues a 1sec signal to the GPIO of the RPi responsible for turning off the Volumio, On the next GPIO the Volumio activity signal is issued and its state changes when the system is shut down. The power supply observes this state and when it changes it adds a few more seconds and then shuts down the RPI power supply. Why does it work this way? Because the Raspberry is still calculating something for 5-6 seconds and switching it off at this point could cause a problem with the program. Of course the PWM control works in the opposite direction, i.e. from 100 to 0% and the leds are supposed to fade nicely.
    For proper operation you need GPIO control and this can be achieved by installing two Volumio plugins : GPIO Control and GPIO Buttons.
    The stabiliser function is performed by the LM1084-5V or ADJ version. It has enough reserve current to pull the RPi 4B.
    Radek suggested to use RGB programmable diodes to get proper colour, on my request he made brightness control :D . In the larger Volumio project you can use RGB diodes , in smaller projects on monochrome oleds you can use PWM output.
    As far as I know Radek has designed to switch on the RPi using a powerswitch with current measurement and the overload state is to be signalled by a change of backlight colour.
    We will see how this works in practice."
    All the players will be encapsulated, each with a power on/off button, encoder, IR receiver, LCD or OLED display and some extras. Once all the mechanical components are in place, I will start designing the front panels (front: engraving laminate - brushed aluminium) There will be some 3D printing and that kind of story. The subject is in development.

    Volumio on Raspberry Pi 4B and Zero 2W - my battles with Volumio.
    PCB design with ATmega328P microcontroller and power control for Raspberry Pi
    PCB layout design for a Raspberry Pi power supply with ATmega328P microcontroller
    PCB design with ATmega328P microcontroller and power supply circuit
    PCB for a power supply with ATmega328P and LM1084, designed for Raspberry Pi
    PCB board with labeled components for Raspberry Pi power supply
    PCB rendering with labeled solder points and ATmega328P microcontroller placement
    PCB render with labeled component positions for Raspberry Pi power supply
    Electronic modules connected with jumper wires to a Raspberry Pi Zero 2W
    Raspberry Pi 4B with 4 Waveshare touchscreen and running Volumio system.
    Compact Waveshare PCM5122 DAC on Raspberry Pi Zero2W with external OLED display showing music data.
    Raspberry Pi 4B with Volumio system, touchscreen display and IQaudio DAC
    DAC Pro board attached to Raspberry Pi 4 with visible RCA and jack outputs
    OLED display showing time and IP address, connected to Raspberry Pi

    Cool? Ranking DIY
    About Author
    slawekscorp
    Level 12  
    Offline 
    slawekscorp wrote 280 posts with rating 100. Live in city Warszawa. Been with us since 2009 year.
  • ADVERTISEMENT
  • #2 21708304
    hetm4n
    Level 20  
    Interesting idea with this power supply. I have picoreplayer installed, volumio unfortunately in my case lost out to a paid subscription to support spotfi etc. I guerrilla power mine off the grid, 2 more years and SD still good.
  • #3 21708409
    slawekscorp
    Level 12  
    I was getting tired of waiting for Volumio to shut down and manually switching off the power. It had to be solved somehow in the end.
    The power supply boards are ready, they should be in the country in a few days. I have ordered myself another waveshare DAC in the PI Zero size from majfrends. It's a wonder that this version is not available in Poland. Pi zero2W, a DAC like the one in the picture plus Volumio ver. 3.251, possibly with a 1.3" oled and you can have a nice little player for a little money. Power consumption at start-up is up to 500mA, during operation up to 300mA - measured.

    Waveshare PCM5122 audio board with connected wires on a wooden surface
  • #4 21708577
    Andrzej Ch.
    Level 33  
    Have you tried MOODE Audio Player?
    I have a made player on this system and it works exemplarily, periodic problems after most updates are quickly fixed. I use an RPI 4 with 2GB RAM, a 7 inch touchscreen display and an audio card on an ES9038Q2M
  • #5 21708726
    slawekscorp
    Level 12  
    I was thinking about MOODE, I might give it a try. I'll sort out the power supply and chassis and then sit on MOODE.
  • ADVERTISEMENT
  • #6 21708980
    tytka
    Level 22  
    To be honest, I've been getting together for a few years now to put together a player on RPi and Volumio.
    I've reworked various options in the meantime, but it's finally final. And, in fact, it's nearing completion; all that's left is the finishing work on the front panel.

    I reworked various displays, but eventually came to the conclusion that it was best to go for one with a DSI interface. I decided to make the DAC my own with a PCM5102 chip (cheap, but quite good). Using the plug-ins, it is easy to make extra buttons/encoders, and most importantly, system shutdown. As for the power supply, I decided on an inverter that powers the RPi module, and a small linear power supply that powers the DAC and standby circuit.
    These are the heavily working pictures of my outtakes:
    Inside of a custom case with Raspberry Pi, HDD, and DIY audio electronics
    Audio panel with Volumio touchscreen on Raspberry Pi mounted on tube amplifier
  • #7 21708992
    slawekscorp
    Level 12  
    I went for a single power supply.The LM1084 powers the standby circuit and via the powerswitch will feed power to the RPI. The mentioned LM 1084 has a maximum current of 5A. The Rpi with dac and display consumes 950mA at start-up and afterwards 750- to 850mA. To this you have to add the current of the leds but still the reserve is large. I had the idea of using a Tracopower inverter ( from a demob) but the output current of those available was too low or the input voltage from 18V upwards. The idea is for the circuit to be powered from an AC or DC supply of 12-16V. I made a power supply for the Pi4B on a 1084 some time ago and it works perfectly so in the power supply design such a stabiliser was used. Radek has designed a board for the 1084ADJ version and there is room on the pcb for a precision potentiometer and some additional resistors. I will use the 1084-5V in mine and omit these components.
  • ADVERTISEMENT
  • #8 21709004
    tytka
    Level 22  
    I am very familiar with the LM1084 circuit.
    Originally I also thought about powering the whole RPi from a linear power supply. However, in the end I chose the option with an inverter for the RPI and a linear power supply for the DAC and standby circuit. Of course, the inverter does not work during standby, it is switched on for the active time of the device.
  • #9 21709012
    thereminator
    Conditionally unlocked
    At my place the Volumio is actually just waiting for a case. System version 2 somethingtam (can't remember because I installed it a few months ago) on RPi2+ with HiFiBerry DAC and Waveshare 4.3" touchscreen display on DSI. I've been looking for solutions with system shutdown, but I think I'll end the topic - waiting a while with manual power off after closing the system from the menu satisfies me, as I like simple solutions.
    Waveshare 4.3 touchscreen with Volumio interface and audio cables connected
  • #10 21709033
    slawekscorp
    Level 12  
    In my case, the enclosure will be made of a closed alu profile with a cross-section of 100x200mm and a length of 200-250mm. The front will be printed from transparent pet-g and covered with an engraving laminate - brushed aluminium. I have made panels from such a laminate and it looks cool.
  • #11 21709037
    tytka
    Level 22  
    thereminator wrote:
    I searched for solutions with system shutdown, but I think I'll end the topic - waiting a while with manual power off after shutting down the system from the menu satisfies me because I like simple solutions.


    After the system shutdown command, Volumio shuts down quite quickly; it seems to shut down in a few seconds at most. So all you need is a simple circuit that shuts down the power supply after such a time from the shutdown command.
    I seem to additionally check for the presence of +5V on the raspberry's USB connector.
  • #12 21709044
    slawekscorp
    Level 12  
    On the GPIO strip the 3.3V and 5V voltages do not disappear when the system is shut down, unfortunately. I also wanted to take advantage of this but failed.
  • #13 21709082
    tytka
    Level 22  
    No voltage can be lost on the GPIO. After all, you can power the RPi through this connector (I do so).
    That's why you need to check for the presence of voltage at the USB A connector.

    And on my front, it will be aluminium. But you still need to work on it a bit more :)

    Audio device panel with aluminum finish and display showing a music player interface
  • #14 21709092
    slawekscorp
    Level 12  
    I will connect the power supply to the 5V GPIO. The status of the system, as I wrote earlier will be checked by the Atmega on the GPIO pin. In fact, the Atmega will shut down the Volumio system by doing a shotdown on one GPIO and reading the system shutdown status from another GPIO.
  • #15 21709102
    tytka
    Level 22  
    slawekscorp wrote:
    In fact, the Atmega will be closing the Volumio system


    And do you think it's different with me?
    I additionally (just to be sure) check for the presence of +5V on the USB A connectors, so as not to cut power too early.

    Close-up of a PCB with ATtiny2313 microcontroller and electrolytic capacitors
  • #16 21709107
    slawekscorp
    Level 12  
    I wish I had known earlier that you had made such a control....

    In our power supply it is added a few seconds after the system is turned off until the power is switched off. There are also other 'fiddly' things added and that's why the circuit got a bit complicated.
    Just yesterday I switched off the power to the Pi zero2W already after closing the Volumio but before the green LED went out. When switched on, the RPi did not see the card. Rufus didn't see it either. The card is a Sandisk 128Mb. Perhaps it is a coincidence that it got damaged.
  • #17 21709114
    thereminator
    Conditionally unlocked
    tytka wrote:

    After the shutdown command, the Volumio shuts down quite quickly; it seems to shut down in just a few seconds. So all you need is a simple circuit that shuts down the power after such a time from the shutdown command.
    I seem to additionally check for the presence of +5V on the raspberry's USB connector.


    I get it, but I don't like in modern devices all these unnecessary features like sensing , sleep , hibernation , etc. so I'd like to avoid unnecessary complications and fitting more than I need, since my player will have a traditional "hardware" switch completely cutting off power anyway. The only thing I'm really considering at the moment is whether to change to a larger 7' or 11" display like here .
  • ADVERTISEMENT
  • #18 21709115
    tytka
    Level 22  
    In my case, the Attiny sends the shutdown command, waits for the USB connectors to lose voltage, additionally waits a few more seconds and only shuts down the power to the Raspberry. This is, in my opinion, a safer method than just delaying after sending the shutdown command.

    Added after 3 [minutes]:

    thereminator wrote:
    but I don't like in modern devices all these unnecessary functions like standby, sleep, hibernate etc.

    But after all, I wasn't suggesting you use such functions. It's just that you can use a monostable flip-flop to completely cut off the power, yes a few seconds after pressing the shutdown button.
  • #19 21709128
    slawekscorp
    Level 12  
    In my case, Volumio puts out a high state on the GPIO pin from the moment Volumio itself starts up until it shuts down, Atmega observes the state on this GPIO and adds a few seconds until the power is removed. I will check how the power supply on the USB is related to this and at what point it is disconnected.

    I had a display 7 before but found it not very practical in my case.

    Touchscreen displaying Volumio interface next to connected Raspberry Pi
  • #20 21709138
    tytka
    Level 22  
    I figured it was simpler to check 5V on USB than to add extra functions.

    There's a 4.3" screen on the one I've shown. But I have a 7" too, maybe there will be another version with it.
  • #21 21709141
    slawekscorp
    Level 12  
    These additional functions are the control of LEDs etc. without affecting the RPi control itself.
  • #22 21709147
    tytka
    Level 22  
    Apparently everyone, has found their "best method" :)

    And any data bank you envisage in your solution?
  • #23 21709155
    thereminator
    Conditionally unlocked
    Nowhere do I claim that you were suggesting anything. It's just that after switching off the system with the button you write about, I would then switch the whole thing off with the switch on the 230V side anyway, so I skip this unnecessary extra button - I shut down the system from the menu, wait say a minute after shutting it down and switch it off with the mains. It can't get any simpler than that.
  • #24 21709158
    slawekscorp
    Level 12  
    Turns out I can save songs to the Volumio SD card from my computer via WiFi ( can't remember if there was such an option on the Volumio2) so I don't envisage an SSD. An SD card reader would be useful....
  • #25 21709169
    tytka
    Level 22  
    thereminator wrote:
    Just after switching off the system with the button you write about and so I would then switch the whole thing off with the switch on the 230V side,

    You just wouldn't have to. If the shutdown button was coupled to a monostable flip switch that cuts off the power; then you click on the button, the system shuts down, and after a while the mains power is automatically cut off. What do you think?

    Added after 1 [minute]:

    slawekscorp wrote:
    You would need an SD card reader...

    Then plug it into USB A.

    I prefer to use a drive that I can access externally.
  • #26 21709175
    slawekscorp
    Level 12  
    I would like it to be from the front as a slot in the frontpanel :D Let's see what the possibilities are....
  • #27 21709185
    tytka
    Level 22  
    You can always use a USB card reader on an extension and mount it so that you have a card slot on the frontpanel.

    I chose to use an HDD, and worked it out so that I could access it via an extra USB connector on the back of the unit when it wasn't running. I can then modify the contents of the drive.
  • #28 21709610
    slawekscorp
    Level 12  
    I've downloaded the Moode image, I'll try to get it running on the Pi4B tomorrow. From what I recall I ran Moode a couple of years ago but can't remember why I let go of further attempts.
  • #29 21712326
    slawekscorp
    Level 12  
    Waveshare display showing Moode Audio interface with WDCB 90.9 FM radio station
    I installed Moode a while ago. I'm unlikely to go for this software. First thing: I couldn't get the touchpad to work in the Waveshare display where the touch is on SPI, the second thing is a very strange search for radio stations and these are the stations I'm mainly concerned with. I went into some search option but either I don't know how to search for stations by genre or it's not possible. Perhaps the search engine itself is not able to search for a certain type of music, which is trivial in Volumio. Perhaps this is why I gave up on Moode a few years ago. I'm not saying it's bad software, it just doesn't meet my expectations.
  • #30 21712391
    Andrzej Ch.
    Level 33  
    >>21712326
    Apparently a matter of taste, I happen to prefer Moode, in my opinion a better refined system, maybe the look more clumsy than Volumio. I use a 7 inch LCD with touch (Waveshare 7 inch) 1024 x 600 pixels and it works for me without any problems, with a raspberry Pi 4. I add my own radio stations, because there are only two Polish ones.
    Generally, this player works with my SMB server to dock music from my local network.
ADVERTISEMENT