09-11-2021, 02:15 AM
(This post was last modified: 09-16-2021, 07:01 PM by Ladermeister.)
For the life of me I cannot solve my issue.
I have an Raspberry Pi4, OpenAuto Pro 13 and I have read all Threads in this and many other forums.
I also followed the instructions here in a thread that set pulsaudio globally, which were confirmed by some other member as working.
I’ve been trying to solve the issue for four days in a row and now I guess I need some help.
Sound is working (via optical output) but it sounds pitched down very much.
This happens when playing mp3 from OAP, it also happens when playing Spotify via Autobox/CarPlay and also when playing wav files with MPLAYER or playing audio files with other command line players.
I have tried different DACs - my technics receiver as well as an up-to-192khz capable quality DAC (Oehlbach DA Converter - https://www.amazon.de/dp/B00I50IA4A/ref=...9RVRSGQZZC )
aplay -l recognizes Hifiberry correctly and nothing else:
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: sndrpihifiberry [snd_rpi_hifiberry_digi], Gerät 0: HiFiBerry Digi+ Pro HiFi wm8804-spdif-0 [HiFiBerry Digi+ Pro HiFi wm8804-spdif-0]
Sub-Geräte: 1/1
Sub-Gerät #0: subdevice #0
I have set it hifiberry to AIF, I disabled onboard sound in /boot/config.txt and also put correct dtoverlay for the Hifiberry digi2 pro:
/boot/config.txt:
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1
#call once to burn USB boot ability:
#program_usb_boot_mode=1
#set USB output current (sum of all 4 ports) to 1,2A instead of 600mA:
#documentation and hardware mod to 2,1A:
#https://hackaday.com/2015/04/06/more-power-for-raspberry-pi-usb-ports/
max_usb_current=1
# uncomment the following to adjust overscan. Use positive numbers if console# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment to boot with HDMI display OFF:
# activate display again during runtime with console command: vcgencmd display_power 1
# deactivate display again during runtime with console command: vcgencmd display_power 0
#hdmi_blanking=2
# try others:
#hdmi_blanking=0
#hdmi_blanking=1
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=off
# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
#dtparam=audio=on ##commented due to: #https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/
dtoverlay=disable-bt
disable_splash=1
dtoverlay=vc4-fkms-v3d
#dtoverlay=w1-gpio
#dtoverlay=w1-gpio,gpiopin=4,pullup=on
#dtoverlay=w1-gpio,gpiopin=4
#[all]
force_eeprom_read=0
dtoverlay=hifiberry-digi-pro
dtdebug=1
[pi3]
gpu_mem=256
max_framebuffers=1
[pi3+]
gpu_mem=256
max_framebuffers=1
[pi4]
max_framebuffers=2
#reduce boot delay from 1s to 0s:
boot_delay=0
#overclock SD card:
#dtoverlay=sdtweak,overclock_50=100
start_x=0
So after reading a lot of other stuff on the Internet I tried temporarily disabling pulseaudio, I tried to manually set sampling rate conversion, tried different options with ~/.asound.rc and creating /etc/asound.conf with suggested content and also triple checked that I am not using any GPIOs that would conflict with Hifiberry digi2 pro.
I tried with and without the force_eeprom_read = 0 in /boot/config.txt, makes no difference.
When playing a test sine wave with
speaker-test -c 1 -r 192000 -F S32_LE -f 440 -t sine -l 1
it outputs that it’s using 192khz:
speaker-test 1.1.8
Wiedergabe-Gerät ist default
Stream-Parameter sind 192000 Hz, S32_LE, 1 Kanäle
Sinuswelle mit Frequenz 440,0000 Hz
Rate ist 192000 Hz (angefordert: 192000 Hz)
Puffergröße von 96 bis 1048576
Periodengröße von 32 bis 349526
Verwende maximale Puffergröße 1048576
Perioden = 4
gesetzt: period_size = 262144
gesetzt: buffer_size = 1048576
0 - Vorne links
Zeit pro Periode = 4,171645
I know it is not OAP related, but maybe someone has had the same issue and solved it and can help me.
Summary:
Issue is the same for any audio played on my raspberry pi4 (actually I also tried with a Raspberry Pi3, same issue here).
The pitched down sound sounds like at least half as slow as it should- high female singing voice sounds like Sauron from Lord of the rings. So something is not right with the sampling rate but I cannot find the reason.
I have an Raspberry Pi4, OpenAuto Pro 13 and I have read all Threads in this and many other forums.
I also followed the instructions here in a thread that set pulsaudio globally, which were confirmed by some other member as working.
I’ve been trying to solve the issue for four days in a row and now I guess I need some help.
Sound is working (via optical output) but it sounds pitched down very much.
This happens when playing mp3 from OAP, it also happens when playing Spotify via Autobox/CarPlay and also when playing wav files with MPLAYER or playing audio files with other command line players.
I have tried different DACs - my technics receiver as well as an up-to-192khz capable quality DAC (Oehlbach DA Converter - https://www.amazon.de/dp/B00I50IA4A/ref=...9RVRSGQZZC )
aplay -l recognizes Hifiberry correctly and nothing else:
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: sndrpihifiberry [snd_rpi_hifiberry_digi], Gerät 0: HiFiBerry Digi+ Pro HiFi wm8804-spdif-0 [HiFiBerry Digi+ Pro HiFi wm8804-spdif-0]
Sub-Geräte: 1/1
Sub-Gerät #0: subdevice #0
I have set it hifiberry to AIF, I disabled onboard sound in /boot/config.txt and also put correct dtoverlay for the Hifiberry digi2 pro:
/boot/config.txt:
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1
#call once to burn USB boot ability:
#program_usb_boot_mode=1
#set USB output current (sum of all 4 ports) to 1,2A instead of 600mA:
#documentation and hardware mod to 2,1A:
#https://hackaday.com/2015/04/06/more-power-for-raspberry-pi-usb-ports/
max_usb_current=1
# uncomment the following to adjust overscan. Use positive numbers if console# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment to boot with HDMI display OFF:
# activate display again during runtime with console command: vcgencmd display_power 1
# deactivate display again during runtime with console command: vcgencmd display_power 0
#hdmi_blanking=2
# try others:
#hdmi_blanking=0
#hdmi_blanking=1
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=off
# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
#dtparam=audio=on ##commented due to: #https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/
dtoverlay=disable-bt
disable_splash=1
dtoverlay=vc4-fkms-v3d
#dtoverlay=w1-gpio
#dtoverlay=w1-gpio,gpiopin=4,pullup=on
#dtoverlay=w1-gpio,gpiopin=4
#[all]
force_eeprom_read=0
dtoverlay=hifiberry-digi-pro
dtdebug=1
[pi3]
gpu_mem=256
max_framebuffers=1
[pi3+]
gpu_mem=256
max_framebuffers=1
[pi4]
max_framebuffers=2
#reduce boot delay from 1s to 0s:
boot_delay=0
#overclock SD card:
#dtoverlay=sdtweak,overclock_50=100
start_x=0
So after reading a lot of other stuff on the Internet I tried temporarily disabling pulseaudio, I tried to manually set sampling rate conversion, tried different options with ~/.asound.rc and creating /etc/asound.conf with suggested content and also triple checked that I am not using any GPIOs that would conflict with Hifiberry digi2 pro.
I tried with and without the force_eeprom_read = 0 in /boot/config.txt, makes no difference.
When playing a test sine wave with
speaker-test -c 1 -r 192000 -F S32_LE -f 440 -t sine -l 1
it outputs that it’s using 192khz:
speaker-test 1.1.8
Wiedergabe-Gerät ist default
Stream-Parameter sind 192000 Hz, S32_LE, 1 Kanäle
Sinuswelle mit Frequenz 440,0000 Hz
Rate ist 192000 Hz (angefordert: 192000 Hz)
Puffergröße von 96 bis 1048576
Periodengröße von 32 bis 349526
Verwende maximale Puffergröße 1048576
Perioden = 4
gesetzt: period_size = 262144
gesetzt: buffer_size = 1048576
0 - Vorne links
Zeit pro Periode = 4,171645
I know it is not OAP related, but maybe someone has had the same issue and solved it and can help me.
Summary:
Issue is the same for any audio played on my raspberry pi4 (actually I also tried with a Raspberry Pi3, same issue here).
The pitched down sound sounds like at least half as slow as it should- high female singing voice sounds like Sauron from Lord of the rings. So something is not right with the sampling rate but I cannot find the reason.