Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Audio glitching on Pi 5
#18
(07-14-2024, 09:50 AM)robkyf Wrote: Thanks @simonb.

Re. playing the music files from a USB stick: I've not tried that yet but will do so and report on whether there's any change.

Re. the PCi express headings, I may have misunderstood (sorry, complete Pi novice) but running the command you suggest returns the following only, which doesn't seem to say a lot:

rob@moode:~ $ /boot/firmware/config.txt                                                                                                                                
/boot/firmware/config.txt: line 6: [cm4]: command not found                                                                                                            
/boot/firmware/config.txt: line 8: [pi4]: command not found                                                                                                            
/boot/firmware/config.txt: line 9: hdmi_force_hotplug:0=1: command not found                                                                                            
/boot/firmware/config.txt: line 10: hdmi_force_hotplug:1=1: command not found                                                                                          
/boot/firmware/config.txt: line 12: [all]: command not found                                                                                                            

Re. iostat command, most of the time the results I get when playing a FLAC file look like the same as yours, but one line did return quite different results (and seemed to coincide with an audible glitch):

07/14/2024 10:42:25 AM                                                                                                                                                  
avg-cpu:  %user   %nice %system %iowait  %steal   %idle                                                                                                                
          0.00    0.00    1.00    0.25    0.00   98.75
                                                                                                                                                                       
    r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz Device                                                                                                              
   3.00    384.00     0.00   0.00    4.33   128.00 mmcblk0
                                                                                                                                                                       
    w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz Device                                                                                                              
   3.00     20.00     2.00  40.00    4.00     6.67 mmcblk0
                                                                                                                                                                       
    d/s     dkB/s   drqm/s  %drqm d_await dareq-sz Device                                                                                                              
   0.00      0.00     0.00   0.00    0.00     0.00 mmcblk0
                                                                                                                                                                       
    f/s f_await  aqu-sz  %util Device                                                                                                                                  
   2.00    1.00    0.03   2.00 mmcblk0

I strongly suspect it might be the fact your playing the music from the SD card. Not knowing what model it is they don't really like simultaneous write and reads. So the operating system might be writing as you are reading the music file causing a pause. 

 To be able to read any log files via a terminal it's probably a good idea to sudo to the root user for permissions.

Code:
sudo -i

you can then type exit to logout from root back to rob.

I have my rpi 4B cpu set to on demand including taking the input/output ( IO ) activity into account. But the bottom line I believe is the SD CARD. Move your music to a USB stick and test. A much faster SD card might help if yours is a slow one.

I do the following. Your sd card name might be different.


Code:
pi@MoodeLCD:~ $  hdparm -tT /dev/mmcblk0

 Results are:


Code:
/dev/mmcblk0:
 Timing cached reads:   2080 MB in  2.00 seconds = 1040.06 MB/sec
 Timing buffered disk reads: 132 MB in  3.05 seconds =  43.35 MB/sec
pi@MoodeLCD:~ $ sudo hdparm -tT /dev/mmcblk0

/dev/mmcblk0:
 Timing cached reads:   2208 MB in  2.00 seconds = 1104.31 MB/sec
 Timing buffered disk reads: 132 MB in  3.04 seconds =  43.35 MB/sec
pi@MoodeLCD:~ $ sudo hdparm -tT /dev/mmcblk0

/dev/mmcblk0:
 Timing cached reads:   2024 MB in  2.00 seconds = 1011.88 MB/sec
 Timing buffered disk reads: 132 MB in  3.04 seconds =  43.35 MB/sec


As a point of interest my USB attached SSD disk is:


Code:
pi@MoodeLCD:~ $ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   2226 MB in  2.00 seconds = 1113.56 MB/sec
 Timing buffered disk reads: 1028 MB in  3.02 seconds = 340.22 MB/sec
pi@MoodeLCD:~ $ 
pi@MoodeLCD:~ $ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   1998 MB in  2.00 seconds = 999.53 MB/sec
 Timing buffered disk reads: 958 MB in  3.00 seconds = 319.23 MB/sec
pi@MoodeLCD:~ $ 
pi@MoodeLCD:~ $ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   2004 MB in  2.00 seconds = 1002.06 MB/sec
 Timing buffered disk reads: 1000 MB in  3.00 seconds = 333.18 MB/sec
pi@MoodeLCD:~ $ 

And finally a USB memory stick:


Code:
pi@MoodeLCD:~ $ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   1918 MB in  2.00 seconds = 959.58 MB/sec
 Timing buffered disk reads:  68 MB in  3.07 seconds =  22.12 MB/sec
pi@MoodeLCD:~ $ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   1918 MB in  2.00 seconds = 959.24 MB/sec
 Timing buffered disk reads:  68 MB in  3.05 seconds =  22.30 MB/sec
pi@MoodeLCD:~ $ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   2104 MB in  2.00 seconds = 1052.79 MB/sec
 Timing buffered disk reads:  68 MB in  3.06 seconds =  22.23 MB/sec
pi@MoodeLCD:~ $ 

The USB memory stick is slower than the SD card in my case. But nothing is being written to it at the same time it is being read.

Cheers.
Reply


