Moode Forum
[SOLVED] Audio glitching on Pi 5 - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: [SOLVED] Audio glitching on Pi 5 (/showthread.php?tid=6710)

Pages: 1 2 3 4 5 6


Audio glitching on Pi 5 - robkyf - 07-13-2024

Inspired by a post on another forum, I tried moOde V9.0.4 for a Pi Zero 2 W outputting over micro-USB > USB-B to the ESS9018 Sabre32 DAC in an Audiolab 8200 CD player. The result was a huge improvement in sound quality over my previous solution of using the line output in an old iBasso DX50 DAP to feed the same DAC.

Enthused by this success, I tried moOde V9.0.4 for a Pi 5 outputting over USB-A > USB-B to the same DAC. But with this setup, the audio (mostly 16 or 24/44.1 FLAC) is glitching every 10-20 seconds. I’ve tried both basic and mid-range audio USB-A to USB-B cables but the problem is present with both.

I can’t figure out why the Pi Zero solution works perfectly but the Pi 5 one doesn’t. In both cases, the music files are stored on the SD card, the volume type is Fixed (0dB), and nothing else apart from the official power supply is attached to the Pi Zero or the Pi 5.

Any suggestions on what I’m doing wrong?


RE: Audio glitching on Pi 5 - Tim Curtis - 07-13-2024

Reboot and then post the contents of the startup log.

The log can be viewed via the SSH command moodeutl -l or downloaded via the Logs section in System Config, or via Menu, System info from any of the Config screens. The startup log will be at the end of System info output.


RE: Audio glitching on Pi 5 - robkyf - 07-13-2024

(07-13-2024, 01:46 PM)Tim Curtis Wrote: Reboot and then post the contents of the startup log.

The log can be viewed via the SSH command moodeutl -l or downloaded via the Logs section in System Config, or via Menu, System info from  any of the Config screens. The startup log will be at the end of System info output.

Thanks Tim.

The Startup Log looks like this:


Code:
20240713 155721 worker: -- Start moOde 9 series
20240713 155721 worker: --
20240713 155721 worker: Successfully daemonized
20240713 155721 worker: Wait for Linux startup
20240713 155727 worker: Linux startup complete
20240713 155727 worker: Boot config is ok
20240713 155727 worker: Session loaded
20240713 155727 worker: Package locks applied
20240713 155728 worker: File check complete
20240713 155728 worker: Debug logging off
20240713 155728 worker: --
20240713 155728 worker: -- System
20240713 155728 worker: --
20240713 155728 worker: Host name:     moode
20240713 155728 worker: RPi model:     Pi-5B 1.0 4GB
20240713 155728 worker: moOde release: 9.0.4 2024-07-06
20240713 155728 worker: RaspiOS:       12.6 Bookworm 64-bit
20240713 155728 worker: Linux Kernel:  6.6.31 64-bit
20240713 155728 worker: MPD version:   0.23.14
20240713 155728 worker: User id:       rob
20240713 155728 worker: Home folder:   /home/rob
20240713 155728 worker: Time zone:     Europe/London
20240713 155728 worker: Kbd layout:    gb
20240713 155728 worker: HDMI ports(s): on
20240713 155728 worker: Sys LED0:      on
20240713 155728 worker: Sys LED1:      on
20240713 155728 worker: Reduce power:  off
20240713 155728 worker: CPU governor:  ondemand
20240713 155728 worker: Integ audio:   vc4-kms-v3d
20240713 155728 worker: --
20240713 155728 worker: -- Network
20240713 155728 worker: --
20240713 155728 worker: Eth0
20240713 155728 worker: Ethernet: adapter exists
20240713 155728 worker: Ethernet: timeout off
20240713 155728 worker: Ethernet: address not assigned
20240713 155728 worker: Wlan0
20240713 155728 worker: Wireless: adapter exists
20240713 155728 worker: Wireless: country DE
20240713 155728 worker: Wireless: SSID    RobNetwork
20240713 155728 worker: Wireless: other   None
20240713 155728 worker: Wireless: timeout up to 90 secs
20240713 155728 worker: Wireless: connect to RobNetwork
20240713 155729 worker: Wireless: method  dhcp
20240713 155729 worker: Wireless: address 192.XXX.X.XX
20240713 155729 worker: Wireless: netmask 255.XXX.XXX.X
20240713 155729 worker: Wireless: gateway 192.XXX.X.X
20240713 155729 worker: Wireless: pri DNS 192.XXX.X.X
20240713 155729 worker: Wireless: domain  none found
20240713 155729 worker: --
20240713 155729 worker: -- File sharing
20240713 155729 worker: --
20240713 155729 worker: SMB file sharing:  on
20240713 155729 worker: NFS file sharing:  off
20240713 155729 worker: DLNA file sharing: off
20240713 155729 worker: --
20240713 155729 worker: -- Special configs
20240713 155729 worker: --
20240713 155729 worker: Plexamp:          not installed
20240713 155729 worker: RoonBridge:       not installed
20240713 155729 worker: Allo Piano 2.1:   not detected
20240713 155729 worker: Allo Boss 2:      not detected, OLED script ok
20240713 155729 worker: IQaudIO AMP*:     not detected
20240713 155729 worker: --
20240713 155729 worker: -- ALSA debug
20240713 155729 worker: --
20240713 155729 worker: Cards:  0:Series          1:vc4hdmi0        2:vc4hdmi1        3:empty          
20240713 155729 worker:         4:empty           5:empty           6:empty           7:empty          
20240713 155729 worker: Mixers: 0:(PCM)           1:none            2:none            3:none            
20240713 155729 worker:         4:none            5:none            6:none            7:none            
20240713 155729 worker: --
20240713 155729 worker: -- Audio configuration
20240713 155729 worker: --
20240713 155729 worker: Audio device:  0:Audiolab 8200 Series
20240713 155729 worker: ALSA card:     has not been reassigned
20240713 155729 worker: MPD config:    update not needed
20240713 155729 worker: ALSA output:   USB
20240713 155729 worker: ALSA mode:     Default (plughw)
20240713 155729 worker: ALSA mixer     PCM
20240713 155729 worker: ALSA volume:   96% (0.00dB)
20240713 155729 worker: ALSA maxvol:   100%
20240713 155729 worker: ALSA loopback: off
20240713 155729 worker: MPD mixer      Fixed (0dB)
20240713 155729 worker: Audio formats: S24_3LE
20240713 155729 worker: CamillaDSP:    off
20240713 155729 worker: CDSP volume:   0dB
20240713 155729 worker: CDSP volrange: 60dB
20240713 155729 worker: --
20240713 155729 worker: -- MPD startup
20240713 155729 worker: --
20240713 155729 worker: MPD service:        started
20240713 155729 worker: MPD port 6600:      accepting connections
20240713 155729 worker: MPD ALSA Default:   on
20240713 155729 worker: MPD ALSA Bluetooth: off
20240713 155729 worker: MPD HTTP Server:    off
20240713 155729 worker: MPD volume:         0
20240713 155729 worker: Saved MPD vol:      -1
20240713 155729 worker: Saved SRC vol:      0
20240713 155729 worker: MPD crossfade:      off
20240713 155729 worker: MPD ignore CUE:     no
20240713 155729 worker: MPD CDSP volsync:   off
20240713 155729 worker: --
20240713 155729 worker: -- Music sources
20240713 155729 worker: --
20240713 155729 worker: USB drives:     no drives found
20240713 155729 worker: NAS sources:    no music sources defined
20240713 155729 worker: --
20240713 155729 worker: -- Feature availability
20240713 155729 worker: --
20240713 155729 worker: Input select:    available, Source: MPD, Output: Audiolab 8200 Series
20240713 155729 worker: Bluetooth:       available, PIN: None, ALSA/CDSP maxvol: 100%/0dB, ALSA outmode: Standard
20240713 155729 worker: AirPlay:         available
20240713 155729 worker: Spotify Connect: available
20240713 155729 worker: Squeezelite:     available
20240713 155729 worker: UPnP client:     available
20240713 155729 worker: Plexamp:         not installed
20240713 155729 worker: RoonBridge:      not installed
20240713 155729 worker: Multiroom:       available
20240713 155729 worker: GPIO buttons:    available
20240713 155729 worker: HTTPS mode:      available
20240713 155729 worker: Stream recorder: n/a
20240713 155729 worker: --
20240713 155729 worker: -- Peripherals
20240713 155729 worker: --
20240713 155730 worker: Local display:   off
20240713 155730 worker: On-screen kbd:   off
20240713 155730 worker: HDMI 4K 60Hz:    off
20240713 155730 worker: Rotary encoder:  off
20240713 155730 worker: USB volume knob: off
20240713 155730 worker: LCD updater:     off
20240713 155730 worker: --
20240713 155730 worker: -- Miscellaneous
20240713 155730 worker: --
20240713 155730 worker: Software update:   Automatic check off
20240713 155730 worker: Auto-CoverView:    off
20240713 155730 worker: CoverView timeout: Never
20240713 155730 worker: Auto-shuffle:      off
20240713 155730 worker: Auto-play:         off
20240713 155730 worker: Web SSH server:    on
20240713 155730 worker: Maintenance task:  360 mins
20240713 155730 worker: Current view:      reset to Playback
20240713 155730 worker: Active flags:      all false
20240713 155730 worker: Reset flags:       skipped
20240713 155730 worker: Session check:     ok
20240713 155730 worker: --
20240713 155730 worker: -- Startup complete
20240713 155730 worker: --
20240713 155730 worker: Mount monitor:    started
20240713 155730 worker: Radio monitor:    off
20240713 155730 worker: Watchdog monitor: started
20240713 155730 worker: Responsiveness:   Default
20240713 155730 worker: Ready



RE: Audio glitching on Pi 5 - Tim Curtis - 07-13-2024

I don't see anything suspicious in the log.

You might want to run the ifconfig command and see if there are any network issues for example dropped packets reported for the wlan0 interface. Also run the iwconfig command for signal strength/quality.

If those commands don't report any issues then its not obvious to me what might be happening on your end.


RE: Audio glitching on Pi 5 - TheOldPresbyope - 07-14-2024

@robkyf 

Couple of thoughts...

1) The Pi 5, like the Pi 4 models, has both USB2.0 and USB3.0 ports. You should be sure your DAC is connected to a USB2.0 port. In principle, USB3.0 ports are backward-compatible with USB2.0 devices, but there are always edge cases.

2) you could set MPD to elevated log level (m > Config > Audio > MPD settings) and enable moDe's debug logging (m > Config > System > Logs). Check their logs, /var/log/moode.log and /var/log/mpd/log for periodic ( e.g., every 10s - 20s) error messages. 

As well, you can watch the Raspberry Pi OS system message stream for periodic error messages

Code:
journalctl -f

Good hunting!

Regards,
Kent


RE: Audio glitching on Pi 5 - simonb - 07-14-2024

A couple of question and a suggestion:

1. Have you tried moving the flac files to a usb stick and playing from there? 

2. Can you post the PCi express settings from
Code:
/boot/firmware/config.txt

please?

Mine is :

# PCI Express
#dtparam=pciex1
dtparam=pciex1_gen=3

I set mine to pciex1_gen=3 and it behaves much better. The sound quality improved.

3. Can you run the command while playing the flac files: 


Code:
iostat -xt --pretty 1 5

Output will be like this:


Code:
07/14/2024 06:32:10 AM
Code:
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.25    0.00    0.25    0.00    0.00   99.49

     r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz Device
    0.00      0.00     0.00   0.00    0.00     0.00 mmcblk0
    0.00      0.00     0.00   0.00    0.00     0.00 sda

     w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz Device
    2.00   1024.00     0.00   0.00 1677.00   512.00 mmcblk0
    0.00      0.00     0.00   0.00    0.00     0.00 sda

     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
    0.00      0.00     0.00   0.00    0.00     0.00 sda


     f/s f_await  aqu-sz  %util Device
    0.00    0.00    3.35  14.80 mmcblk0
    0.00    0.00    0.00   0.00 sda[/code]


RE: Audio glitching on Pi 5 - robkyf - 07-14-2024

Thanks @Tim Curtis . No issues that I can see with my network:

rob@moode:~ $ ifconfig
                                                                                                                                                              
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500                                                                                                            
       inet 192.XXX.X.XX  netmask 255.XXX.XXX.X  broadcast 192.XXX.X.XXX                                                                                              
       inet6 fe80::9a24:5b64:dc0a:cbe5  prefixlen 64  scopeid 0x20<link>                                                                                              
       ether d8:3a:dd:eb:8d:1d  txqueuelen 1000  (Ethernet)                                                                                                            
       RX packets 5741  bytes 1426874 (1.3 MiB)                                                                                                                        
       RX errors 0  dropped 0  overruns 0  frame 0                                                                                                                    
       TX packets 6762  bytes 7088307 (6.7 MiB)                                                                                                                        
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0                                                                                                      
                                                                                                                                                                       
rob@moode:~ $ iwconfig
                                                                                                                                                        
wlan0     IEEE 802.11  ESSID:"RobNetwork"                                                                                                                              
         Mode:Managed  Frequency:5.2 GHz  Access Point: 40:AE:30:79:62:3C                                                                                              
         Bit Rate=433.3 Mb/s   Tx-Power=31 dBm                                                                                                                        
         Retry short limit:7   RTS thr:off   Fragment thr:off                                                                                                          
         Power Management:off                                                                                                                                          
         Link Quality=62/70  Signal level=-48 dBm                                                                                                                      
         Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0                                                                                                      
         Tx excessive retries:0  Invalid misc:0   Missed beacon:0


RE: Audio glitching on Pi 5 - robkyf - 07-14-2024

Thanks @TheOldPresbyope.

Re. the USB port: yes, I've tried the two USB 2.0 and 3.0 ports on the Pi 5 and all have the same glitching.

Re. the moOde system logs: I've set those as you've suggested but while I am logged in to moOde/Pi I get a Permission Denied message for both logs. Sorry, I'm probably making some obvious mistake here:

#moode login: rob                                                                                                                                                        
Password:
Host:  moode                                                                                                                                                            
RPiOS: 12.6 Bookworm 64-bit | Linux: 6.6.31 64-bit                                                                                                                      
Model: Pi-5B 4GB                                                                                                                                                        
Audio: Audiolab 8200 Series                                                                                                                                            
rob@moode:~ $ /var/log/moode.log                                                                                                                                        
-bash: /var/log/moode.log: Permission denied                                                                                                                            

Re. the journal, I can access that but there doesn't seem to be any relationship between the results and the audible glitches during playback:

rob@moode:~ $ journalctl -f                                                                                                                                            
Jul 14 09:50:02 moode systemd[1]: sysstat-collect.service: Deactivated successfully.                                                                                    
Jul 14 09:50:02 moode systemd[1]: Finished sysstat-collect.service - system activity accounting tool.                                                                  
Jul 14 09:54:35 moode dbus-daemon[500]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' requested by ':1.201' (uid=0 pid=7675 comm="timedatectl")                                                                                  
Jul 14 09:54:35 moode systemd[1]: Starting systemd-timedated.service - Time & Date Service...                                                                          
Jul 14 09:54:35 moode dbus-daemon[500]: [system] Successfully activated service 'org.freedesktop.timedate1'                                                            
Jul 14 09:54:35 moode systemd[1]: Started systemd-timedated.service - Time & Date Service.                                                                              
Jul 14 09:55:09 moode systemd[1]: systemd-timedated.service: Deactivated successfully.                                                                                  
Jul 14 10:00:02 moode systemd[1]: Starting sysstat-collect.service - system activity accounting tool...                                                                
Jul 14 10:00:02 moode systemd[1]: sysstat-collect.service: Deactivated successfully.                                                                                    
Jul 14 10:00:02 moode systemd[1]: Finished sysstat-collect.service - system activity accounting tool.


RE: Audio glitching on Pi 5 - robkyf - 07-14-2024

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


RE: Audio glitching on Pi 5 - Tim Curtis - 07-14-2024

The moOde startup log can be viewed via the SSH command "moodeutl -l" or "cat /var/log/moode.log" or downloaded via the Logs section in System Config, or via Menu, System info from  any of the Config screens. The startup log will be at the end of System info output.

Use the "cat" command to view files for example

Code:
cat /boot/firmware/config.txt