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

    12.7%
  2. Binaural (headphone) add-in

    14.5%
  3. DSP add-in

    20.0%
  4. Room Correction / REW add-in

    18.2%
  5. Optimizing pi hardware for audio

    52.7%
  6. Comparison of pi vs PC

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

    3.6%
  8. LastFM integration

    1.8%
  9. Spotify

    16.4%
  10. Streaming from PC/Mac to Volumio

    45.5%
  11. Streaming from Android to volumio

    18.2%
  12. Streaming Tidal / Qobuz

    40.0%
  13. API

    5.5%
Multiple votes are allowed.
  1. coin777

    coin777 Acquaintance

    Joined:
    Feb 8, 2019
    Likes Received:
    25
    Trophy Points:
    18
    Location:
    poland
    Just windows and linux, but without vi.
    Never used a MAC
     
    • Like / Agree Like / Agree x 1
    • List
  2. MegaKen

    MegaKen Rando

    Joined:
    Sep 28, 2021
    Likes Received:
    13
    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

    Friend
    Joined:
    Sep 27, 2015
    Likes Received:
    9,704
    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

    Friend
    Joined:
    Jul 9, 2016
    Likes Received:
    2,067
    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 Rando

    Joined:
    Sep 28, 2021
    Likes Received:
    13
    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 Rando

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

    RestoredSparda Acquaintance

    Contributor
    Joined:
    Jan 7, 2021
    Likes Received:
    50
    Trophy Points:
    18
    Location:
    New Richmond, Wisconsin US
    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

    Friend
    Joined:
    Jan 13, 2021
    Likes Received:
    820
    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.
     
    • Like / Agree Like / Agree x 1
    • List
    Last edited: Nov 5, 2021
  9. Garns

    Garns Friend

    Friend
    Joined:
    Jul 9, 2016
    Likes Received:
    2,067
    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 / Agree Like / Agree x 3
    • Epic Epic x 2
    • List
    Last edited: Nov 24, 2021
  10. Metro

    Metro Friend

    Friend
    Joined:
    Dec 27, 2016
    Likes Received:
    1,247
    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
     
    • Like / Agree Like / Agree x 2
    • List
  11. Woland

    Woland Friend

    Friend
    Joined:
    Jan 13, 2021
    Likes Received:
    820
    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.
     
    • Like / Agree Like / Agree x 1
    • List

Share This Page