Messages In This Thread
Audio glitching on Pi 5 - by robkyf - 07-13-2024, 01:34 PM
RE: Audio glitching on Pi 5 - by Tim Curtis - 07-13-2024, 01:46 PM
RE: Audio glitching on Pi 5 - by robkyf - 07-13-2024, 03:40 PM
RE: Audio glitching on Pi 5 - by Tim Curtis - 07-13-2024, 07:13 PM
RE: Audio glitching on Pi 5 - by robkyf - 07-14-2024, 08:52 AM
RE: Audio glitching on Pi 5 - by TheOldPresbyope - 07-14-2024, 12:45 AM
RE: Audio glitching on Pi 5 - by robkyf - 07-14-2024, 09:16 AM
RE: Audio glitching on Pi 5 - by simonb - 07-14-2024, 05:38 AM
RE: Audio glitching on Pi 5 - by robkyf - 07-14-2024, 09:50 AM
RE: Audio glitching on Pi 5 - by simonb - 07-14-2024, 08:30 PM
RE: Audio glitching on Pi 5 - by robkyf - 07-14-2024, 09:04 PM
RE: Audio glitching on Pi 5 - by simonb - 07-15-2024, 05:03 AM
RE: Audio glitching on Pi 5 - by robkyf - 07-15-2024, 08:37 AM
RE: Audio glitching on Pi 5 - by Nutul - 07-15-2024, 08:57 AM
RE: Audio glitching on Pi 5 - by robkyf - 07-15-2024, 11:39 AM
RE: Audio glitching on Pi 5 - by Tim Curtis - 07-14-2024, 11:51 AM
RE: Audio glitching on Pi 5 - by robkyf - 07-14-2024, 01:01 PM
RE: Audio glitching on Pi 5 - by Tim Curtis - 07-14-2024, 01:04 PM
RE: Audio glitching on Pi 5 - by robkyf - 07-14-2024, 04:49 PM
RE: Audio glitching on Pi 5 - by Tim Curtis - 07-14-2024, 06:38 PM
RE: Audio glitching on Pi 5 - by robkyf - 07-14-2024, 07:53 PM
RE: Audio glitching on Pi 5 - by Tim Curtis - 07-14-2024, 08:04 PM
RE: Audio glitching on Pi 5 - by robkyf - 07-14-2024, 08:18 PM
RE: Audio glitching on Pi 5 - by simonb - 07-15-2024, 02:05 PM
RE: Audio glitching on Pi 5 - by robkyf - 07-15-2024, 04:22 PM
RE: Audio glitching on Pi 5 - by simonb - 07-15-2024, 04:36 PM
RE: Audio glitching on Pi 5 - by robkyf - 07-15-2024, 05:49 PM
RE: Audio glitching on Pi 5 - by simonb - 07-15-2024, 07:58 PM
RE: Audio glitching on Pi 5 - by Nutul - 07-15-2024, 08:25 PM
RE: Audio glitching on Pi 5 - by simonb - 07-15-2024, 08:34 PM
RE: Audio glitching on Pi 5 - by simonb - 07-15-2024, 08:31 PM
RE: Audio glitching on Pi 5 - by TheOldPresbyope - 07-15-2024, 09:06 PM
RE: Audio glitching on Pi 5 - by simonb - 07-15-2024, 09:28 PM
RE: Audio glitching on Pi 5 - by simonb - 07-16-2024, 05:08 AM
RE: Audio glitching on Pi 5 - by robkyf - 07-16-2024, 08:17 AM
RE: Audio glitching on Pi 5 - by the_bertrum - 07-16-2024, 11:30 AM
RE: Audio glitching on Pi 5 - by TheOldPresbyope - 07-16-2024, 12:19 PM
RE: Audio glitching on Pi 5 - by simonb - 07-16-2024, 04:19 PM
RE: Audio glitching on Pi 5 - by robkyf - 07-16-2024, 01:31 PM
RE: Audio glitching on Pi 5 - by TheOldPresbyope - 07-16-2024, 04:46 PM
RE: Audio glitching on Pi 5 - by simonb - 07-16-2024, 07:47 PM
RE: Audio glitching on Pi 5 - by robkyf - 07-17-2024, 09:17 PM
RE: Audio glitching on Pi 5 - by DRONE7 - 07-18-2024, 12:44 AM
RE: Audio glitching on Pi 5 - by robkyf - 07-18-2024, 09:29 PM
RE: Audio glitching on Pi 5 - by DRONE7 - 07-19-2024, 01:02 AM
RE: Audio glitching on Pi 5 - by robkyf - 07-19-2024, 07:26 AM
RE: Audio glitching on Pi 5 - by DRONE7 - 07-19-2024, 08:09 AM
RE: Audio glitching on Pi 5 - by robkyf - 07-19-2024, 09:00 AM
RE: Audio glitching on Pi 5 - by simonb - 07-19-2024, 05:50 PM
RE: Audio glitching on Pi 5 - by DRONE7 - 07-19-2024, 09:42 AM
RE: Audio glitching on Pi 5 - by robkyf - 07-19-2024, 08:55 PM
RE: Audio glitching on Pi 5 - by robkyf - 08-11-2024, 03:20 PM

Forum Jump: