Rock 3A Sound Quality

Using the recent debian and ubuntu linux images for the Rock3 A, the sound quality out of the 3.5mm port is bad. Clicks. Scratchy. Tinny. Just sounds noticeably bad.

Tested using:
rock3a_debian_buster_xfce4_arm64_20210824_0136-gpt.img
and
rock3a_ubuntu_focal_server_arm64_20210823_2119-gpt.img

Do I have a bad board or are others experiencing this as well?

@cqmcgaha I will check the sound quality out of 3.5mm port with debian/ubuntu image.

Can you also provide the audio file?

@Stephen

My Hardware:

  • Rock 3A V1.2
  • 16GB eMMC
  • 3.5 mm Headphones with Mic
  • USB Keyboard
  • USB Mouse

I started with playing /usr/share/sounds/alsa/Front_Center.wav and that sounded bad then tried other audio files. I like to use a segment of bohemian rhapsody as it has loud, soft, left, right. But any song I have played via local WAV, MP3 or from youtube is similar bad sound.

Replacing the Rock3 with a Rock4 B V1.4 running latest Armbian OS the sound quality is ok. Volume too low. But at least sounds ok.

Let me know how to send you a SoundTest.mp3 file, if you want.

Thank you for your help.

I am testing the sound output from jack and the quality Is fine (acceptable quality).
I connected some speakers to the 3.5mm audio jack and the USB port for power. (no MIC)

Uou should not base your findings only on playing wav files.
aplay -D sysdefault:CARD=1 /usr/share/sounds/alsa/Front_Right.wav

No clicks or Scratchy. Litle noise is heard.

Playing mp3 has good quality and is loud.
I haven’t found a way to change the volume with alsa yet. (i am on CLI)

1 Like

Hi Alexander,
I tried playing mp3, wav, YouTube from browser, mp3 and MP4 video using VLC. All sound bad. I don’t expect much, but this is bad.

You can change volume from cli using alsamixer. Be sure to set playback correctly and look at DAC volume settings. And press f6 to change to other sound device.

I switched back to Rock4b as it sounds like a normal SBC should sound.

Good luck.

Hmm, alsamixer allow me only this:
codec

Can you please show what you have in alsamixer?

cat /proc/asound/devices 
  1:        : sequencer
  2: [ 0- 0]: digital audio playback
  3: [ 0]   : control
  4: [ 1- 0]: digital audio playback
  5: [ 1- 0]: digital audio capture
  6: [ 1]   : control
 33:        : timer

Maybe it’s some hw issue that we are not aware of, just ask for a replacement from the distributor. We will check it.

Hi Alexander,

I am out of office two more days and will help you in more detail when I get back. But I will try to answer now.

I changed the playback path to all three: ring, HP and ???.

Then F6 to change device. You should have pulse audio as first device and then rockchip as second. But I see you already have rockchip selected.

Exactly what OS image are you using? From Radxa? Debian or Ubuntu? What date?

It is Ubuntu, based on radxa’s rootfs and 4.19 kernel to have HW decoding / acceleration.

I have tried to set up PCM but looks like no surround sound for whatever reason, maybe missing kernel-firmware, wrong kernel config, or an HW issue.

I have pretty much everything working (regarding multimedia) on this board but the sound (quality).

Here you can see and hear a 4K HW decoding (to 1080P) with sound and compare it to what you have.
Mega (80 MB).
Video here: https://mega.nz/file/EaIy3L4L#6JNMdKwIjZ0aLYmE2RGv8vE076wS09tyFP1aFGsLYZk
4K video: wget https://www.libde265.org/hevc-bitstreams/tos-4096x1720-tiles.mkv

Unfortunately, I cannot test HDMI sound now.

Or it is just ALSA misconfigured, ffmpeg complaints about missing PCM cards.

ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
SDL_OpenAudio (6 channels, 48000 Hz): ALSA: Couldn't open audio device: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
SDL_OpenAudio (4 channels, 48000 Hz): ALSA: Couldn't open audio device: No such file or directory

here is my configuration:

