Page MenuHomeFreeBSD

Fix audio for Allwinner H3/H5
ClosedPublic

Authored by freebsdnewbie_freenet.de on Apr 14 2019, 5:19 PM.

Details

Summary

Due to three conditions the codec driver for Allwinner A10/A20 and H3/H5 did not work properly here:

  1. Wrong bit position for the analog audio reset
  2. Hardware Reset of codec was not de-asserted correctly
  3. Linux DTS file did not contain the address of the analog register the way as the driver was expecting it.

This patch proposes fixes for those three parts.

Test Plan

The patch was successfully tested on a Allwinner NanoPI NEO2 hardware.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Move H3/H5 specific setup into its mixer_init function.

sys/arm/allwinner/a10_codec.c
507 ↗(On Diff #56220)

Using reg[0] + reg[1] should work for the end parameter.

740 ↗(On Diff #56220)

What's the reason for this stop here ?

Changed "end"-parameter for resource allocation.

freebsdnewbie_freenet.de marked an inline comment as done and an inline comment as not done.

Move codec_stop call to a different place.

sys/arm/allwinner/a10_codec.c
740 ↗(On Diff #56220)

Sometimes during testing the sound did not start the first time after a cold start/reboot. When i started the player once again, the sound was played correctly. I just wanted to set the peripheral to a known state before starting over. With this stop placed here, i could not reproduce the error during playing a sound the first time after reboot.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 17 2019, 9:45 PM
This revision was automatically updated to reflect the committed changes.