WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: piCore64 13.1: no sound through hdmi  (Read 3125 times)

Offline mortegai

  • Jr. Member
  • **
  • Posts: 55
piCore64 13.1: no sound through hdmi
« on: September 19, 2022, 07:51:32 AM »
I can't get sound through hdmi.

In config.txt:
Code: [Select]
#dtparam=audio=on

dtoverlay=vc4-kms-v3d
max_framebuffers=2

Code: [Select]
root@box:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
 
 
root@box:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault
    Default Audio Device
iec958
    IEC958 (S/PDIF) Digital Audio Output
default
hw:CARD=vc4hdmi0,DEV=0
    vc4-hdmi-0, MAI PCM i2s-hifi-0
    Direct hardware device without any conversions
plughw:CARD=vc4hdmi0,DEV=0
    vc4-hdmi-0, MAI PCM i2s-hifi-0
    Hardware device with all software conversions
sysdefault:CARD=vc4hdmi0
    vc4-hdmi-0, MAI PCM i2s-hifi-0
    Default Audio Device
front:CARD=vc4hdmi0,DEV=0
    vc4-hdmi-0, MAI PCM i2s-hifi-0
    Front output / input
iec958:CARD=vc4hdmi0,DEV=0
    vc4-hdmi-0, MAI PCM i2s-hifi-0
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=vc4hdmi0,DEV=0
    vc4-hdmi-0, MAI PCM i2s-hifi-0
    Direct sample mixing device
hw:CARD=vc4hdmi1,DEV=0
    vc4-hdmi-1, MAI PCM i2s-hifi-0
    Direct hardware device without any conversions
plughw:CARD=vc4hdmi1,DEV=0
    vc4-hdmi-1, MAI PCM i2s-hifi-0
    Hardware device with all software conversions
sysdefault:CARD=vc4hdmi1
    vc4-hdmi-1, MAI PCM i2s-hifi-0
    Default Audio Device
front:CARD=vc4hdmi1,DEV=0
    vc4-hdmi-1, MAI PCM i2s-hifi-0
    Front output / input
iec958:CARD=vc4hdmi1,DEV=0
    vc4-hdmi-1, MAI PCM i2s-hifi-0
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=vc4hdmi1,DEV=0
    vc4-hdmi-1, MAI PCM i2s-hifi-0
    Direct sample mixing device
root@box:~#

root@box:~# aplay /usr/local/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/local/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1343: Sample format non available
Available formats:
- IEC958_SUBFRAME_LE
root@box:~#

What can be the cause?

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: piCore64 13.1: no sound through hdmi
« Reply #1 on: September 19, 2022, 09:22:12 AM »
Is graphics-KERNEL loaded?

Offline mortegai

  • Jr. Member
  • **
  • Posts: 55
Re: piCore64 13.1: no sound through hdmi
« Reply #2 on: September 19, 2022, 11:08:10 AM »
Is graphics-KERNEL loaded?

Yes, this is my lsmod:
Code: [Select]
root@box:~# lsmod
Module                  Size  Used by    Tainted: G 
ipv6                  561152 20 [permanent]
squashfs               49152 159
snd_soc_hdmi_codec     20480  2
vc4                   311296  6
cec                    57344  1 vc4
drm_kms_helper        286720  3 vc4
v3d                    90112  2
gpu_sched              40960  1 v3d
brcmfmac              335872  0
brcmutil               24576  1 brcmfmac
raspberrypi_hwmon      16384  0
snd_soc_core          253952  2 snd_soc_hdmi_codec,vc4
drm                   577536  8 vc4,drm_kms_helper,v3d,gpu_sched
snd_compress           20480  1 snd_soc_core
snd_pcm_dmaengine      20480  1 snd_soc_core
i2c_brcmstb            16384  0
drm_panel_orientation_quirks    24576  1 drm
snd_pcm               139264  4 snd_soc_hdmi_codec,snd_soc_core,snd_compress,snd_pcm_dmaengine
snd_timer              36864  1 snd_pcm
cfg80211              868352  1 brcmfmac
snd                   106496  5 snd_soc_hdmi_codec,snd_soc_core,snd_compress,snd_pcm,snd_timer
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
fb_sys_fops            16384  1 drm_kms_helper
bcm2835_isp            32768  0
backlight              24576  2 drm_kms_helper,drm
bcm2835_codec          53248  0
bcm2835_v4l2           45056  0
bcm2835_mmal_vchiq     40960  3 bcm2835_isp,bcm2835_codec,bcm2835_v4l2
rpivid_hevc            57344  0
rfkill                 36864  2 cfg80211
v4l2_mem2mem           40960  2 bcm2835_codec,rpivid_hevc
videobuf2_dma_contig    24576  3 bcm2835_isp,bcm2835_codec,rpivid_hevc
vc_sm_cma              40960  2 bcm2835_isp,bcm2835_mmal_vchiq
videobuf2_vmalloc      20480  1 bcm2835_v4l2
videobuf2_memops       20480  2 videobuf2_dma_contig,videobuf2_vmalloc
videobuf2_v4l2         32768  5 bcm2835_isp,bcm2835_codec,rpivid_hevc,bcm2835_v4l2,v4l2_mem2mem
videobuf2_common       69632  9 bcm2835_isp,bcm2835_codec,rpivid_hevc,bcm2835_v4l2,v4l2_mem2mem,videobuf2_dma_contig,videobuf2_vmalloc,videobuf2_memops,videobuf2_v4l2
videodev              262144  7 bcm2835_isp,bcm2835_codec,rpivid_hevc,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2,videobuf2_common
mc                     61440  7 bcm2835_isp,bcm2835_codec,rpivid_hevc,v4l2_mem2mem,videobuf2_v4l2,videobuf2_common,videodev
nvmem_rmem             16384  0
uio_pdrv_genirq        16384  0
uio                    24576  1 uio_pdrv_genirq
root@box:~#

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 714
Re: piCore64 13.1: no sound through hdmi
« Reply #3 on: September 19, 2022, 11:41:37 AM »
As what i can see, you have two hdmi-0 hdmi-1, and your default points to what ?
Have you connected your output equipment like tv to hdmi port 2 ??
Maybe you have to set the default to connect to hdmi-0 or hdmi-1.
Thank you for get the result of the command aplay -L.

Code: (bash) [Select]
sysdefault:CARD=vc4hdmi1
    vc4-hdmi-1, MAI PCM i2s-hifi-0
    Default Audio Device

You could try to connect directly to the device using -D like this.
Code: (bash) [Select]
aplay -D hw:CARD=vc4hdmi0,DEV=0 somefile.wav
or

Code: (bash) [Select]
aplay -D hw:CARD=vc4hdmi1,DEV=0 somefile.wav

Or you can try the rest of them from your own list you got from the aplay -L command.
« Last Edit: September 19, 2022, 12:08:31 PM by patrikg »

Offline mortegai

  • Jr. Member
  • **
  • Posts: 55
Re: piCore64 13.1: no sound through hdmi
« Reply #4 on: September 19, 2022, 12:06:08 PM »
Pi 4 has 2 hdmi ports. 
Video is using hdmi0. 
Hoy to know what the default is for audio? 
Also in aplay -L
Code: [Select]
sysdefault:CARD=vc4hdmi0
    vc4-hdmi-0, MAI PCM i2s-hifi-0
    Default Audio Device

Same error using your suggestions using -D

Sound is working in RaspiOS
« Last Edit: September 19, 2022, 12:10:01 PM by mortegai »

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 714
Re: piCore64 13.1: no sound through hdmi
« Reply #5 on: September 19, 2022, 12:23:07 PM »
And also what I can see in the error message you got wrong wav format of the file.

Why not try i different wav file ??
You can also change lots of options in aplay command, to select the channels rate and so on.

Code: (bash) [Select]
Sample format non available
Available formats:
- IEC958_SUBFRAME_LE

Maybe the aplay command was not compiled with lots of formats.
Sorry to say I don't know how you could list all supported formats.

And what i can see you could also test the option --dump-hw-params to see what type of format the sound card supports.
Maybe you could extract the alsa config file from raspios and use it on picore.
If it some kind of config problem.

And be kind and reply to this even then you get it working, to let the community be known what you did to solve the problem.
« Last Edit: September 19, 2022, 12:38:33 PM by patrikg »

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1244
Re: piCore64 13.1: no sound through hdmi
« Reply #6 on: September 19, 2022, 01:01:03 PM »
Rather than playing an unknown wav file, I would use speaker-test.  Alsa should have the modified config file for that driver to work.

I would also only plug in one HDMI device for the initial testing.   Avoid the port confusion.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: piCore64 13.1: no sound through hdmi
« Reply #7 on: September 19, 2022, 04:50:34 PM »
The last time I tried hdmi sound worked with pavucontrol/pulseaudio, but not alsa.

Offline mortegai

  • Jr. Member
  • **
  • Posts: 55
Re: piCore64 13.1: no sound through hdmi
« Reply #8 on: September 20, 2022, 09:18:52 AM »
By trial and error, I managed to get ALSA sound over HDMI to work. 
The changes to make are:
- delete /etc/asound.conf (if existed)
- use /usr/local/share/alsa/cards/vc4-hdmi.conf from RaspiOS (bullseye)
« Last Edit: September 20, 2022, 09:52:59 AM by mortegai »

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 714
Re: piCore64 13.1: no sound through hdmi
« Reply #9 on: September 20, 2022, 11:25:47 AM »
Thank you for letting us know.

So my thinking of the config file was not horrible, so you can take it from raspbios.

Maybe the maintainer of the extension could update, with this corrected config file.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1244
Re: piCore64 13.1: no sound through hdmi
« Reply #10 on: September 20, 2022, 11:54:24 AM »
I'll have to check differences between the 32 and 64 bit versions of the extension, because I know HDMI works in 32bit.   Perhaps I forgot to integrate the config changes in the 64 bit version.

Offline mortegai

  • Jr. Member
  • **
  • Posts: 55
Re: piCore64 13.1: no sound through hdmi
« Reply #11 on: September 20, 2022, 01:55:50 PM »
For me, piCore 32 ALSA sound via HDMI doesn't work either.

Until I replace vc4-hdmi.conf with the RaspiOS one.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1244
Re: piCore64 13.1: no sound through hdmi
« Reply #12 on: September 20, 2022, 04:12:37 PM »
Interesting, as usual, there are many different ways to configure alsa, I'm sure there is some differences.   But if that file fixes it, I don't see the harm in adding it.