All times are UTC+02:00




Post new topic  Reply to topic  [ 59 posts ]  Go to page Previous 1 2 3 4 5 6 Next
Author Message
PostPosted: Sun May 01, 2022 3:33 pm 
User avatar

Joined: Sun Dec 23, 2018 7:44 pm
Posts: 460
Location: Texas, USA
I also couldn't manage to solve my buffer issues with my Pi4 and HiFiBerry digi i/o. I'm watching this thread in hopes you or somebody else with more experience in Linux than me can figure it out. Best of luck!


Top
   
PostPosted: Sun May 01, 2022 8:03 pm 

Joined: Mon Apr 25, 2022 11:19 pm
Posts: 77
Quote:
I also couldn't manage to solve my buffer issues with my Pi4 and HiFiBerry digi i/o. I'm watching this thread in hopes you or somebody else with more experience in Linux than me can figure it out. Best of luck!
I think your luck may have helped me this evening as I believe I may have now resolved it.

So there was a couple of things I needed to do.

- Reduce sound card sample rate on ST to reduce load on the CPU. I stepped down from 192Khz to 48Khz (which matches the output of my stream - MP3 320K at 48Khz)

- Run Pulseaudio as a daemon as before but with higher priority. So I ran it again by entering pulseaudio -D --high-priority

Then when I tried again, I didn't hear any stuttering.

I will be testing for a while longer to make sure I am not dreaming ;-)

Let me know if this works for you!


Top
   
PostPosted: Mon May 02, 2022 1:24 pm 

Joined: Mon Apr 25, 2022 11:19 pm
Posts: 77
I have run pulseaudio -D and the issues have not returned. I believe Pulseaudio was struggling to work with an input sample rate of 192Khz which it was then trying to downsample to 44.1Khz then 48Khz. So my advice, like others have been told for other operating systems, is to keep both input and output sample rates the same.

Don't forget that I use Alsa Loopback to support this set up. This is done by running 'sudo modprobe snd-aloop' - this seems to have helped me more than Jack which was very troublesome to get to work on this set up.

Also, keep an eye on the CPU utilisation graphs in ST. On the Pi4 4Gb RAM, it seems to work fine as long as it does not go too far beyond 60%. Anything higher than that, the audio starts to exhibit stutters and pops. I noticed this when I tried to increase the audio quality from 100% to higher up. I also have the CPU setting on low for Pi4 and use two threads with subthreads. Any more than that and it starts suffering again.

I also have to run things in a specific order. Icecast will start up automatically, but I have to run a short darkice script from a command line. Once that's up and running, I will then run ST from the command line. If I run ST before darkice, ST will fail to work. So it's really important to do things in the right order.

ST stalls if I try to run low latency output on the HifiBerry RCA outputs so I can monitor, it really stutters and struggles to work. So this is an area to continue working on, to find a way to be able to monitor the output via the HifiBerry RCA output jacks.

Otherwise, the sound is amazing, I'm using the web radio presets such as the Dutch Moose ones which really makes the music sing. I could never go back to standard audio distribution without using ST, it makes such a difference. Even though I am a home hobbyist playing around with this as opposed to someone running a commercial radio service, I have bought licences to support the developers of this fine product.

Asides from sorting out monitoring output as mentioned earlier, it's almost time to see if there's a way to make the stream externally accessible but it's not high priority. It will be high priority if I decide to get a mixing desk, microphone, DJ software etc ;-) It's all great fun.

I also want to look at upgrading the codec from MP3 to AAC/Flac, as my internet radios support those codecs too.

Now I can turn on my internet radios around the house and instantly listen to what's coming out of my HiFi :-) The audio is actually coming from the outputs of my amplifier, so I have to turn it on for this to work, so something else I'm going to look at is how to maintain hifi audio quality whilst figuring out a way to split the output from my DAP to feed both the amplifier and the Pi4 without any reduction in quality, as I do like high res music. So time to have a look around and see what solutions are out there, seems wasteful to have the amplifier on for many hours, it does use some power even if the volume is turned down to 1% to stop it going into standby.

I hope my various posts here have been helpful for others also trying something similar. I am more than happy to talk to anyone here about my setup or help out with any troubleshooting.

I will continue updating with any changes/improvements I have made.

Good luck everyone!


Top
   
PostPosted: Mon May 02, 2022 8:11 pm 

