All times are UTC+01:00




Post new topic  Reply to topic  [ 60 posts ]  Go to page Previous 1 2 3 4 5 6 Next
Author Message
PostPosted: Wed May 04, 2022 11:24 am 

Joined: Mon Apr 25, 2022 11:19 pm
Posts: 92
When you say headless set up, does that mean the box has no keyboard/mouse/screen attached? I have X windows running and don't need the mouse and keyboard after initial set up. The screen resolution is low unless I have it plugged into the TV when I'm rebooting it. After that I don't use a screen and just use VNC to remote control the desktop if required. I'd love to be able to use this in command line only mode to reduce the load on the CPU, but for now I leave ST minimised on the desktop to reduce the load.

I have continued to use pi as the account on the latest 64-bit OS. It does allow you to specify the main username and password. I have had to enable both ssh and vnc via the Pi configuration utility on the desktop. Would that solve your ssh issue?

I wonder why BUTT is so disruptive to the harmony of the system, I didn't play around with priority levels or anything to see if it was grabbing too much CPU load than it actually required. Such a shame, it really does look useful!

I also had the same problem with qjackctl missing with jackd2. I didn't try jackd1 on the assumption that ST only works with jackd2, so given your very useful insight, I will give jackd1 a try. It might be through jackd1 that I am able to finally route the output of ST to the RCA output jacks for monitoring purposes.

Thanks for this, it's reassuring to know that jack can work with a similar set up!

My source is currently Apple Music on a DAP, I have seen an Apple Music client on Pi so once I get jack working, I may have a play around to see if I can set up Apple Music -> ST -> Liquid Soap -> Icecast
and also at the same time ST -> HifiBerry ADC/DAC audio out jacks

But if Apple Music messes up the audio due to CPU loading then I will have to go back to the DAP again....


Top
   
PostPosted: Wed May 04, 2022 11:43 am 

Joined: Thu Jan 15, 2015 11:19 am
Posts: 193
Yes, headless means without anything. I have only Ethernet, USB audio and power connected.
Using the legacy image, I can start off using SSH, activate VNC and use the VNC to operate ST.

You could use an X-Server that outputs to null and run ST on that, but I'd prefer to see the ST gui. It doesn't eat significant CPU time, IMO.

There is a very nice Airplay server available with shairport-sync. https://github.com/mikebrady/shairport-sync
When using jack, you'd need alsa-loopback again and play into that from shairport-sync and grab the output into jack by using alsa_in or zita-a2j bridge. Because jack depends on synchronized audio devices, this involves some resampling CPU overhead, even if you have both parts running at the same sample rate.

You may consider using some more powerful system like an Intel NUC or so if you run out of CPU power on the Pi.
Do you have CPU cooling? The CPU will throttle down if it gets too hot.


Top
   
PostPosted: Wed May 04, 2022 11:57 am 

Joined: Mon Apr 25, 2022 11:19 pm
Posts: 92
I guess mine is headless too then, it only has power, ethernet and audio cables plugged in. And the HiFiBerry ADC/DAC Pro HAT of course.

I see what you mean now, it saves you having to plug the keyboard/mouse in like I did for setting up purposes.

I did buy a heatsink from HifiBerry but I didn't use it. The steel case they provided seems to give cool air circulation and it doesn't seem to get too hot at all. If high temperatures do cause throttling, I will have to take it apart and fit the heat sink in and see if that helps.

I'll have a look at the Intel NUCs - if the power consumption is low enough for 24/7 operation I may upgrade to that. Trying to keep it down to internet router levels of power consumption or lower if I can :-)

Also, I tried to run jackd1 and this is what happened. Did I enter the command incorrectly?

pi@raspberrypi:~ $ jackd -d alsa -p 4096 -n 4
jackd 0.125.0rc1
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details


JACK is running in realtime mode, but you are not allowed to use realtime scheduling.
Please check your /etc/security/limits.conf for the following line
and correct/add it if necessary:

@audio - rtprio 99

After applying these changes, please re-login in order for them to take effect.

You don't appear to have a sane system configuration. It is very likely that you
encounter xruns. Please apply all the above mentioned changes and start jack again!
pi@raspberrypi:~ $


Top
   
PostPosted: Wed May 04, 2022 12:09 pm 

Joined: Thu Jan 15, 2015 11:19 am
Posts: 193
I did make the changes to the limits to allow realtime audio as given by the output of jack.

And my jack commandline is this:
jackd -R -d alsa -d hw:CODEC -r48000 -p4096 -n3

hw:CODEC is my cheap USB audio device. You should find the correct name of the Hifiberry using aplay -l (ell)


Top
   
PostPosted: Wed May 04, 2022 1:14 pm 

Joined: Mon Apr 25, 2022 11:19 pm
Posts: 92
Thanks, that's helpful. I will give that a try,

I found a USB audio input/mic dongle earlier which I hoped would allow me to listen to the output of ST but it didnt work. It caused the sound card to drop out requiring a reboot.

Since updating the OS and starting afresh yesterday, I noticed a new device appear for card 0.

I have already turned off the audio for that device in /boot/config.txt as advised b the HifiBerry set up guidance. It doesn't seem to cause a problem, but the Alsa Loopbacks are still working ok which is the main thing.

I think for Jack I could simply use one of the loopbacks like hw:2,2 or suchlike for audio input and then use jack to send the audio to something else etc. Actually, if it's working properly, ST could input into Jack, Jack to liquid soap->icecast. Then maybe Jack -> audio outputs for monitoring.

pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: sndrpihifiberry [snd_rpi_hifiberry_dacplusadcpro], device 0: HiFiBerry DAC+ADC Pro HiFi multicodec-0 [HiFiBerry DAC+ADC Pro HiFi multicodec-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
Subdevices: 7/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 2: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
pi@raspberrypi:~ $


Top
   
PostPosted: Fri May 06, 2022 12:45 pm 

Joined: Mon Apr 25, 2022 11:19 pm
Posts: 92
ST is very good at what it does, so good that I could hear wifi and other interference from the DAP audio feed especially when there was any silence. I discovered that the USB outlets on the power strip were the cause. Changing the USB cable to the DAP made no difference, but using a dedicated known clean USB source did work. Now it's silent unless I have the volume turned up to maximum, but it is far better than it was before. And ST may prefer not to process the noise as well.

I also tidied up the Pi a little. I found some running tasks that I do not need, such as modem-manager and CUPS. I have no intention of running modems or printing from the Pi, so I removed them. I think the other running tasks are necessary, so there's nothing else obvious to remove. It may help to reduce pressure on resources on the Pi. I have already noticed that the memory usage has slightly dropped since removing software that is not required.

There is 4Gb installed on the Pi, so everything is running in RAM plus buffer space, leaving about 2Gb free. No use of swap space at all. The current set up seems to use no more than 0.8Gb, so running this on a 1Gb Pi would be tight. I'd recommend at least 2Gb if you want to avoid the use of swap space etc.

No crashes or other issues since the last reboot yesterday. As mentioned before, this is intended to run 24/7.

There is no heat sink nor cooling fan installed at the moment, there are some vents top and bottom of the HiFiBerry supplied steel case which houses both the Pi and the HiFiBerry ADC/DAC Pro.

It is actually possible to check the temperature of the CPU by entering vcgencmd measure_temp

This then returns the temperature of the CPU in degrees Celsius. For my set up, it varies from 62-67c. I understand the Pi will throttle if it reaches 80c. The latest firmware does not allow the CPU to overheat as much as it did when the Pi 4 was first released and reviewed. So far so good.

As we approach summer, if the Pi overheats and starts to throttle, I'll need to look at somehow adding a cooling fan which I hear is far more efficient than just using a heat sink alone.


Top
   
PostPosted: Fri May 06, 2022 2:34 pm 

Joined: Mon Apr 25, 2022 11:19 pm
Posts: 92
I played around with BUTT again to see if I can get rid of the CPU loading issues. It seems to be the only encoder I've found so far that supports AAC+ out of the box so to speak. Playing around with the priority levels (nice) did not make a difference at all, so I'm back to Liquid Soap again.

Through playing with BUTT, it seems that the Alsa Loopback is stuck with a sample rate of 44100, it did not support 48000! So as a result, I have changed ST's input sample rate to 44100 and outputting MP3 at 320K 44100. It seems silly to have the 44100 bottle neck with Alsa Loopback.

Maybe I should try the kind suggestions about using Jack instead!


Top
   
PostPosted: Fri May 06, 2022 3:25 pm 

Joined: Thu Jan 15, 2015 11:19 am
Posts: 193
BUTT eats CPU time regardless of the audio backend. And BUTT didn't show up in Jack. Although it has a PortAudio backend that would allow to use Jack natively, it only showed ALSA and PulseAudio IO.


Top
   
PostPosted: Fri May 06, 2022 3:57 pm 

Joined: Thu Jan 15, 2015 11:19 am
Posts: 193
Quote:
ST is very good at what it does, so good that I could hear wifi and other interference from the DAP audio feed especially when there was any silence.
Indeed. ST is also great at revealing compression artifacts in lossy audio codecs :roll: Hans put together a nice paper: https://www.thimeo.com/blog/audio-proce ... ter-sites/

Over the time I started to re-build my music archive using FLAC, because with ST you can easily tell the difference.


Top
   
PostPosted: Fri May 06, 2022 4:03 pm 

Joined: Thu Jan 15, 2015 11:19 am
Posts: 193
If you want the output of ST to stream to multiroom audio, check out: https://github.com/badaix/snapcast


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 60 posts ]  Go to page Previous 1 2 3 4 5 6 Next

All times are UTC+01:00


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited