Jump to content

Recommended Posts

Posted

Description

New codec and hub code for HDMI and analog sound on Allwinner H616 and H618 SOCs, including all the bits and pieces to implement the code (dts and configs).

How Has This Been Tested?

The patch was implemented on a recent fork of armbian build main. two images were built, Debian bookworm server from edge and Debian bookwork desktop xfce from current.

Server testing: Analog audio was unmuted using alsamixer by unmuting Left out DACL and Right out DACR. Mpg123 was installed and used to play an mp3 file. Aplay speaker-test was also used to check left and right audio. Playing the mpg file and the speaker-test were also performed from an HDMI monitor connection.

root@orangepizero3:~# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: audiocodec [audiocodec], device 0: CDC PCM Codec-0 [CDC PCM Codec-0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: HDMI [HDMI], device 0: ahub_plat-i2s-hifi i2s-hifi-0 [ahub_plat-i2s-hifi i2s-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 root@orangepizero3:~# aplay -L null Discard all samples (playback) or generate zero samples (capture) hw:CARD=audiocodec,DEV=0 audiocodec, CDC PCM Codec-0 Direct hardware device without any conversions plughw:CARD=audiocodec,DEV=0 audiocodec, CDC PCM Codec-0 Hardware device with all software conversions default:CARD=audiocodec audiocodec, CDC PCM Codec-0 Default Audio Device sysdefault:CARD=audiocodec audiocodec, CDC PCM Codec-0 Default Audio Device dmix:CARD=audiocodec,DEV=0 audiocodec, CDC PCM Codec-0 Direct sample mixing device hw:CARD=HDMI,DEV=0 HDMI, ahub_plat-i2s-hifi i2s-hifi-0 Direct hardware device without any conversions plughw:CARD=HDMI,DEV=0 HDMI, ahub_plat-i2s-hifi i2s-hifi-0 Hardware device with all software conversions default:CARD=HDMI HDMI, ahub_plat-i2s-hifi i2s-hifi-0 Default Audio Device sysdefault:CARD=HDMI HDMI, ahub_plat-i2s-hifi i2s-hifi-0 Default Audio Device dmix:CARD=HDMI,DEV=0 HDMI, ahub_plat-i2s-hifi i2s-hifi-0 Direct sample mixing device root@orangepizero3:~#

ANALOG tests:

sysadmin@orangepizero3:~$ mpg123 Scarborough\ Fair.mp3 High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3 version 1.31.2; written and copyright by Michael Hipp and others free software (LGPL) without any warranty but with best wishes

Terminal control enabled, press 'h' for listing of keys and functions.

Playing MPEG stream 1 of 1: Scarborough Fair.mp3 ...

MPEG 1.0 L III cbr96 44100 j-s

Title: Scarborough Fair/canticle Artist: Paul Simon Comment: Album: Art Garfunkel / The Graduate - Year: 1968 Genre: Soundtrack

sysadmin@orangepizero3:~$ speaker-test -t wav -c 2

speaker-test 1.2.8

Playback device is default Stream parameters are 48000Hz, S16_LE, 2 channels WAV file(s) Rate set to 48000Hz (requested 48000Hz) Buffer size range from 32 to 131072 Period size range from 16 to 65536 Using max buffer size 131072 Periods = 4 was set period_size = 32768 was set buffer_size = 131072 0 - Front Left 1 - Front Right Time per period = 0.737457 0 - Front Left 1 - Front Right Time per period = 2.737752 0 - Front Left 1 - Front Right

HDMI tests:

sysadmin@orangepizero3:~$ mpg123 -a hw:1,0 Scarborough\ Fair.mp3 High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3 version 1.31.2; written and copyright by Michael Hipp and others free software (LGPL) without any warranty but with best wishes

Terminal control enabled, press 'h' for listing of keys and functions.

Playing MPEG stream 1 of 1: Scarborough Fair.mp3 ...

MPEG 1.0 L III cbr96 44100 j-s

Title: Scarborough Fair/canticle Artist: Paul Simon Comment: Album: Art Garfunkel / The Graduate - Year: 1968 Genre: Soundtrack

[src/libout123/libout123.c:out123_play():700] error: Error in writing audio, wrote only 3824 of 4608 (Success?)!

[0:14] Decoding of Scarborough Fair.mp3 finished.

sysadmin@orangepizero3:~$ speaker-test -D hw:1,0 -t wav -c 2

speaker-test 1.2.8

Playback device is hw:1,0 Stream parameters are 48000Hz, S16_LE, 2 channels WAV file(s) Rate set to 48000Hz (requested 48000Hz) Buffer size range from 32 to 131072 Period size range from 16 to 65536 Using max buffer size 131072 Periods = 4 was set period_size = 32768 was set buffer_size = 131072 0 - Front Left 1 - Front Right Time per period = 0.729233 0 - Front Left 1 - Front Right Time per period = 2.737477 0 - Front Left 1 - Front Right ^CTransfer failed: Bad address sysadmin@orangepizero3:~$

Results: all tests worked as expected.

Desktop testing:

The server tests were performed from a terminal window on the desktop image. In addition a music video with audio was played on chromium youtube. An mp3 music file was played with the Celluloid app. The tests were done on both analog and HDMI, using pulseaudio to switch between outputs.

All tests performed as expected.

There was an anomaly observed when using the pulseaudio volume control on the analog output. When pulse audio volume control was selected, the analog audio started to play at high speed. This did not happen on HDMI output. The issue can be worked around by using pulseausio volume control configure tab to turn off HDMI when using the analog output.

This patch, a repository with the patch and a few images were posted to the Allwinner sunxi community forum from where a number of members reported successful tests. https://forum.armbian.com/topic/37718-sound-on-h616h618-socs/

Checklist:

  • [ x ] My changes generate no new warnings
  • [ x] Any dependent changes have been merged and published in downstream modules

View the full article

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines