Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: Intel: avs: Set of streaming fixes

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

Small set of patches two of which fix problems observed during shutdown
and XRUN scenarios for PCM streaming. These ensure HDAudio HOST stream
is reset and re-setup during XRUNs and synchronize avs_dai_fe_shutdown()
and period-elapsed work (thread) so that no slab-use-after-free panics
occur.

The last change makes the 'format' parameter provided by a
compress-application taken into account - currently its ignored. Such
approach helps us increase the coverage of data probing (debug)
functionality.

+14 -8
+3
sound/soc/intel/avs/pcm.c
··· 651 651 652 652 data = snd_soc_dai_get_dma_data(dai, substream); 653 653 654 + disable_work_sync(&data->period_elapsed_work); 654 655 snd_hdac_ext_stream_release(data->host_stream, HDAC_EXT_STREAM_TYPE_HOST); 655 656 avs_dai_shutdown(substream, dai); 656 657 } ··· 755 754 data = snd_soc_dai_get_dma_data(dai, substream); 756 755 host_stream = data->host_stream; 757 756 757 + if (runtime->state == SNDRV_PCM_STATE_XRUN) 758 + hdac_stream(host_stream)->prepared = false; 758 759 if (hdac_stream(host_stream)->prepared) 759 760 return 0; 760 761
+10 -8
sound/soc/intel/avs/probes.c
··· 14 14 #include "debug.h" 15 15 #include "messages.h" 16 16 17 - static int avs_dsp_init_probe(struct avs_dev *adev, union avs_connector_node_id node_id, 18 - size_t buffer_size) 17 + static int avs_dsp_init_probe(struct avs_dev *adev, struct snd_compr_params *params, int bps, 18 + union avs_connector_node_id node_id, size_t buffer_size) 19 19 { 20 20 struct avs_probe_cfg cfg = {{0}}; 21 21 struct avs_module_entry mentry; ··· 27 27 return ret; 28 28 29 29 /* 30 - * Probe module uses no cycles, audio data format and input and output 31 - * frame sizes are unused. It is also not owned by any pipeline. 30 + * Probe module uses no cycles, input and output frame sizes are unused. 31 + * It is also not owned by any pipeline. 32 32 */ 33 33 cfg.base.ibs = 1; 34 34 /* BSS module descriptor is always segment of index=2. */ 35 35 cfg.base.is_pages = mentry.segments[2].flags.length; 36 + cfg.base.audio_fmt.sampling_freq = params->codec.sample_rate; 37 + cfg.base.audio_fmt.bit_depth = bps; 38 + cfg.base.audio_fmt.num_channels = params->codec.ch_out; 39 + cfg.base.audio_fmt.valid_bit_depth = bps; 36 40 cfg.gtw_cfg.node_id = node_id; 37 41 cfg.gtw_cfg.dma_buffer_size = buffer_size; 38 42 ··· 132 128 struct hdac_ext_stream *host_stream = avs_compr_get_host_stream(cstream); 133 129 struct snd_compr_runtime *rtd = cstream->runtime; 134 130 struct avs_dev *adev = to_avs_dev(dai->dev); 135 - /* compr params do not store bit depth, default to S32_LE. */ 136 - snd_pcm_format_t format = SNDRV_PCM_FORMAT_S32_LE; 137 131 unsigned int format_val; 138 132 int bps, ret; 139 133 ··· 144 142 ret = snd_compr_malloc_pages(cstream, rtd->buffer_size); 145 143 if (ret < 0) 146 144 return ret; 147 - bps = snd_pcm_format_physical_width(format); 145 + bps = snd_pcm_format_physical_width(params->codec.format); 148 146 if (bps < 0) 149 147 return bps; 150 148 format_val = snd_hdac_stream_format(params->codec.ch_out, bps, params->codec.sample_rate); ··· 168 166 node_id.vindex = hdac_stream(host_stream)->stream_tag - 1; 169 167 node_id.dma_type = AVS_DMA_HDA_HOST_INPUT; 170 168 171 - ret = avs_dsp_init_probe(adev, node_id, rtd->dma_bytes); 169 + ret = avs_dsp_init_probe(adev, params, bps, node_id, rtd->dma_bytes); 172 170 if (ret < 0) { 173 171 dev_err(dai->dev, "probe init failed: %d\n", ret); 174 172 avs_dsp_enable_d0ix(adev);
+1
sound/soc/sdw_utils/soc_sdw_utils.c
··· 313 313 }, 314 314 { 315 315 .part_id = 0x1321, 316 + .name_prefix = "rt1320", 316 317 .dais = { 317 318 { 318 319 .direction = {true, false},