Skip to content

vc4/drm: Ignore vc4_hdmi->output_enabled for allowing audio#4759

Merged
pelwell merged 2 commits intoraspberrypi:rpi-5.10.yfrom
popcornmix:audio_hdmi_switch
Dec 8, 2021
Merged

vc4/drm: Ignore vc4_hdmi->output_enabled for allowing audio#4759
pelwell merged 2 commits intoraspberrypi:rpi-5.10.yfrom
popcornmix:audio_hdmi_switch

Conversation

@popcornmix
Copy link
Copy Markdown
Collaborator

Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley popcornmix@gmail.com

Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
@popcornmix
Copy link
Copy Markdown
Collaborator Author

After discussion with @6by9 @mripard @HiassofT
Main symptom without this is audio output fails sometimes when playing a video, as audio and video output from kodi come from different tasks, and if the audio startup hit mode set, we fail.
@HiassofT would be good if you can confirm this modified version still seems good.

Comment thread drivers/gpu/drm/vc4/vc4_hdmi.c
@popcornmix
Copy link
Copy Markdown
Collaborator Author

Removing output_enabled also means vc4_hdmi_encoder_enable and vc4_hdmi_encoder_disable are not required.
Pushed a fixup commit.

@6by9
Copy link
Copy Markdown
Contributor

6by9 commented Dec 8, 2021

Looks highly plausible to me.

@pelwell
Copy link
Copy Markdown
Contributor

pelwell commented Dec 8, 2021

Less code = more better.

@pelwell pelwell merged commit bed937a into raspberrypi:rpi-5.10.y Dec 8, 2021
pelwell pushed a commit that referenced this pull request Dec 9, 2021
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
pelwell pushed a commit that referenced this pull request Dec 9, 2021
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
@HiassofT
Copy link
Copy Markdown
Contributor

I just noticed this change seems to be causing a splat in prepare(), which was previously guarded with the hdmi packet RAM check in startup() - hard to tell how often we hit it as it's using WARN_ONCE

[  277.554350] ------------[ cut here ]------------
[  277.559004] Packet RAM has to be on to store the packet.
[  277.559055] WARNING: CPU: 3 PID: 832 at vc4_hdmi_write_infoframe+0x45c/0x5f0
[  277.571398] Modules linked in: ir_nec_decoder bcm2835_isp(C) bcm2835_codec(C) bcm2835_mmal_vchiq(C) rpivid_hevc(C) v4l2_mem2mem videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 videobuf2_common spi_bcm2835 bcm2835_gpiomem videodev ir_rc6_decoder mc rc_rc6_mce gpio_ir_recv nvmem_rmem fuse
[  277.597236] CPU: 3 PID: 832 Comm: AESink Tainted: G         C        5.10.83 #1
[  277.604534] Hardware name: Raspberry Pi 4 Model B Rev 1.1 (DT)
[  277.610362] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--)
[  277.616362] pc : vc4_hdmi_write_infoframe+0x45c/0x5f0
[  277.621405] lr : vc4_hdmi_write_infoframe+0x45c/0x5f0
[  277.626446] sp : ffffffc0131139c0
[  277.629750] x29: ffffffc0131139c0 x28: ffffff8051814240 
[  277.635054] x27: 0000000000000000 x26: ffffff8041c7c4b8 
[  277.640358] x25: 0000000000000000 x24: ffffffc013113b60 
[  277.645662] x23: 0000000000024414 x22: ffffff8041c7cc30 
[  277.650967] x21: ffffffc012205b00 x20: ffffff8041c7c080 
[  277.656271] x19: ffffffc013113ac4 x18: 0000000000000000 
[  277.661574] x17: 0000000000000001 x16: 0000000000000001 
[  277.666878] x15: 0000000000000030 x14: ffffffffffffffff 
[  277.672181] x13: ffffffc093113607 x12: ffffffc01311360f 
[  277.677484] x11: 0000000000000000 x10: ffffffc0118ca030 
[  277.682787] x9 : ffffffc0100a94f0 x8 : ffffffc01186f7c8 
[  277.688090] x7 : ffffffc0118c77c8 x6 : 0000000000000001 
[  277.693394] x5 : ffffff80fb7e3a58 x4 : 0000000000000000 
[  277.698697] x3 : 0000000000000027 x2 : 0000000000000000 
[  277.704000] x1 : 0000000000000000 x0 : ffffff8051814240 
[  277.709304] Call trace:
[  277.711743]  vc4_hdmi_write_infoframe+0x45c/0x5f0
[  277.716440]  vc4_hdmi_audio_prepare+0x5f8/0xce0
[  277.720964]  hdmi_codec_prepare+0x140/0x1b0
[  277.725142]  snd_soc_pcm_dai_prepare+0x5c/0x10c
[  277.729663]  soc_pcm_prepare+0x5c/0x11c
[  277.733491]  snd_pcm_prepare+0x148/0x1a4
[  277.737403]  snd_pcm_common_ioctl+0xc48/0x1004
[  277.741837]  snd_pcm_ioctl_compat+0x380/0x980
[  277.746188]  __arm64_compat_sys_ioctl+0xb4/0x1bc
[  277.750800]  el0_svc_common.constprop.0+0x84/0x1e0
[  277.755582]  do_el0_svc_compat+0x28/0x60
[  277.759497]  el0_svc_compat+0x20/0x30
[  277.763150]  el0_sync_compat_handler+0x90/0x160
[  277.767673]  el0_sync_compat+0x184/0x1c0
[  277.771586] ---[ end trace 95065bbd2adeefa5 ]---

@popcornmix popcornmix deleted the audio_hdmi_switch branch December 14, 2021 16:28
popcornmix added a commit that referenced this pull request Dec 16, 2021
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Dec 16, 2021
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Dec 17, 2021
kernel: ASoC:ma120x0p: Increase maximum sample rate to 192KHz
See: ASoC:ma120x0p: Increase maximum sample rate to 192KHz

kernel: Add cam0 parameter to image sensor overlays
See: Add cam0 parameter to image sensor overlays

kernel: drm/vc4: Fix build without DRM_VC4_HDMI_CEC
See: raspberrypi/linux#4771

kernel: v2 fix for the VLI TRB cache bug
See: raspberrypi/linux#4768

kernel: ARM: dts: Create bcm2711-rpi-cm4s.dts
See: raspberrypi/linux#4761

kernel: vc4/drm: Ignore vc4_hdmi->output_enabled for allowing audio
See: raspberrypi/linux#4759

kernel: media: imx219: Advertise embedded data node on media pad 1
See: raspberrypi/linux#4758
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Dec 17, 2021
kernel: ASoC:ma120x0p: Increase maximum sample rate to 192KHz
See: ASoC:ma120x0p: Increase maximum sample rate to 192KHz

kernel: Add cam0 parameter to image sensor overlays
See: Add cam0 parameter to image sensor overlays

kernel: drm/vc4: Fix build without DRM_VC4_HDMI_CEC
See: raspberrypi/linux#4771

kernel: v2 fix for the VLI TRB cache bug
See: raspberrypi/linux#4768

kernel: ARM: dts: Create bcm2711-rpi-cm4s.dts
See: raspberrypi/linux#4761

kernel: vc4/drm: Ignore vc4_hdmi->output_enabled for allowing audio
See: raspberrypi/linux#4759

kernel: media: imx219: Advertise embedded data node on media pad 1
See: raspberrypi/linux#4758
popcornmix added a commit that referenced this pull request Dec 17, 2021
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Dec 22, 2021
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Dec 22, 2021
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Dec 31, 2021
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Dec 31, 2021
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Jan 5, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Jan 5, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Jan 10, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Jan 11, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Jan 11, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Jan 11, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Jan 11, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Jan 17, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Feb 18, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Feb 22, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Feb 28, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Feb 28, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Feb 28, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Mar 4, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Mar 4, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Mar 9, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Mar 15, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Mar 15, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Mar 15, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Mar 21, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Mar 21, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Mar 21, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Mar 21, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
herrnst pushed a commit to herrnst/linux-raspberrypi that referenced this pull request Mar 28, 2022
…ypi#4759)

Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Mar 30, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Mar 30, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Apr 7, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Apr 7, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
herrnst pushed a commit to herrnst/linux-raspberrypi that referenced this pull request Apr 9, 2022
…ypi#4759)

Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Apr 11, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Apr 11, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Apr 11, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
herrnst pushed a commit to herrnst/linux-raspberrypi that referenced this pull request Apr 14, 2022
…ypi#4759)

Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Apr 19, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Apr 19, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Apr 19, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
herrnst pushed a commit to herrnst/linux-raspberrypi that referenced this pull request Apr 20, 2022
…ypi#4759)

Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
popcornmix added a commit that referenced this pull request Apr 25, 2022
Otherwise we reject audio playback when switching hdmi modes

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants