HQPlayer Upsampling Runs on a Pi4 - Invigorate your digital audio!

Discussion in 'Computer Audiophile: Software, Configs, Tools' started by Woland, Jul 20, 2021.

  1. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    I found the Volumio tips thread to be unmanageable because of the need to go back and correct and update instructions after feedback, a buggy release of Volumio etc. I've decided to make a dedicated thread per tip instead.

    Some SBAFriends 'reserve' initial posts, and I'll try that and treat the first few posts of this thread as an article, with later posts as comments. I'll post comments when there are major updates to the article.

    HQPlayer can make a huge difference to your audio quality. The right filters, applied with a powerful CPU, reconstruct digital music in a way that feels substantially more real and engaging than relying solely on a DAC.

    In this article I'll show how to set up HQPlayer quickly, and the settings I've ended up using, as well as explain the process to get there. I would rate the impact of introducing HQPlayer as similar to what I achieved from a major headphone/speaker upgrade.

    After much experimenting I've found an inexpensive Pi4 is able to run sophisticated HQPlayer digital reconstruction filters that greatly exceed the capability built into DACs. Many of us already have these Pi4's for Pi2AES or other audio HATs, so there is no extra hardware needed and we benefit from the high quality digital outputs.

    Don't follow this thread unless you already have a Pi-based streamer or are set on getting one. HQPlayer is easy to setup and use on your desktop and you'll get most of the benefits of this setup.

    If you're looking to feed upsampled DSD to a DAC, don't follow this guide. The Pi4 is great on PCM, not DSD.


    Highlights of HQPlayer OS:
    * Acts as an endpoint for Roon, Audirvana, BubbleUPNP etc, or can stream audio onto another Network Endpoint like a Pi running Ropieee
    * Upsampling with a lot of flexibility and control available
    * Convolution filters to do DSP correction for headphones and speakers
    * Speaker and matrix processing to mix channels, digitally crossover speakers etc. Not something I've tried.

    Here's a link to the long list

    By reputation HQPlayer is computationally intensive and requires a gaming computer. That isn't true anymore and you can get great performance using a Raspberry Pi 4 to crunch the data. That's fantastic when you already have a Pi4 feeding a Pi2AES, HiFiBerry HAT, a similar audio board or are using a Pi4 to feed a DAC by USB. The Pi4 happily runs high-tap filters, similar to a Chord M-Scaler, including closed form filters similar to the SuperComboBurrito in Schitt's premium DACs.

    Here's how HQPlayer is setup for me: streaming mostly from Roon which transmits a 44.1kHz Tidal or FLAC stream over the network to the Pi, where HQPlayer Embedded runs a high-tap upsampling and DSP filter and passes it onto my Gungnir DAC as 4x upsampled, 176.4kHz PCM.

    [​IMG]

    HQPlayer is very satisfying once it is set up, but it's tough to get started. The terminology, the documentation and the interface is not easy to navigate. Using this guide should mean you can stride past those hurdles.

    HQPlayer runs for 30 minutes at a time without buying a license. A license costs around USD250 which seems fair.
     
    • Like Like x 17
    • Epic Epic x 1
    • List
    Last edited: Nov 13, 2021
  2. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    There are multiple ways to setup HQPlayer in an audio chain. In this article I'm using HQPlayer OS, running on a Raspberry Pi 4.

    HQPlayer OS is a full custom OS built specifically for running HQPlayer Embedded and nothing else.

    To do the setup you’ll need (a) a Pi 4 to run the software, (b) an SD Card, and (c) a computer to burn the software image we’ll download onto the SD-Card and configure the SD-Card. The Pi4 will have to be connected to the network by a cable, and to a DAC by USB or a Pi-Hat like Pi2AES, HiFiBerry etc


    Installing HQPlayer OS on the Pi4

    To start, download the bootable image from halfway down this page:

    https://www.signalyst.com/embedded-install.html

    At the time of writing, the file you want is named hqplayer-embedded-4.24.2-raspberrypi4.7z , but there may be a newer version.

    Optionally you can verify the integrity of the download using the file called

    hqplayer-embedded-4.24.2-raspberrypi4.7z.asc
    and the author's secure key https://www.signalyst.com/JussiLaako-Signalyst.asc


    The file ending in .7z needs to be (1) expanded and then (2) burned to an SD-Card and then (3) configured for the hardware.


    (1) Expanding the .7z file

    You'll need the right software to do this. On a Mac, I installed The Unarchiver.


    (2) Burning to SD-Card

    I used a 32GB card. It is worth getting a fast (class 10) card especially while on trial when you’ll need to reboot often. I burned the file to the SD-Card using balenaEtcher software.


    (3) Configure the Pi hardware

    A HiFiBerry HAT will identify itself to the Pi and should be identified by HQPlayer OS.

    The Pi2AES does not follow the “HAT” specification. There is no ID eeprom on board so you need to do the following to let the Pi know there's a Pi2AES attached:

    Edit the file config.txt on the SD-card and add the following line to the very end

    Code:
    dtoverlay=hifiberry-digi-pro
    
    Then save and exit the editor.

    Other audio HATs will either be automatically recognised like the HiFiBerry, or need setup as per the Pi2AES.


    Finally, eject and move the SD-card into a Pi4, connect it to your network with a network cable, and power it up. HQPlayer Embedded might work out of the box so you can detect it with your player software and it'll flow out to your DAC, otherwise we’ll use the web interface to configure it further. Either way, we'll use the web interface to customise what it does. To get started with the web interface, username is hqplayer and password is password.
     
    Last edited: Jul 23, 2021
  3. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    Quick Start Configuration

    Now power up your pi4 with the SD-Card inserted, and give it a minute to start.


    Detect your Pi / HQPlayer Embedded Install

    You need to find the IP address - something like 192.168.1.31 or 10.10.0.37

    On Android or iOS, the HQPDcontrol app (linked below) will find it

    On a Mac, use terminal to scan for Pi4's
    Code:
    arp -na | grep -i "dc:a6:32"
    
    On a PC, command can scan for Pi4's
    Code:
    arp -a | findstr dc-a6-32
    

    Open that address with a browser to modify settings

    To get started with the web interface, the default username is hqplayer and password is password.

    Go to the configuration tab:

    [​IMG]


    Configure your DAC

    For typical PCM-only DAC, and likely to work on all DACs:

    Backend to ALSA
    Output mode: PCM
    Rate Limit: 192000

    Alsa Backend: HiFiBerry (for Pi4AES, HiFiBerry), or USB device if appropriate


    Configure your upsampling filter
    Focus on 1x filter (used for 44.1k and 48k streams)

    My shortlist for best filters:

    * sinc-L (laggy, but less intensive versions available like Mx)
    * closed-form-M (laggy, Schiit multibit-like filter, with less intensive versions available)
    * poly-sinc-short-LP

    For a 192000 rate limit, using mostly 44.1k streams:

    Dither: NS-9

    You'll want to experiment to find what works best, referring to the descriptions in the Help link at top right.


    Stream and Enjoy..

    You should be able to connect easily via Roon or a UPNP player like Audirvana, BubbleUPNP etc


    .. or play from within HQPlayer


    I find the built-in web interface clunky, but the Android / iOS HQPDcontrol app is worth a try.

    [​IMG]
     
    Last edited: Aug 2, 2021
  4. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    Upsampling or oversampling or resampling or....?

    Unfortunately these words are used inconsistently. I've used upsampling in this article because that's what HQPlayer uses.


    What is this upsampling actually doing?


    A typical audio file has one digital amplitude 'sample' per 44100th of a second. So a high pitched, 10kHz tone is represented by the dots in the upper part of the chart below, with only 4.4 samples per cycle. While the Shannon-Nyquist theorem suggests the original signal might be perfectly reconstructed from this sparse data, various practical issues mean it is a challenge to turn these discrete samples into an accurate analog reconstruction in real time.

    In a system like mine (DAC has input PCM only, input limited to < 200kHz) the HQPlayer upsampling algorithm reconstructs the original signal by adding the extra pseudo-sample data that you see in the middle graph, to create a 176.4kHz signal. This may be further upscaled by the DAC as shown in the lower chart - but the hard work has been done by HQPlayer, leaving very little scope to the DAC for refinement. The analog filters in the DAC will lead to further smoothing of the signal.


    44.1kHz upscaling to 176.4kHz and 384.4kHz - perfect reconstruction
    [​IMG]

    Using HQPlayer means the intermediate step happens outside the DAC, on the Pi4. Without HQPlayer the DAC will do all the upsampling from 44.1kHz itself, and it will be quality constrained by the need to have low lag and use limited processing resources.


    How does HQPlayer on Pi4 compare to a Chord M-Scaler?

    The short answer is that both will run million tap filters, but HQPLayer on a Pi costs less than 1/10 the $4,500 price of an M-Scaler and gives more scope for customisation.

    For more nuanced answers, watch @GoldenOne 's comparison or read Audio Bacon's article.


    How does HQPLayer on upsampling compare to Schiit Multibit DAC filters?

    Schitt's premium DACs (Yggdrasil, Gungnir, Bifrost) include a renowned closed-form upsampling process, designed by @baldr . It's running on a ADSP-21261 chip implementing an 18,000-tap filter. The Pi4 / HQPlayer combo can also run a closed-form upsampling -- but with 4 64-bit CPU's running fast and with access to memory and time (creating lag!), it will run 1,000,000-tap filters -- ultimately it sounds better to me.


    How does HQPlayer upsampling compare to upsampling in Roon, Audirvana, Volumio etc?

    These players have upsampling features, but not the flexibility or output quality of HQPlayer. Your experience may vary. Please share if it does.
     
    Last edited: Jul 25, 2021
  5. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    Reserved for future content
     
  6. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    While it could do with a few rounds of polish and revision, the article is complete enough to share and use for setup. Enjoy!
     
  7. Jerry

    Jerry Friend

    Pyrate
    Joined:
    Apr 8, 2017
    Likes Received:
    1,042
    Trophy Points:
    93
    Location:
    Asia
    Thanks for doing this, buddy. HQplayer is quite daunting for someone like me.

    I am thinking of trying to use foobar to organize my albums, then use HQ to play them. This is from PC btw. Do you know if I can export foobar playlist to HQ?
     
  8. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    You can keep using Foobar and get all the benefits of HQPlayer. You'll just need to switch the output from the current destination (DAC, internal speakers, ...) and to the UPNP connection on HQPlayer's UPNP Renderer. I don't have FooBar2000 myself, but here's a link to what is probably the right way to do it.
     
    Last edited: Jul 22, 2021
  9. dllmsch

    dllmsch Friend

    Pyrate
    Joined:
    Jan 3, 2016
    Likes Received:
    280
    Trophy Points:
    63
    Location:
    Molvanîa
    I tried SoX into BF2 with no success, this seems great.
    Can it play local files on Pi?
     
  10. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    Yes - it has a basic player built in. When I tried playing off the Pi, I prefered controlling it with the app linked below. Playing from Roon, Audirvana or BubbleUPNP gives a much better interface.

     
    Last edited: Jul 23, 2021
  11. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    HQPlayer has a desktop audio player (as the name suggests), but its real strength is upsampling.

    As an alternative to the approach I've described, you could run the upscaling on your desktop computer. That means upscaling will go offline because the computer is rebooting, changing network settings, or has other CPU-intensive tasks. It will also be constrained by computer resources and available network.

    I much prefer having upsampling as an intermediate step between a great player (Roon, Volumio, BubbleUPNP, etc) and the DAC. The HQPlayer OS embedded device is dedicated to upsampling and is always ready to process data for the DAC for any player that wants to activate it.

    As many of us already have Pi 4-based streamers. HQPlayer OS quickly and simply replaces Volumio, Ropieee, etc with no extra hardware required. The one major thing it is lacking is Spotify Connect.
     
    Last edited: Jul 23, 2021
  12. earnmyturns

    earnmyturns Smartest friend

    Pyrate
    Joined:
    Sep 25, 2016
    Likes Received:
    3,218
    Trophy Points:
    113
    Location:
    Palo Alto
    Home Page:
    Thank you for the detailed instructions, I'm definitely planning to try this with my NOS DACs. One question: do you have any concerns with Pi4 temperature when upsampling? I don't have a Pi4 at this location, but the one I have elsewhere runs a bit hot with Ropieee, even thought it's just moving samples from Roon RAAT to the Pi2AES.
     
  13. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    Pi4's have a reputation for runnng hot even without a load. Using HQPlayerOS, I haven't seen any signs of overheating - if it was occurring, there'd be throttling that would disrupt the audio.

    But I've got access to a console now, so will check the CPU load when upsampling. Overheating tends to be caused by load while overclocking, so I'll also check the cpu settings of HQPlayerOS to see if it overclocks.
     
  14. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    I haven't been able to get wifi working on HQPlayer OS, so can't do this testing anytime soon.

    What I have done instead is look at the HQPlayer upsamping on a 2017 laptop. It's running 44.1 PCM to 176.4 PCM as needed for a Schiit DAC, with a taxing sinc-M million-tap filter.. At a 5% cpu load, it looks like this upsampling is not very computationally demanding, and should not tax a Pi4.

    [​IMG]

    I suspect HQPlayer may need a powerful computer only when upsampling PCM to DSD, while for my use case the Pi4 is adequate without a risk of overheating.
     
    Last edited: Jul 28, 2021
  15. quattr0

    quattr0 New

    Joined:
    Jul 2, 2021
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    TX
    i admired your dedication so decided to give it a 2nd try on Pie4 (i tried the laptop before) and for the love of me...I can't tell any difference. I wonder if the awesome RME ADI-2 FS pro DAC nullifies all the changes hqplayer makes.

    Speakers are Focal Aria 926. The RME connects to Denon AVR X3700H's RCA.
     
  16. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    Thanks @quattr0 . Seems like you have an amazing setup!

    HQPlayer is effectively replacing part of the DAC. What you should find is that by changing the HQPlayer settings, you can alter the sound.

    For my DACs, some settings make a hugely positive difference and others sound about the same or worse. Experimentation, based on what others had found worked, led me to use the specific settings shown.
     
    Last edited: Jul 29, 2021
  17. Failed Engineer

    Failed Engineer Friend

    Pyrate Contributor
    Joined:
    Mar 22, 2016
    Likes Received:
    472
    Trophy Points:
    63
    Location:
    Houston
    This is very interesting and I'm curious about it. However, where I use the Pi2AES I need wifi. I'm going to try and figure out how to enable the Pi's wifi in HQPlayer Embedded and hopefully be able to give it a go.

    Thanks for the instructions, they definitely helped and I configured the player in Roon and got the stream playing. It's just I can't connect it to my DAC to listen to it yet.
     
  18. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    It would be great if you can figure out wifi.

    If it helps, here's what I found.. you can login locally as user root with no password. The OS is based on Arch Linux. Trying to set up wifi gave warnings about missing dependencies.
     
  19. SoupRKnowva

    SoupRKnowva Official SBAF South Korean Ambassador

    Pyrate Contributor
    Joined:
    Sep 26, 2015
    Likes Received:
    4,249
    Trophy Points:
    93
    Location:
    Austin, TX
    Does the local playback use mpd? Im wondering if you can use any normal mpd client to control it.
     
  20. Woland

    Woland Friend

    Pyrate
    Joined:
    Jan 13, 2021
    Likes Received:
    1,311
    Trophy Points:
    93
    Location:
    a friendly land
    A classical musician came to visit, and she blind tested some different configurations including HQPlayer. While she saw differences where I could not and ranked some things differently, HQPlayer running the sinc-Mx filter received two thumbs up for its tremendous boost to staging and immersion. That's compared to the Gungnir's internal Super-Combo-Burrito filter, and the Modius internal AKM filter.
     
    Last edited: Jul 31, 2021

Share This Page