Using any audio source with HQPlayer - Spotify, Amazon, Apple Music, YouTube Music, Deezer, Soundcloud

Yes, I’m trying to find information how to implement it.

But still I liked how it works is clearly better than the method through the brake Airmusic.

Now I have 2 tasks and life has improved:

  1. How to register in order to enter the SPDIF \ linear is turned on by default, and not activate it each time through the Web Interface. But when the UPNP signal enters the entrance switches to UPNP. It is reproduction and not just when the source connected to the UPNP. If there is no reproduction for UPNP, then the sound comes from SPDIF

HQPlayerd.xml has an attribute: script parameter
A Script or Command to Run When This Input Is Selected.
As I understand it, this is what you need to automatically use SPDIF when loading the system.

Found in the archives HQPE
In the falle hqplayerd.xml-rme

script="amixer -D hw:HDSPMx sset 'System Clock Mode' 'AutoSync' ; amixer -D hw:HDSPMx sset 'Preferred Sync Reference' 'SPDIF' ; amixer -D hw:HDSPMx sset 'S/PDIF Input' 'Coaxial'"/>

and in ordinary hqplayerd.xml

post_script="amixer -D hw:CARD=USBStreamer sset 'miniDSP Clock Selector Clock Source' 'miniDSP TOSLINK Clock'" pre_script="amixer -D hw:CARD=USBStreamer sset 'miniDSP Clock Selector Clock Source' 'miniDSP Internal Clock'" samplerate="192000"/>

But I don’t understand if in these scripts a hint of automatic involvement of a particular entrance …

  1. My system starts simultaneously with the router to which HQPE is connected over the network, but HQPE starts faster than the router raises the network, so the UPNP does not see, the Ethernet wire distorting helps, and then the UPNP receiver is seen.
    Actually, the question is how to write a script and where to insert in order to restart the network after a certain period of time after the start? I tried different commands of restarting the network, but they do not work.

Or maybe it is necessary to execute the command of the automatic reinforcement UPNP

Tell me how best to do it?

Thanks to everyone)

1 Like

Yes, I thought about Camilia, as an option, but as far as I know, it does not work with the transmission on Endpoint over the network, because in my project the end point will be BeagleBone with Pure firmware that is very good in the sound of Endpoint with 8 channel reclocker channel yourself that you can make yourself .
Camilia will only work with a DAC, which operates on a USB connected directly to Rasberpi, and USB in quality in Rasberpi is very far behind the beagleBone. Yes, and DSP needs high -quality and powerful as not to twist for 8 channels, Rasberpi4 will not pull 8 channels normally.

Well, in terms of the quality of the signal processing, I include to the version that it is better today there is no product than HQP.

1 Like

Part of the problem was solved by itself, if the line for the device you need to enter is in the first place, then when HQPE starts, the sound from it starts working automatically, but if you listen through UPnP, then again Toslink has to be activated manually. It remains to solve the problem so that when you stop via UPnP, it automatically starts receiving via Toslink

Are you on HQPlayer OS or on something else? Generally hqplayerd service should start only once the network is properly configured, this is in the hqplayerd service rules. Otherwise you will need to restart hqplayerd instead of restarting network.

How would you know that there’s no more playback over UPnP? You don’t want HQPlayer to switch between the sources between each track with UPnP and so on.

This is no different from pre-amp input selection.

1 Like

Yes, only HQPlayer OS, I saw messages about restarting hqplayerd, is it possible to use a script that will automatically restart hqplayerd after the first start? If so, where do you put it?

Sorry, I didn’t quite understand…
It turns out that if a source is connected to UPnP, does this automatically mean that it is involved? Is it playing or not?

Then is it possible to make the Toslink input automatically activated when disconnecting from the source from UPnP? Although it will probably be so by default.

@jussi_laako
Or about sharing the input of Toslink and UPnP is it more correct to make them work simultaneously and mix in the Matrix? It’s even better, because if the navigation from the head unit says something, it will be heard while listening to music …
To do this, use the Audio input configuration attribute. It is possible to have multiple inputs by using Audio input configuration. It is possible to have 1.3.5 Sub-element "input"
Audio input configuration. It is possible to have multiple inputs by using unique name
attribute for each input element.
As I understand it, we need to assign so that, for example, for UPnP, the input signals are channel 1 and 2
And for TOSLINK 3 and 4?

I wonder how HQPlayer could start before network becomes configured, because it waits for DHCP to succeed…

What kind of network setup do you have?

I suspect you have some kind of multi-homed network setup issue.

What do you mean by “disconnecting from the source from UPnP”?

No not possible, because:

  1. Toslink is has it’s own clock, while UPnP is clock-less, you would have source synchronization issues combining into one separately clocked output
  2. These two sources could be using different source format and could change formats at different times

You need to consider HQPlayer equal to your pre-amp source selection switch. In fact, HQPlayer is pretty much an advanced digital pre-amp.

Such mixing that is commonly performed by OS audio engines is precisely what we want to avoid / get rid of here.

2 Likes

Everything is simple here, HQPE is connected to a mini-router
GL.iNet GL-AR300M16 Mini Router, and since the system is implemented in the car, everything starts to start at the same time after turning the ignition key. Accordingly, HQPE starts faster and does not find DHCP, as I understand it. If you pull out the Ethernet wire, then the UPnP receiver starts to be seen on the network.
Can I set a static IP for HQPE? And also enable static on the router? But I’m afraid it won’t work, because my friend tried to disable DHCP and, according to him, the UPnP receiver on the network stopped seeing each other.
I also tried to restart the port on a timer on the router itself that supports OpenWrt, but so far it has not worked, perhaps that restart command is not enough equivalent to physically disconnecting the LAN from the connector.

When the HQPE receiver is not selected as active in BubbleUPnP or Hi-FI Cast or AirMusic UPnP transmitters.

Then how to do it right? The main task is to receive from UPnP and TOSLINK but without using the WEB interface when switching between them every time.

Yes you can and it should work as long as you also remember to configure gateway and DNS.

You can edit network configuration under /etc/systemd/network and /etc/systemd/resolved.conf

How would HQPlayer know that?

HQPlayer Client or hqp-control2 are the official way to switch, in addition to the web interface. You can also develop your own way if you like, the control API is available.

Yes, thanks for the tip, I’ll try this method. If it doesn’t help, I’ll try harder to restart the network by timer on the router. Or, in the crane, do the launch of the entire server with HQPE on a timer, a little later than the router starts. As they say, you can do it with a sledgehammer (a relay with a timer), but I would like to be more flexible at the program level.

I thought if, as in the screenshot, for example, when I connected to HQPE (green) in AirMusic, then HQPE knows that it was connected to it. Or if you press again and disconnect (white), then HQPE considers that it is disconnected from it.


But probably I was wrong, and HQPE is still connected to it or not until there is a data stream.
But is it not possible, for example, using the Script attribute, to write code like: if UPnP played (data is streaming - playback) then Ok
else activate TosLink
Like this)), I’m not strong in programming. But when a data stream arrives at UPnP, it must also know about it.

I thought if, as in the screenshot, for example, when I connected to HQPE (green) in AirMusic, then HQPE knows that it was connected to it. Or if you press again and disconnect (white), then HQPE considers that it is disconnected from it.

But probably I was wrong, and HQPE is still connected to it or not until there is a data stream.
But is it not possible, for example, using the Script attribute, to write code like: if UPnP played (data is streaming - playback) then Ok
else activate TosLink
Like this)), I’m not strong in programming. But when a data stream arrives at UPnP, it must also know about it.

That is conceptually not how UPnP works. There’s no “connection”.

In UPnP, you have three parties. Media Server, Control Point and Media Renderer. HQPlayer is Renderer. When you play something Control point just tells renderer X to play URI Y from server Z and then it can forget about the thing unless it wants to switch to another track. Which could also be requested by some other control point.

You can try to implement this kind of logic using HQPlayer control API. But it is custom to your specific use case.

It works the other way, renderer requests content from URI as specified by the control point. Each track, or track switch (if you jump back and froth between two tracks) is a new URI.

1 Like

Understood, thanks for the clarification. Can you point me to where to start for learning the HQPlayer control API? Maybe there is some documentation?

Jussi, I always wanted to ask a question, UPnP works over UDP, and UDP is a transmission without data integrity confirmation, this does not affect the sound quality. Is there a comparison and difference in sound quality when comparing UPnP and high-quality, for example, coaxial input?

You can find reference implementation of the control API, along with source code for the hqp-control2 command line utility (included as executable in all HQPlayer Desktop releases) at the end of the page here:

UPnP uses HTTP which in turn uses TCP, so it has all the integrity checks and re-sends in case of errors.

S/PDIF (coaxial or Toslink) input are completely different from UPnP in a way that they are clocked by the source, while UPnP is clocked by the output device.

How much this makes difference depends on how they are used. If both go through HQPlayer, there is practically no difference since the input and output clock domains are separate. On most DACs though, with S/PDIF the conversion clock is reconstructed from the source clock by using a PLL which has jitter implications compared to for example USB or network (Ethernet).

2 Likes

By the way, all of a sudden, who didn’t know, it’s much more convenient to edit hqplayerd.xml by taking it from the backup archive and after changing it, putting it back into the archive and restoring from it. And you do not need to connect the monitor output directly to the HQPE server

And another way is to ssh

For HQP OS, need to hookup monitor and keyboard once, just to create a new user.

Then ssh after that

Unfortunately, this is of absolutely no use, all rights are curtailed, nothing can be changed and edited, it does not see alsamixer, it does not allow editing network configuration files. I have to set everything up via an HDMI monitor.

Doesn’t work with teapot

I edited 25-wired-local.network in the same way as mentioned on audiofilsatal
I have his text

[Match]
Name=br0

[Network]
DHCP=no
LinkLocalAddressing=fallback
MulticastDNS=yes

Address=192.168.1.8/24
Gateway=192.168.1.1
DNS=192.168.1.1

DHCP turned off in the router, it has the address 192.168.1.1

In /etc/systemd/resolved.conf I don’t understand what to change at all…

You can, no different than doing it from a local console.

Google is your friend on how to configure network for systemd-networkd and systemd-resolved

I just draw boundary that providing support for “how to configure a Linux system” outside of my support scope. This is not anymore related to HQPlayer.

2 Likes

I can do it via ssh. As I mentioned, you need to first create a user. You probably tried to ssh as root, which will not work

1 Like

Everything is fine, I set up a static IP and now everything works right away at startup … super …

Of course, I created a new user, but nothing can be done through it, I type the same command, on behalf of ROOT directly via HDMI, a command, for example, alsamixer -c 1, is executed, but there is no such directory in PUTTY through a new user, there is no such directory at all. And so with any team.

1 Like