Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

fix for 24/32bit H3 audio capture

Featured Replies

Hi all,

I created a patch that applies to the mainline kernel v.14-rc6 to enable 32/24bits audio captures for H2+/H3 SoC.

Just wanted to share this with the community.

Kind regards,

Andrea

--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -346,11 +346,6 @@
                                   0x3 << 8,
                                   0x1 << 8);

-       /* Fill most significant bits with valid data MSB */
-       regmap_field_update_bits(scodec->reg_adc_fifoc,
-                                BIT(SUN4I_CODEC_ADC_FIFOC_RX_FIFO_MODE),
-                                BIT(SUN4I_CODEC_ADC_FIFOC_RX_FIFO_MODE));
-
        return 0;
 }

@@ -490,6 +485,31 @@
                                         BIT(SUN4I_CODEC_ADC_FIFOC_MONO_EN),
                                         0);

+       /* Set the number of sample bits to either 16 or 24 bits */
+       if (hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS)->min == 32) {
+               regmap_field_update_bits(scodec->reg_adc_fifoc, SUN4I_CODEC_ADC_FIFOC,
+                                  BIT(SUN4I_CODEC_ADC_FIFOC_RX_SAMPLE_BITS),
+                                  BIT(SUN4I_CODEC_ADC_FIFOC_RX_SAMPLE_BITS));
+
+               
+               regmap_field_update_bits(scodec->reg_adc_fifoc, SUN4I_CODEC_ADC_FIFOC,
+                                  BIT(SUN4I_CODEC_ADC_FIFOC_RX_FIFO_MODE),
+                                  0);
+
+               scodec->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
+       } else {
+               regmap_field_update_bits(scodec->reg_adc_fifoc, SUN4I_CODEC_ADC_FIFOC,
+                                  BIT(SUN4I_CODEC_ADC_FIFOC_RX_SAMPLE_BITS),
+                                  0);
+
+               /* Fill most significant bits with valid data MSB */
+               regmap_field_update_bits(scodec->reg_adc_fifoc, SUN4I_CODEC_ADC_FIFOC,
+                                  BIT(SUN4I_CODEC_ADC_FIFOC_RX_FIFO_MODE),
+                                  BIT(SUN4I_CODEC_ADC_FIFOC_RX_FIFO_MODE));
+
+               scodec->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
+       }
+
        return 0;
 }

 

 

  • Author
3 hours ago, vlad59 said:

Great !

 

Please try to propose it to linux-sunxi or did you take it from there ?

I don’t know the status in linux-sunxi I created the patch by looking at the implementation of the audio playback part in the mainline kernel. I will check and submit it eventually.

 

3 hours ago, jernej said:

 

That's nice, but even better would be to send it to upstream. Did you do that?

No, not yet.

I expected that the new 4.14 soon-to-be-released was covering that, as Andrea points out though obviously needs some more work.

 

Codekipper probably needs to be aware of this and possibly to include it in the next release if the time window permits, I think we got a couple of RC iterations until conclusion.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.