rock@rock3a:~$ ls -l /dev/snd
total 0
drwxr-xr-x  2 root root       80 Sep 28 14:28 by-path
crw-rw----+ 1 root audio 116,  3 Sep 28 14:28 controlC0
crw-rw----+ 1 root audio 116,  6 Sep 28 14:28 controlC1
crw-rw----+ 1 root audio 116,  2 Sep 28 14:28 pcmC0D0p
crw-rw----+ 1 root audio 116,  5 Sep 28 14:28 pcmC1D0c
crw-rw----+ 1 root audio 116,  4 Sep 28 14:28 pcmC1D0p
crw-rw----+ 1 root audio 116,  1 Sep 28 14:28 seq
crw-rw----+ 1 root audio 116, 33 Sep 28 14:28 timer
rock@rock3a:~$ lsmod | grep '^snd' | column -t
rock@rock3a:~$ aplay -l | awk -F \: '/,/{print $2}' | awk '{print $1}' | uniq
rockchiphdmi
rockchiprk809co
rock@rock3a:~$ cat /usr/share/alsa/alsa.conf
#
#  ALSA library configuration file
#

# pre-load the configuration files

@hooks [
	{
		func load
		files [
			"/etc/alsa/conf.d"
			"/etc/asound.conf"
			"~/.asoundrc"
		]
		errors false
	}
]

# load card-specific configuration files (on request)

cards.@hooks [
	{
		func load
		files [
			{
				@func concat
				strings [
					{ @func datadir }
					"/cards/aliases.conf"
				]
			}
		]
	}
	{
		func load_for_all_cards
		files [
			{
				@func concat
				strings [
					{ @func datadir }
					"/cards/"
					{ @func private_string }
					".conf"
				]
			}
		]
		errors false
	}
]

#
# defaults
#

# show all name hints also for definitions without hint {} section
defaults.namehint.showall on
# show just basic name hints
defaults.namehint.basic on
# show extended name hints
defaults.namehint.extended on
#
defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0
defaults.pcm.subdevice -1
defaults.pcm.nonblock 1
defaults.pcm.compat 0
defaults.pcm.minperiodtime 5000		# in us
defaults.pcm.ipc_key 5678293
defaults.pcm.ipc_gid audio
defaults.pcm.ipc_perm 0660
defaults.pcm.dmix.max_periods 0
defaults.pcm.dmix.channels 2
defaults.pcm.dmix.rate 48000
defaults.pcm.dmix.format "unchanged"
defaults.pcm.dmix.card defaults.pcm.card
defaults.pcm.dmix.device defaults.pcm.device
defaults.pcm.dsnoop.card defaults.pcm.card
defaults.pcm.dsnoop.device defaults.pcm.device
defaults.pcm.front.card defaults.pcm.card
defaults.pcm.front.device defaults.pcm.device
defaults.pcm.rear.card defaults.pcm.card
defaults.pcm.rear.device defaults.pcm.device
defaults.pcm.center_lfe.card defaults.pcm.card
defaults.pcm.center_lfe.device defaults.pcm.device
defaults.pcm.side.card defaults.pcm.card
defaults.pcm.side.device defaults.pcm.device
defaults.pcm.surround21.card defaults.pcm.card
defaults.pcm.surround21.device defaults.pcm.device
defaults.pcm.surround40.card defaults.pcm.card
defaults.pcm.surround40.device defaults.pcm.device
defaults.pcm.surround41.card defaults.pcm.card
defaults.pcm.surround41.device defaults.pcm.device
defaults.pcm.surround50.card defaults.pcm.card
defaults.pcm.surround50.device defaults.pcm.device
defaults.pcm.surround51.card defaults.pcm.card
defaults.pcm.surround51.device defaults.pcm.device
defaults.pcm.surround71.card defaults.pcm.card
defaults.pcm.surround71.device defaults.pcm.device
defaults.pcm.iec958.card defaults.pcm.card
defaults.pcm.iec958.device defaults.pcm.device
defaults.pcm.modem.card defaults.pcm.card
defaults.pcm.modem.device defaults.pcm.device
# truncate files via file or tee PCM
defaults.pcm.file_format	"raw"
defaults.pcm.file_truncate	true
defaults.rawmidi.card 0
defaults.rawmidi.device 0
defaults.rawmidi.subdevice -1
defaults.hwdep.card 0
defaults.hwdep.device 0
defaults.timer.class 2
defaults.timer.sclass 0
defaults.timer.card 0
defaults.timer.device 0
defaults.timer.subdevice 0

#
#  PCM interface
#

# redirect to load-on-demand extended pcm definitions
pcm.cards cards.pcm

pcm.default cards.pcm.default
pcm.sysdefault cards.pcm.default
pcm.front cards.pcm.front
pcm.rear cards.pcm.rear
pcm.center_lfe cards.pcm.center_lfe
pcm.side cards.pcm.side
pcm.surround21 cards.pcm.surround21
pcm.surround40 cards.pcm.surround40
pcm.surround41 cards.pcm.surround41
pcm.surround50 cards.pcm.surround50
pcm.surround51 cards.pcm.surround51
pcm.surround71 cards.pcm.surround71
pcm.iec958 cards.pcm.iec958
pcm.spdif iec958
pcm.hdmi cards.pcm.hdmi
pcm.dmix cards.pcm.dmix
pcm.dsnoop cards.pcm.dsnoop
pcm.modem cards.pcm.modem
pcm.phoneline cards.pcm.phoneline

pcm.hw {
	@args [ CARD DEV SUBDEV ]
	@args.CARD {
		type string
		default {
			@func getenv
			vars [
				ALSA_PCM_CARD
				ALSA_CARD
			]
			default {
				@func refer
				name defaults.pcm.card
			}
		}
	}
	@args.DEV {
		type integer
		default {
			@func igetenv
			vars [
				ALSA_PCM_DEVICE
			]
			default {
				@func refer
				name defaults.pcm.device
			}
		}
	}
	@args.SUBDEV {
		type integer
		default {
			@func refer
			name defaults.pcm.subdevice
		}
	}		
	type hw
	card $CARD
	device $DEV
	subdevice $SUBDEV
	hint {
		show {
			@func refer
			name defaults.namehint.extended
		}
		description "Direct hardware device without any conversions"
	}
}

pcm.plughw {
	@args [ CARD DEV SUBDEV ]
	@args.CARD {
		type string
		default {
			@func getenv
			vars [
				ALSA_PCM_CARD
				ALSA_CARD
			]
			default {
				@func refer
				name defaults.pcm.card
			}
		}
	}
	@args.DEV {
		type integer
		default {
			@func igetenv
			vars [
				ALSA_PCM_DEVICE
			]
			default {
				@func refer
				name defaults.pcm.device
			}
		}
	}
	@args.SUBDEV {
		type integer
		default {
			@func refer
			name defaults.pcm.subdevice
		}
	}		
	type plug
	slave.pcm {
		type hw
		card $CARD
		device $DEV
		subdevice $SUBDEV
	}
	hint {
		show {
			@func refer
			name defaults.namehint.extended
		}
		description "Hardware device with all software conversions"
	}
}

pcm.plug {
	@args [ SLAVE ]
	@args.SLAVE {
		type string
	}
	type plug
	slave.pcm $SLAVE
}

pcm.shm {
	@args [ SOCKET PCM ]
	@args.SOCKET {
		type string
	}
	@args.PCM {
		type string
	}
	type shm
	server $SOCKET
	pcm $PCM
}

pcm.tee {
	@args [ SLAVE FILE FORMAT ]
	@args.SLAVE {
		type string
	}
	@args.FILE {
		type string
	}
	@args.FORMAT {
		type string
		default {
			@func refer
			name defaults.pcm.file_format
		}
	}
	type file
	slave.pcm $SLAVE
	file $FILE
	format $FORMAT
	truncate {
		@func refer
		name defaults.pcm.file_truncate
	}
}

pcm.file {
	@args [ FILE FORMAT ]
	@args.FILE {
		type string
	}
	@args.FORMAT {
		type string
		default {
			@func refer
			name defaults.pcm.file_format
		}
	}
	type file
	slave.pcm null
	file $FILE
	format $FORMAT
	truncate {
		@func refer
		name defaults.pcm.file_truncate
	}
}

pcm.null {
	type null
	hint {
		show {
			@func refer
			name defaults.namehint.basic
		}
		description "Discard all samples (playback) or generate zero samples (capture)"
	}
}

#
#  Control interface
#
	
ctl.sysdefault {
	type hw
	card {
		@func getenv
		vars [
			ALSA_CTL_CARD
			ALSA_CARD
		]
		default {
			@func refer
			name defaults.ctl.card
		}
	}
	hint.description "Default control device"
}
ctl.default ctl.sysdefault

ctl.hw {
	@args [ CARD ]
	@args.CARD {
		type string
		default {
			@func getenv
			vars [
				ALSA_CTL_CARD
				ALSA_CARD
			]
			default {
				@func refer
				name defaults.ctl.card
			}
		}
	}
	type hw
	card $CARD
	hint.description "Direct control device"
}

ctl.shm {
	@args [ SOCKET CTL ]
	@args.SOCKET {
		type string
	}
	@args.CTL {
		type string
	}
	type shm
	server $SOCKET
	ctl $CTL
}

#
#  RawMidi interface
#

rawmidi.default {
	type hw
	card {
		@func getenv
		vars [
			ALSA_RAWMIDI_CARD
			ALSA_CARD
		]
		default {
			@func refer
			name defaults.rawmidi.card
		}
	}
	device {
		@func igetenv
		vars [
			ALSA_RAWMIDI_DEVICE
		]
		default {
			@func refer
			name defaults.rawmidi.device
		}
	}
	hint.description "Default raw MIDI device"
}

rawmidi.hw {
	@args [ CARD DEV SUBDEV ]
	@args.CARD {
		type string
		default {
			@func getenv
			vars [
				ALSA_RAWMIDI_CARD
				ALSA_CARD
			]
			default {
				@func refer
				name defaults.rawmidi.card
			}
		}
	}
	@args.DEV {
		type integer
		default {
			@func igetenv
			vars [
				ALSA_RAWMIDI_DEVICE
			]
			default {
				@func refer
				name defaults.rawmidi.device
			}
		}
	}
	@args.SUBDEV {
		type integer
		default -1
	}
	type hw
	card $CARD
	device $DEV
	subdevice $SUBDEV
	hint {
		description "Direct rawmidi driver device"
		device $DEV
	}
}

rawmidi.virtual {
	@args [ MERGE ]
	@args.MERGE {
		type string
		default 1
	}
	type virtual
	merge $MERGE
}

#
#  Sequencer interface
#

seq.default {
	type hw
	hint.description "Default sequencer device"
}

seq.hw {
	type hw
}

#
#  HwDep interface
#

hwdep.default {
	type hw
	card {
		@func getenv
		vars [
			ALSA_HWDEP_CARD
			ALSA_CARD
		]
		default {
			@func refer
			name defaults.hwdep.card
		}
	}
	device {
		@func igetenv
		vars [
			ALSA_HWDEP_DEVICE
		]
		default {
			@func refer
			name defaults.hwdep.device
		}
	}
	hint.description "Default hardware dependent device"
}

hwdep.hw {
	@args [ CARD DEV ]
	@args.CARD {
		type string
		default {
			@func getenv
			vars [
				ALSA_HWDEP_CARD
				ALSA_CARD
			]
			default {
				@func refer
				name defaults.hwdep.card
			}
		}
	}
	@args.DEV {
		type integer
		default {
			@func igetenv
			vars [
				ALSA_HWDEP_DEVICE
			]
			default {
				@func refer
				name defaults.hwdep.device
			}
		}
	}
	type hw
	card $CARD
	device $DEV
	hint {
		description "Direct hardware dependent device"
		device $DEV
	}
}

#
#  Timer interface
#

timer_query.default {
	type hw
}

timer_query.hw {
	type hw
}

timer.default {
	type hw
	class {
		@func refer
		name defaults.timer.class
	}
	sclass {
		@func refer
		name defaults.timer.sclass
	}
	card {
		@func refer
		name defaults.timer.card
	}
	device {
		@func refer
		name defaults.timer.device
	}
	subdevice {
		@func refer
		name defaults.timer.subdevice
	}
	hint.description "Default timer device"
}

timer.hw {
	@args [ CLASS SCLASS CARD DEV SUBDEV ]
	@args.CLASS {
		type integer
		default {
			@func refer
			name defaults.timer.class
		}
	}
	@args.SCLASS {
		type integer
		default {
			@func refer
			name defaults.timer.sclass
		}
	}
	@args.CARD {
		type string
		default {
			@func refer
			name defaults.timer.card
		}
	}
	@args.DEV {
		type integer
		default {
			@func refer
			name defaults.timer.device
		}
	}
	@args.SUBDEV {
		type integer
		default {
			@func refer
			name defaults.timer.subdevice
		}
	}
	type hw
	class $CLASS
	sclass $SCLASS
	card $CARD
	device $DEV
	subdevice $SUBDEV
	hint {
		description "Direct timer device"
		device $DEV
	}
}
rock@rock3a:~$ sudo cat /etc/asound.conf
[sudo] password for rock: 
pcm.!default {
    type plug
    slave {
        pcm "hw:1,0"
    }
}
		
