Volumio Streamer Configuration Tips

Discussion in 'Computer Audiophile: Software, Configs, Tools' started by Woland, May 19, 2021.

Tags:
?

Help prioritise the tip writeups.. which would you value most?

  1. Securing Volumio

    11.5%
  2. Binaural (headphone) add-in

    13.1%
  3. DSP add-in

    21.3%
  4. Room Correction / REW add-in

    16.4%
  5. Optimizing pi hardware for audio

    52.5%
  6. Comparison of pi vs PC

    21.3%
  7. Amplifier auto power-on, power-off

    3.3%
  8. LastFM integration

    3.3%
  9. Spotify

    14.8%
  10. Streaming from PC/Mac to Volumio

    41.0%
  11. Streaming from Android to volumio

    16.4%
  12. Streaming Tidal / Qobuz

    36.1%
  13. API

    6.6%
Multiple votes are allowed.
  1. coin777

    coin777 Acquaintance

    Joined:
    Feb 8, 2019
    Likes Received:
    34
    Trophy Points:
    18
    Location:
    poland
    Just windows and linux, but without vi.
    Never used a MAC
     
  2. MegaKen

    MegaKen New

    Joined:
    Sep 28, 2021
    Likes Received:
    24
    Trophy Points:
    8
    Location:
    Philadelphia, PA
    Can someone help me - when I put files on the INTERNAL (on the sd card), in every folder Volumio instantly generates these "ghost files" for every track that start with "._"
    I don't see them in finder (I put files there via smb through Mac finder), and the regular files are still there and work well. But every album looks like this. How do I get rid of them or prevent them from being generated?

    [​IMG]
     
  3. Thad E Ginathom

    Thad E Ginathom Friend

    Pyrate
    Joined:
    Sep 27, 2015
    Likes Received:
    14,134
    Trophy Points:
    113
    Location:
    India
    In Unix/Linix, filenames beginning with a "." are not visible on a normal file listing. It's a way of hiding files. Not really for security, because everybody knows about it, and you can see them if you ask with the right options. It slightly helps against accidental overwriting or deletion.

    I think it developed to keep, for instance, listing of your home directory, where there might be many such configuration files, visually tidy.

    GUI file managers will have an option called like "show system files."

    The ls command will show them with the -a option.
     
  4. Garns

    Garns Friend

    Pyrate
    Joined:
    Jul 9, 2016
    Likes Received:
    2,483
    Trophy Points:
    93
    Location:
    Sydney, AUS
    This is OSX littering the share with metadata files. If you mount the volumio Internal Storage share in Finder, open a Terminal and type in
    Code:
    /usr/sbin/dot_clean -m /Volumes/Internal\ Storage
    and press return, that should get rid of them.

    To stop them coming back you can try opening a Terminal and typing in
    Code:
    defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
    and press return. Log out and back in again and see if that fixes it. If not, it's possible to edit the samba config file on your PI to prevent the files being created, and I can describe how to do that, but that seems like a tier 2 solution to me.
     
  5. MegaKen

    MegaKen New

    Joined:
    Sep 28, 2021
    Likes Received:
    24
    Trophy Points:
    8
    Location:
    Philadelphia, PA
    Cool, thanks I'll try these.
    Weird that Volumio is not hiding them by default (like finder etc)
     
  6. MegaKen

    MegaKen New

    Joined:
    Sep 28, 2021
    Likes Received:
    24
    Trophy Points:
    8
    Location:
    Philadelphia, PA
    @Garns you're amazing that totally worked out
     
  7. RestoredSparda

    RestoredSparda Friend

    Pyrate
    Joined:
    Jan 7, 2021
    Likes Received:
    3,638
    Trophy Points:
    93
    Location:
    WI
    Hi @Woland! Do you have a recommended way to implement volume attenuation in Volumio?

    I know you can use the built-in digital volume adjustment if you select software instead of none, or hardware, however I wasn't sure if this would cause a reduction in quality.
     
    Last edited: Nov 2, 2021
  8. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    If using a USB connection, maybe your DAC provides hardware volume control?

    Software volume diminishes dynamic range which many find concerning.. I don't.

    What is worrying is that Volumio's software volume control conflicts with a bunch of useful addins. I encountered problems with brutefir for headphone / speaker dsp, for example.
     
    Last edited: Nov 5, 2021
  9. Garns

    Garns Friend

    Pyrate
    Joined:
    Jul 9, 2016
    Likes Received:
    2,483
    Trophy Points:
    93
    Location:
    Sydney, AUS
    So here's a fun tip. I have been a bit annoyed by the fact that Volumio on the PI2AES sounds better playing back from the local SD card than streaming from a NAS. The thing is that it's super inconvenient to copy things over and you don't particularly want to be repeatedly writing to the internal storage as it has a fairly low lifespan.

    So I thought: why not set up a ramdisk on the Pi, copy things there and play from that? Here's how I did this, in a way that makes it literally no effort: I queue some files from the NAS, hit a key, and it just happens automatically. I should say that I am using ncmpcpp as my desktop client and this approach relies quite heavily on that, so it might need some tweaking and/or be impossible if you access your volumio in some other way.

    Step 1: setting up a ramdisk

    We will be working on the PI over ssh. First let's set up the ramdisk. We need a mount point:
    Code:
    sudo mkdir /mnt/ramdisk
    Now we need to attach this to a ramdisk:
    Code:
    sudo nano /etc/fstab
    This is your file table. Add the following line to the bottom
    Code:
    tmpfs   /mnt/ramdisk            tmpfs   rw,size=1536M 0 0
    You can change the size to taste. I only have a 2Gb RPi so didn't want to go overboard. With a 4Gb RPi you could probably go to 3G instead of 1536M.

    Reboot; you now have a shiny ramdisk in /mnt/ramdisk. Next, let's make this visible to MPD so you can play music from it:
    Code:
    cd /var/lib/mpd/music
    ln -s /mnt/ramdisk RAMDISK
    Now once you've populated the ramdisk with some files and updated the database, you will be able to play them in mpd. But how to populate the ramdisk?

    Step 2: the ramload script

    One possibility would be to expose the ramdisk as a network share and copy files onto it from your laptop. But that seems like a pain. Let's write a script instead that does the job for us. We are still on the Pi over ssh.
    Code:
    cd ~
    nano ramload.sh
    
    Now enter the following script:
    Code:
    #!/bin/bash
    
    rm /var/lib/mpd/music/RAMDISK/*
    
    mpc --format %file% playlist | while read line ; do
      cp "/var/lib/mpd/music/$line" /var/lib/mpd/music/RAMDISK
    done
    
    mpc update --wait RAMDISK
    mpc clear
    mpc ls RAMDISK | mpc add
    mpc play
    
    What does this script do? Well, when you run it, it zaps the contents of the ramdisk, then copies everything that's in the current MPD playlist to the ramdisk, then replaces the current playlist with the files on the ramdisk and starts playing. You can try this out now. First make the script executable:
    Code:
    chmod a+x ramload.sh
    
    Now queue some files to play in MPD, and from your shell on the Pi run
    Code:
    ./ramload.sh &
    After a copying delay, you should hear the music flow, playing from the new ramdisk.

    Step 3: automating the ramload script

    Okay, this is good, but it's a pain to have to run this script by hand to make things copy. Could we set it up so we just hit a key and it happens? In fact, yes, if you use ncmpcpp as your mpd client on a Mac/Linux system. How? Well, in ncmpcpp you can bind keys to shell commands. However, ncmpcpp runs on my desktop, not on the Pi, and so we need to send a signal to the Pi to tell it to run the script. We can do this using a TCP/IP packet.

    So first, we need to set up the Pi to run the ramload script every time we receive a packet on a given port. Still on the Pi over ssh.
    Code:
    apt-get install socat
    This is a package that lets us trigger our script from an incoming TCP/IP packet. Let's set up a service to do this in the background.
    Code:
    cd ~
    nano ramload.service
    
    Now enter the following:
    Code:
    [Unit]
    Description=Ramload daemon service
    
    [Service]
    Type=simple
    ExecStart=/usr/bin/socat -u tcp-l:6789,fork system:/usr/bin/ramload.sh
    
    [Install]
    WantedBy=multi-user.target
    
    Now we need to install everything:
    Code:
    sudo cp ramload.sh /usr/bin
    sudo cp ramload.service /etc/systemd/system/
    sudo chmod 644 /etc/systemd/system/ramload.service
    sudo systemctl start ramload
    sudo systemctl enable ramload
    
    Okay, now we're done with the Pi. From your desktop computer, you can try this out. From a shell prompt, enter
    Code:
    nc volumio 6789 &
    
    This should trigger your ramload script remotely. We are nearly there! The last step is to bind this command to a key in ncmpcpp on your desktop computer.
    Code:
    nano ~/.config/ncmpcpp/bindings
    
    and enter
    Code:
    def_key "ctrl-d"
      run_external_command "nc volumio 6789 &"
    
    Of course, you can use whatever key you like to do this, though ncmpcpp doesn't leave that many unused to choose from. So now in ncmpcpp, I can queue an album from the NAS, hit Ctrl-D, and it copies it to the Pi ramdisk (which is pretty fast) and starts playing. Easy!

    There are a couple of foibles with this setup. First, if you have files on the ramdisk in the playlist, then running the ramload script will not preserve them (they get zapped as the first step). I see this more as a feature than a bug: once I've finished album 1, I queue up album 2 and hit Ctrl-D, and album 1 gets cleared from the playlist when album 2 gets loaded.

    The other thing is that the ordering of your playlist will not be preserved when you hit Ctrl-D; it will get reset to the natural ordering. This doesn't bother me as I listen to whole albums in the natural ordering anyway.
     
    • Like Like x 3
    • Epic Epic x 2
    • List
    Last edited: Nov 24, 2021
  10. Metro

    Metro Friend

    Pyrate
    Joined:
    Dec 27, 2016
    Likes Received:
    1,590
    Trophy Points:
    93
    Location:
    San Francisco
    Volumio just got updated to Volumio 3. It is a complete overhaul and the outgoing version is no longer maintained. Some of the tweaks in this thread may stop working or may need modifying. Volumio 3 also has a new, incompatible plugin system. I haven't tried it yet (have been running RoPieee lately).

    https://community.volumio.org/t/what-will-change-with-volumio3/51233
     
  11. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    I hope someone will do a technical review. There are broad statements about rewrite and changes to the system audio, but it would be good to know the specific technical changes as well as getting softer impressions of the user experience.
     
  12. KoruMatt

    KoruMatt New

    Joined:
    Jun 28, 2023
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Australia
    Great thread and excuse me if I have missed a post ...
    I have a Mercury2 with Pi CM$ included and have seen lots of general comment about adding an NVME drive as a music library but cannot find a specific guide on the coding required. I am also wondering about power consumption and the ability of the Mercury board to cope. I touched base with Pi2Designs but they don't offer a solution (is that a red flag?)
    I'd love to use an internal drive and not need an external USB one!
     
  13. Azimuth

    Azimuth FKA rtaylor76, Friend

    Pyrate
    Joined:
    Nov 9, 2015
    Likes Received:
    6,837
    Trophy Points:
    113
    Location:
    Nashville, TN
    Home Page:
    It more or less depends on your Linux distro. There is no coding required usually, except maybe to format the drive in EXT4, but FAT32 will work as well. And whatever your distro is (Volumio, moOde, Roon), there is a documented way to add space for internal drives and also make them shared drives on your network so you can read/write from them.

    But as soon as you add an M2 drive, it should be available. M2 is usually the main internal drive since it is faster and then use external for storage since speed is not so much an issue with streaming music files. But yes, you can likely find an M2 NVME drive big enough for both booting and for storage.
     
  14. KoruMatt

    KoruMatt New

    Joined:
    Jun 28, 2023
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Australia
    Thanks for getting back to me. I understand there are documents about but I am having trouble locating them! I wasn't thinking of the NVME as a boot drive since the current SD card boot drive seems fine and any rewriting of the OS can't ruin the music library if they are separate. It was really just for the convenience of an all-in-one solution and perhaps there might be an improvement in the audio? So if you have an idea of where the Volumio/Mercury docs are that would be great!
     
  15. Azimuth

    Azimuth FKA rtaylor76, Friend

    Pyrate
    Joined:
    Nov 9, 2015
    Likes Received:
    6,837
    Trophy Points:
    113
    Location:
    Nashville, TN
    Home Page:
    All I know is that most M2 drives are pre-formatted to FAT32 for the entire drive. Once you turn off your Mercury M2, install it, boot it up, whatever Linux based distro should auto mount it and make it useable for storage. If you have questions specifically about Volumio, you might have better luck in their community forum. But it should work just like if you plugged in any internal or external drive. If it DID NOT auto mount and required going to the terminal to mount, I would be greatly surprised.
     
  16. caute

    caute Lana Del Gayer than you

    Pyrate Contributor
    Joined:
    Jul 12, 2022
    Likes Received:
    1,990
    Trophy Points:
    93
    Location:
    The Deep South
    ok, 8 pages and several web searches later and still don't know the command to ssh into volumio via macOS... anyone know the magic line?

    already got openssh and dl'd dependencies. it should just need that line now.

    and what in your opinions are the top 2 or 3 tips ITT to increase SQ? I already did the @Garns plugin trick, which is just ab the only thing I was able to do, not having ssh access to volumio lol
     
  17. Gazny

    Gazny MOT: ETA Audio

    Pyrate Contributor
    Joined:
    May 11, 2020
    Likes Received:
    2,209
    Trophy Points:
    93
    Location:
    open sky
    You must enable ssh via the web page first than you can follow the guide here
    https://volumio.github.io/docs/User_Manual/SSH.html
     
  18. caute

    caute Lana Del Gayer than you

    Pyrate Contributor
    Joined:
    Jul 12, 2022
    Likes Received:
    1,990
    Trophy Points:
    93
    Location:
    The Deep South
  19. Abhishek Chowdhary

    Abhishek Chowdhary Friend

    Pyrate
    Joined:
    Sep 27, 2015
    Likes Received:
    420
    Trophy Points:
    63
    Location:
    India
    Open a terminal on mac
    ssh volumio@enter_volumio_ip
    Password is volumio
     
  20. TheloniuSnoop

    TheloniuSnoop Friend

    Pyrate Contributor
    Joined:
    Oct 15, 2015
    Likes Received:
    588
    Trophy Points:
    93
    Location:
    Gold Canyon, AZ
    Since I'm purdee ignurn't with this digital stuff, I was wondering if Tidal HiFi Plus works with Volumio.
    Also, what's this Volumio 2 thingy?
     

Share This Page