Joined: Mon Apr 25, 2022 11:19 pm
Posts: 77
I found a guide that explains step by step how to compile a version of Darkice that will support AAC. https://github.com/Laav/darkice14-libaacplus-rpi-guide

Sadly, something in that process now stops ST from running. So I now have a setup which simply broadcasts the audio as received without any of the lovely ST processing.

I noticed that aplay -l shows that the HifiBerry card has moved from card 0 to 1 (swapped with the alsa loopback) and I updated asound.conf but it has made no difference.

pi@raspberrypi:/etc $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Loopback [Loopback], device 0: 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
card 0: 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
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
pi@raspberrypi:/etc $


Something is making ST unhappy!

pi@raspberrypi:~/Downloads $ ./stereo_tool_gui_pi2
Thimeo Stereo Tool 9.90 (for Linux) (C) Thimeo Audio Technology, 2001-2022
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.front.0:CARD=1'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround51.0:CARD=1'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround51.0:CARD=1'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround40.0:CARD=1'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround51.0:CARD=1'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround51.0:CARD=1'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround51.0:CARD=1'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround71.0:CARD=1'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Segmentation fault

So back to the drawing board as they say!


Top
   
PostPosted: Mon May 02, 2022 10:48 pm 

Joined: Mon Apr 25, 2022 11:19 pm
Posts: 77
I've moved the HifiBerry card back to device number 0 in case ST was expecting it there, still no dice.

I don't understand why following instructions to create a version of Darkice 1.4 to support AAC+ would stop ST from working. The other thing it did was install Supervisor to enable darkice to automatically start.

This is a strange one and 'segmentation fault' does not give me many clues as to where to look for issues.


Top
   
PostPosted: Tue May 03, 2022 11:20 am 

Joined: Mon Apr 25, 2022 11:19 pm
Posts: 77
Output from gdb:

pi@raspberrypi:~/Downloads $ gdb stereo_tool_gui_pi2
GNU gdb (Raspbian 8.2.1-2) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from stereo_tool_gui_pi2...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/pi/Downloads/stereo_tool_gui_pi2
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0xb6acc440 (LWP 6356)]
[New Thread 0xb62cb440 (LWP 6357)]
Thimeo Stereo Tool 9.90 (for Linux) (C) Thimeo Audio Technology, 2001-2022
[New Thread 0xb5a89440 (LWP 6358)]
[New Thread 0xb421e440 (LWP 6359)]
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.front.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryDacpAd.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline

Thread 5 "stereo_tool_gui" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb421e440 (LWP 6359)]
0xb0881ad8 in __dynamic_cast () from /lib/arm-linux-gnueabihf/libstdc++.so.6
(gdb)


Top
   
PostPosted: Tue May 03, 2022 12:00 pm 

Joined: Mon Apr 25, 2022 11:19 pm
Posts: 77
I'm in the process of making a new OS image on a spare SD card, I might as well go for the 64-bit OS and see if that brings about any performance improvements.

I think something broke the libraries when I was compiling Darkice to support AAC, so it's time to set up a fresh OS. I think gdb is having issues with one of the C libraries?

I am very reluctant to do any compiling again in case it breaks ST. I will instead look for a more ready made solution to support AAC or FLAC streams once I have it all working again.


Top
   
PostPosted: Tue May 03, 2022 1:01 pm 

Joined: Thu Jan 15, 2015 11:19 am
Posts: 146
Have you considered BUTT for encoding? It features FLAC as a codec:
http://danielnoethen.de/butt/


Top
   
PostPosted: Tue May 03, 2022 1:47 pm 

Joined: Mon Apr 25, 2022 11:19 pm
Posts: 77
Quote:
Have you considered BUTT for encoding? It features FLAC as a codec:
http://danielnoethen.de/butt/
I haven't but you have come at exactly at the right time as Darkice is failing to work properly right now and I was just thinking about alternative encoders.

But - ST is running so much better in a 64-bit environment than before! That is working again now and so is Icecast. So I will follow your suggestion and try BUTT!


Top
   
PostPosted: Tue May 03, 2022 3:02 pm 

Joined: Mon Apr 25, 2022 11:19 pm
Posts: 77
Looks like BUTT needs to be compiled from source. After the disaster with compiling darkice to support AAC and it killing ST in the process, I have instead installed liquid soap. For some strange reason it will only work for a minute or two before stopping, icecast2 is doing this. Otherwise everything is back up and running.

So more work to do....


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

All times are UTC+02: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