ctl.!default {
   type hw
   card 1
} 

@cqmcgaha Feel free to point me in the right direction.

@jack / @Stephen , you can give some input regarding the sound configuration. Or any HW issue you have found. The board is great for multimedia if this is resolved.

I was expecting to get some input or feedback about the issue.
Anyway, Today i tried to dig further and see what I could find.
I re-built SDL with SDL_mixer and FFmpeg plus double checked PulseAudio.
I have an rk3399 with the exact same sound output quality using ffplay but with KODI (19) I get surround sound (good quality). I had some hope SDL_mixer would help or fix the error. Not a chance.

I managed to run KODI (18.9) without add-ons but the sound output from KODI is exactly the same as with ffplay.

Some curious findings:
While testing, i noticed Mali G52 takes ~40% CPU (from 400%) rendering (and the vpu ~20% hw decoding 4K / audio) while T860 takes ~8% CPU (from 600%) rendering and ~8% hw decoding 4K. I have the impression that G52 is faster than T860 but ~40% CPU is something i can’t explain.

Mali G52 1-Core-2EE GPU also known as G52MP2 GPU also known as G52L where “L” stands for “LIte” found on all RK3568/RK3566 is not the same as Mali G52MP6 found on S922X or A311D CPU’s.

In fact it’s approximately 2/3 slower when measured in GFLOPS compared to Mali T860MP4 found on RK3399 CPU for example.

Mali G52L GPU (38.4GLOPs when 800MHz clock frequency) is more in league with Mali G31MP2 found on S905X3 and S905Y2 CPU’s.

2 Likes

We have 2 boards with no sound at all.

Yesterday i finished all the sound tests possible for this board.

As a reference, I used the following file for Ac3 Dolby 5.1:
https://www.paolofiorani.it/TEST%20Audio/Ac3%20Dolby%20Digital%205.1Ch%20Sound%20Test.avi

What is working:

  1. HDMI sound output (perfect sound)
  2. Jack sound output (volume is OK, Quality is the issue, sound like mono, not stereo)

Not tested:

  1. Recording

How it was tested:

  1. default route
  2. ALSA
  3. Pulseaudio

Jack output:

  1. ffplay Ac3\ Dolby\ Digital\ 5.1Ch\ Sound\ Test.avi
  2. AUDIODEV=“hw:1,0” ffplay Ac3\ Dolby\ Digital\ 5.1Ch\ Sound\ Test.avi
  3. SDL_AUDIODRIVER=“alsa” AUDIODEV=“hw:1,0” ffplay Ac3\ Dolby\ Digital\ 5.1Ch\ Sound\ Test.avi
  4. SDL_AUDIODRIVER=“pulseaudio” AUDIODEV=“hw:1,0” ffplay Ac3\ Dolby\ Digital\ 5.1Ch\ Sound\ Test.avi

Usual tests:

ALSA
aplay -D sysdefault:CARD=1 /usr/share/sounds/alsa/Front_Right.wav

PULSEAUDIO (default to Jack)
paplay /usr/share/sounds/alsa/Front_Right.wav

MP3:
file: https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3
play: SoX v14.4.2
play SoundHelix-Song-1.mp3

MP4
file: https://www2.iis.fraunhofer.de/AAC/ChID-BLITS-EBU-Narration.mp4

ffplay ./ChID-BLITS-EBU-Narration.mp4

WAV
file: https://www2.iis.fraunhofer.de/AAC/ChID-BLITS-EBU-Narration441-16b.wav

play ChID-BLITS-EBU-Narration441-16b.wav

MP4 - video + sound

Hi,
I am looking into the recording quality of the rock3A. Both recording and playing over the audiojack is of low quality.

I tested this by using arecord in various options and by direct recording in audacity (using rockchip,rk809-codec).

When zooming in audacity to the waveform, it turn out to have a blockwave structure. The individual sampling points match the 44100 sampling resolution, but the values in the wave-file are constant in groups of 13 or 14 samples, which matches an actual sampling rate of about 3000. That explains the bad quality for both recording and playing.

I am not a linux specialist. The question is: where can we control this? It hope it is a software issue, but It feels as a hardware issue to me (and that’s really bad for my application on the rock3A).
Any suggestions?
L.