Closed archerallstars closed 2 months ago
Hello @kreaninw,
Thanks for your report. Let's do this.
First, the topology file (hda-generic-tplg.xml -> hda-generic-1ep-tplg.xml) found in this very repo exposes a single FrontEnd endpoint what matches your configuration. From alsa-info.txt I see an alc255 HDAudio codec exposing a headset i.e.: one playback and one capture endpoint. Unsure about supported formats by those two though. Of course, there are more devices present on your platform: HDMI and DMIC.
The HDAudio topology you received accepts S16/24/32_LE. If an attempt to open a stream by an application ends with -2
, it might mean that there's a problem with topology. Perhaps too much is allowed. In case of DMIC, given format may be simply unsupported - missing blob in NHLT table.
Would you mind killing any alive audio service and performing manual streaming? Please repeat the process for two formats: S16_LE and S24_LE.
aplay -Dhw:<card id>,<device id> -c2 -r48000 -fS24_LE -vv /dev/urandom
To be clear, if aplay -l
on a platform shows:
test@test-Client-Platform:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: avsrt274 [avs_rt274], device 1: Audio (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
then complete command for the above is:
aplay -Dhw:1,1 -c2 -r48000 -fS24_LE -vv /dev/urandom
Hi, @crojewsk-intel!
First I would like to thank you for your support. Your comments and gists are extremely useful.
It seems that I have the same laptop model as the author of the issue (Acer Swift SF514-52T/Carlsberg_KL)
I've found that sound is not working via regular HDMI port using snd_soc_skl driver. Additionally there is a trace message in dmesg about snd_soc_skl, but despite this audio functions are working normally except HDMI.
``` [ 32.990767] memcpy: detected field-spanning write (size 2984) of single field "&cpr_mconfig->gtw_cfg.config_data" at sound/soc/intel/skylake/skl-messages.c:552 (size 4) [ 32.990790] WARNING: CPU: 7 PID: 1510 at sound/soc/intel/skylake/skl-messages.c:552 skl_init_module+0x8a2/0x8c0 [snd_soc_skl] [ 32.990825] Modules linked in: ccm algif_aead des_generic libdes ecb algif_skcipher bnep cmac md4 algif_hash af_alg snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_soc_skl_ssp_clk ledtrig_audio snd_soc_avs snd_soc_dmic snd_soc_hda_codec snd_soc_skl snd_soc_hdac_hda snd_hda_ext_core snd_soc_sst_ipc snd_soc_sst_dsp snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi intel_tcc_cooling x86_pkg_temp_thermal snd_hda_codec intel_powerclamp iwlmvm coretemp snd_hda_core kvm_intel snd_hwdep i915 mac80211 uvcvideo snd_seq btusb libarc4 btrtl videobuf2_vmalloc btbcm kvm snd_seq_device btintel drm_buddy uvc iTCO_wdt snd_pcm videobuf2_memops processor_thermal_device_pci_legacy irqbypass i2c_algo_bit intel_pmc_bxt iTCO_vendor_support iwlwifi btmtk acer_wmi rapl videobuf2_v4l2 intel_cstate mei_pxp mei_hdcp intel_rapl_msr intel_wmi_thunderbolt bluetooth wmi_bmof sparse_keymap [ 32.990912] cfg80211 ttm processor_thermal_device ecdh_generic snd_timer processor_thermal_rfim i2c_i801 intel_uncore videodev processor_thermal_mbox processor_thermal_rapl vfat snd drm_display_helper videobuf2_common fat i2c_smbus mei_me soundcore ucsi_acpi mc cec intel_lpss_pci intel_pch_thermal rfkill intel_lpss i2c_hid_acpi mei intel_xhci_usb_role_switch intel_rapl_common typec_ucsi intel_gtt idma64 typec intel_soc_dts_iosf roles i2c_hid video int3403_thermal int340x_thermal_zone wmi mousedev joydev int3400_thermal acpi_thermal_rel acpi_pad acer_wireless mac_hid essiv authenc pkcs8_key_parser dm_multipath crypto_user fuse loop ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 dm_crypt cbc encrypted_keys trusted asn1_encoder tee hid_multitouch usbhid dm_mod crct10dif_pclmul crc32_pclmul crc32c_intel polyval_clmulni polyval_generic serio_raw gf128mul atkbd ghash_clmulni_intel libps2 sha512_ssse3 vivaldi_fmap aesni_intel xhci_pci crypto_simd xhci_pci_renesas cryptd i8042 serio [ 32.991031] CPU: 7 PID: 1510 Comm: pulseaudio Not tainted 6.4.11-arch2-1 #1 97b2f722c7732577cb713428e1f14bfdbe1faa91 [ 32.991036] Hardware name: Acer Swift SF514-52T/Carlsberg_KL, BIOS V1.11 11/26/2018 [ 32.991038] RIP: 0010:skl_init_module+0x8a2/0x8c0 [snd_soc_skl] [ 32.991069] Code: 01 00 00 0f 85 b5 fe ff ff 48 c7 c2 18 88 b6 c1 4c 89 fe 48 89 04 24 48 c7 c7 00 87 b6 c1 c6 05 44 41 01 00 01 e8 7e 5e 57 c0 <0f> 0b 48 8b 04 24 e9 89 fe ff ff e8 0e dd 22 c1 48 c7 c7 7b 69 b6 ```
So I have decided to use avs driver on Arch with 6.4.11 kernel. But no luck - no sound cards working at all. Errors which I observe are different from that in authors logs above.
What I have done:
options snd-intel-dspcfg dsp_driver=4
in /etc/modprobe.d/swift5.conf``` [ 0.000000] microcode: updated early: 0x9a -> 0xf4, date = 2023-02-23 [ 0.000000] Linux version 6.4.11-arch2-1 (linux@archlinux) (gcc (GCC) 13.2.1 20230801, GNU ld (GNU Binutils) 2.41.0) #1 SMP PREEMPT_DYNAMIC Sat, 19 Aug 2023 15:38:34 +0000 [ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-linux root=/dev/mapper/root rw root=UUID= rw loglevel=3 root=/dev/mapper/root acpi_backlight=video acpi_osi=Linux pci=nocrs i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 usbcore.quirks=2386:433b:bk rd.luks.uuid= rd.luks.uuid= rd.luks.name= rd.luks.name= rd.luks.uuid= rd.luks.name= resume=/dev/mapper/swap2 [ 0.000000] efi: EFI v2.5 by INSYDE Corp. [ 0.000000] efi: TPMFinalLog=0x8a885000 ACPI 2.0=0x8affd014 SMBIOS=0x8a094000 SMBIOS 3.0=0x8a092000 ESRT=0x8a090698 INITRD=0x73ad7f58 RNG=0x8af99018 TPMEventLog=0x73ad0018 [ 0.000000] random: crng init done [ 0.000000] SMBIOS 3.0.0 present. [ 0.000000] DMI: Acer Swift SF514-52T/Carlsberg_KL, BIOS V1.11 11/26/2018 [ 0.000000] tsc: Detected 1800.000 MHz processor [ 17.655618] snd_soc_avs 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915]) [ 17.706239] snd_soc_avs 0000:00:1f.3: cldma_irq_handler sd_status: 0x00000004 [ 17.706278] snd_soc_avs 0000:00:1f.3: cldma_irq_handler sd_status: 0x00000004 [ 17.717987] avs_dmic avs_dmic: ASoC: Parent card not yet available, widget card binding deferred [ 17.719607] Bluetooth: hci0: Intel BT fw patch 0x32 completed & activated [ 17.725374] snd_hda_codec_realtek hdaudioB0D0: autoconfig for ALC255: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker [ 17.725381] snd_hda_codec_realtek hdaudioB0D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0) [ 17.725384] snd_hda_codec_realtek hdaudioB0D0: hp_outs=1 (0x21/0x0/0x0/0x0/0x0) [ 17.725387] snd_hda_codec_realtek hdaudioB0D0: mono: mono_out=0x0 [ 17.725388] snd_hda_codec_realtek hdaudioB0D0: inputs: [ 17.728144] snd_hda_codec_realtek hdaudioB0D0: creating for ALC255 Analog 0 [ 17.728150] snd_hda_codec_realtek hdaudioB0D0: creating for ALC255 Alt Analog 1 [ 17.728152] snd_hda_codec_realtek hdaudioB0D0: skipping playback dai for ALC255 Alt Analog [ 17.769763] snd_soc_avs 0000:00:1f.3: Direct firmware load for intel/avs/hda-10ec0255-tplg.bin failed with error -2 [ 17.769770] snd_soc_avs 0000:00:1f.3: request topology "intel/avs/hda-10ec0255-tplg.bin" failed: -2 [ 17.769775] snd_soc_avs 0000:00:1f.3: ASoC: error at snd_soc_component_probe on hdaudioB0D0-platform: -2 [ 17.769788] avs_hdaudio avs_hdaudio.0: ASoC: failed to instantiate card -2 [ 17.769914] avs_hdaudio: probe of avs_hdaudio.0 failed with error -2 [ 17.778001] snd_hda_codec_hdmi hdaudioB0D2: creating for HDMI 0 0 [ 17.778007] snd_hda_codec_hdmi hdaudioB0D2: skipping capture dai for HDMI 0 [ 17.778009] snd_hda_codec_hdmi hdaudioB0D2: creating for HDMI 1 1 [ 17.778012] snd_hda_codec_hdmi hdaudioB0D2: skipping capture dai for HDMI 1 [ 17.778014] snd_hda_codec_hdmi hdaudioB0D2: creating for HDMI 2 2 [ 17.778017] snd_hda_codec_hdmi hdaudioB0D2: skipping capture dai for HDMI 2 [ 17.779348] avs_hdaudio avs_hdaudio.2: ASoC: Parent card not yet available, widget card binding deferred [ 17.779469] avs_hdaudio avs_hdaudio.2: avs_card_late_probe: mapping HDMI converter 1 to PCM 1 (0000000069d06f88) [ 17.779475] avs_hdaudio avs_hdaudio.2: avs_card_late_probe: mapping HDMI converter 2 to PCM 2 (0000000010d199da) [ 17.779479] avs_hdaudio avs_hdaudio.2: avs_card_late_probe: mapping HDMI converter 3 to PCM 3 (000000003b3654c1) [ 17.781185] input: hdaudioB0D2 HDMI/DP,pcm=1 as /devices/platform/avs_hdaudio.2/sound/card2/input23 [ 17.781288] input: hdaudioB0D2 HDMI/DP,pcm=2 as /devices/platform/avs_hdaudio.2/sound/card2/input24 [ 17.781384] input: hdaudioB0D2 HDMI/DP,pcm=3 as /devices/platform/avs_hdaudio.2/sound/card2/input25 ```
``` aplay -lL null Discard all samples (playback) or generate zero samples (capture) **** List of PLAYBACK Hardware Devices **** card 2: hdaudioB0D2 [hdaudioB0D2], device 1: HDMI1 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: hdaudioB0D2 [hdaudioB0D2], device 2: HDMI2 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: hdaudioB0D2 [hdaudioB0D2], device 3: HDMI3 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 ```
``` 00:1f.3 Multimedia audio controller: Intel Corporation Sunrise Point-LP HD Audio (rev 21) Subsystem: Acer Incorporated [ALI] Sunrise Point-LP HD Audio Kernel driver in use: snd_soc_avs Kernel modules: snd_hda_intel, snd_soc_skl, snd_soc_avs ```
Driver tries to load intel/avs/hda-10ec0255-tplg.bin topology, but there is no such file in this repository nor did I find one in other places. May be I've missed something while setting up the driver and topology files, I will appreciate any help.
Hello @Peter-Sh,
Sorry for the delayed response, missed the notification in my email. In regard to the missing 10ec0255-tplg.bin
subject - you may use the generic HDAudio topology for single endpoint devices. It goes by the hda-generic-1p-tplg.xml
in this repo. Vast majority of HDAudio codec devices expose just a single playback and capture endpoint and there is no need to tailor a topology file in any particular fashion at all.
ln -s hda-generic-1ep-tplg.bin hda-10ec0255-tplg.bin
We have patches in our internal tree that modify topology-loading procedure behavior to always fallback to the generic names and attempt to load them. Those patches should have been sent to upstream quite a while ago, will do so and notify here what's the patchset thread.
Hello @crojewsk-intel !
Thanks for the answer!
I've created symlink and now topologies are loaded by avs driver. I can play a sound via speakers and even via HDMI using aplay and record sound using arecord.
However pulseaudio is now broken.
``` [ 0.976807] ata2.00: Features: Dev-Sleep NCQ-sndrcv [ 0.978120] ata3.00: Features: Dev-Sleep NCQ-sndrcv NCQ-prio [ 19.203442] snd_soc_avs 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915]) [ 19.257747] snd_soc_avs 0000:00:1f.3: cldma_irq_handler sd_status: 0x00000004 [ 19.257903] snd_soc_avs 0000:00:1f.3: cldma_irq_handler sd_status: 0x00000004 [ 19.289773] avs_dmic avs_dmic: ASoC: Parent card not yet available, widget card binding deferred [ 19.296401] snd_hda_codec_realtek hdaudioB0D0: autoconfig for ALC255: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker [ 19.296415] snd_hda_codec_realtek hdaudioB0D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0) [ 19.296422] snd_hda_codec_realtek hdaudioB0D0: hp_outs=1 (0x21/0x0/0x0/0x0/0x0) [ 19.296428] snd_hda_codec_realtek hdaudioB0D0: mono: mono_out=0x0 [ 19.296432] snd_hda_codec_realtek hdaudioB0D0: inputs: [ 19.299894] snd_hda_codec_realtek hdaudioB0D0: creating for ALC255 Analog 0 [ 19.299903] snd_hda_codec_realtek hdaudioB0D0: creating for ALC255 Alt Analog 1 [ 19.299907] snd_hda_codec_realtek hdaudioB0D0: skipping playback dai for ALC255 Alt Analog [ 19.340489] avs_hdaudio avs_hdaudio.0: ASoC: Parent card not yet available, widget card binding deferred [ 19.340811] input: hdaudioB0D0 Front Headphone as /devices/platform/avs_hdaudio.0/sound/card2/input14 [ 19.349291] snd_hda_codec_hdmi hdaudioB0D2: creating for HDMI 0 0 [ 19.349295] snd_hda_codec_hdmi hdaudioB0D2: skipping capture dai for HDMI 0 [ 19.349296] snd_hda_codec_hdmi hdaudioB0D2: creating for HDMI 1 1 [ 19.349298] snd_hda_codec_hdmi hdaudioB0D2: skipping capture dai for HDMI 1 [ 19.349299] snd_hda_codec_hdmi hdaudioB0D2: creating for HDMI 2 2 [ 19.349301] snd_hda_codec_hdmi hdaudioB0D2: skipping capture dai for HDMI 2 [ 19.349645] avs_hdaudio avs_hdaudio.2: ASoC: Parent card not yet available, widget card binding deferred [ 19.349721] avs_hdaudio avs_hdaudio.2: avs_card_late_probe: mapping HDMI converter 1 to PCM 1 (0000000078a67c32) [ 19.349725] avs_hdaudio avs_hdaudio.2: avs_card_late_probe: mapping HDMI converter 2 to PCM 2 (000000004a79a0a5) [ 19.349728] avs_hdaudio avs_hdaudio.2: avs_card_late_probe: mapping HDMI converter 3 to PCM 3 (000000007d5c0477) [ 19.351319] input: hdaudioB0D2 HDMI/DP,pcm=1 as /devices/platform/avs_hdaudio.2/sound/card3/input15 [ 19.351404] input: hdaudioB0D2 HDMI/DP,pcm=2 as /devices/platform/avs_hdaudio.2/sound/card3/input16 [ 19.351486] input: hdaudioB0D2 HDMI/DP,pcm=3 as /devices/platform/avs_hdaudio.2/sound/card3/input17 ```
``` **** List of PLAYBACK Hardware Devices **** card 2: hdaudioB0D0 [hdaudioB0D0], device 1: HDAudio Analog (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 3: hdaudioB0D2 [hdaudioB0D2], device 1: HDMI1 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 3: hdaudioB0D2 [hdaudioB0D2], device 2: HDMI2 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 3: hdaudioB0D2 [hdaudioB0D2], device 3: HDMI3 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 arecord **** List of CAPTURE Hardware Devices **** card 0: avsdmic [avs_dmic], device 2: Digital Microphone (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: hdaudioB0D0 [hdaudioB0D0], device 1: HDAudio Analog (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 ```
``` E: [pulseaudio] module-alsa-card.c: Failed to find a working profile. E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="0" name="platform-avs_dmic" card_name="alsa_card.platform-avs_dmic" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed. E: [pulseaudio] module-alsa-card.c: Failed to find a working profile. E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="2" name="platform-avs_hdaudio.0" card_name="alsa_card.platform-avs_hdaudio.0" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed. E: [pulseaudio] module-alsa-card.c: Failed to find a working profile. E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="3" name="platform-avs_hdaudio.2" card_name="alsa_card.platform-avs_hdaudio.2" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed. E: [pulseaudio] module-alsa-card.c: Failed to find a working profile. E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="platform-avs_probe_mb" card_name="alsa_card.platform-avs_probe_mb" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed. W: [pulseaudio] cli-command.c: stat('/etc/pulse/default.pa.d'): No such file or directory N: [pulseaudio] bluez5-util.c: Could not find org.bluez.BatteryProviderManager1.RegisterBatteryProvider(), is bluetoothd started with experimental features enabled (-E flag)? ```
I can record sound with arecord -Dhw:0,2 -c2 -f S16_LE -vv -t wav w.wav
. Can't play it with aplay probably because incompatible formats (S16_LE and S24_LE), but it is playing via bluetooth headset.
When playing sound with aplay -Dhw:3,1 -c2 -r48000 -fS16_LE -vv /dev/urandom
(or similar commands for other devices) there is white noise in speakers and in HDMI via type c (type c -> hub -> hdmi) and via direct HDMI connection.
Looks like I'm almost there, may be I'm missing something for pulseaudio to recognize snd devices.
Judging by your input, aplay/arecord works fine on all the endpoints. That's great! In regard to pulseaudio - I'm not an expert there but I presume a valid UCM file is needed to make it happy.
I believe all the relevant technical information has been provided in the follow up of this problem i.e.: PR #24. Given lack of traffic in this subject for quite a while, closing.
If anything new pops up that is related and unaddressed, please open a new issue.
I try to enable the AVS driver on my device with
options snd-intel-dspcfg dsp_driver=4
, with firmware binaries below:fw-avs.zip
However, all my audio input and output devices are not available. Here's my
dmesg
with the AVS firmware binaries:I initially reported this issue on SUSE Bugzilla Bug 1213187.
I am on openSUSE Tumbleweed, Linux 6.4.3-1-default.