Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ayaneo Air 1S needs extra firmware file for sound #1753

Closed
dog-in-space opened this issue Oct 20, 2024 · 39 comments
Closed

Ayaneo Air 1S needs extra firmware file for sound #1753

dog-in-space opened this issue Oct 20, 2024 · 39 comments
Labels
bug Something isn't working stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed

Comments

@dog-in-space
Copy link

dog-in-space commented Oct 20, 2024

Describe the bug

Ayaneo Air 1S does not have any sound in bazzite due to a really odd speaker pin out.

What did you expect to happen?

This issue have been fixed in a few other similar distro's like ChimeraOS/chimeraos@2ae2da7 and SteamFork/distribution@16b7859

Hardware

Ayaneo Air 1S

@dog-in-space dog-in-space changed the title Ayaneo Air 1S needs extra firmware file Ayaneo Air 1S needs extra firmware file for sound Oct 20, 2024
@dosubot dosubot bot added the bug Something isn't working label Oct 20, 2024
@antheas
Copy link
Contributor

antheas commented Oct 24, 2024

Fix will be in the next bazzite unstable version and come with F41.

@dog-in-space
Copy link
Author

Still not fixed as of unstable-41.20241026

Will report back as testing versions come out...

@antheas
Copy link
Contributor

antheas commented Oct 27, 2024

Thanks for catching that. New build in unstable with the firmware file.

@dog-in-space
Copy link
Author

Firmware file is in place as of 313ffe8 but still no sound on the Aya Neo Air 1s.

I have confirmed the firmware file is located at /usr/lib/firmware/aw87xxx_acf.bin.xz and /usr/lib/firmware/aw87559/aw87xxx_acf.bin.xz as of unstable-41.20241027.3 images

Maybe it doesn't like being in .xz format?

@antheas
Copy link
Contributor

antheas commented Oct 27, 2024

Paste a dmesg here

@antheas
Copy link
Contributor

antheas commented Oct 27, 2024

lsmod | grep aw87xxx does that show anything"

@antheas
Copy link
Contributor

antheas commented Oct 27, 2024

The realtek quirk for the 1S is there for sure too

@dog-in-space
Copy link
Author

justinhunkele@syn-2603-6010-e4f0-81b0-0000-0000-0000-1aa9:~$ lsmod | grep aw87xxx
snd_soc_aw87xxx       188416  0
snd_soc_core          512000  3 snd_soc_aw87xxx,snd_sof,soundwire_amd
justinhunkele@syn-2603-6010-e4f0-81b0-0000-0000-0000-1aa9:~$ 

@dog-in-space
Copy link
Author

dog-in-space commented Oct 27, 2024

justinhunkele@syn-2603-6010-e4f0-81b0-0000-0000-0000-1aa9:~$ sudo dmesg | grep aw87
[    6.663804] [Awinic] [i2c-AWDZ8830:00]aw87xxx_i2c_probe: I2C_ACPI_CLIENT_COUNT returned [2]
[    6.663809] [Awinic] [i2c-AWDZ8830:00]aw87xxx_malloc_init: Driver struct alloc and mutex init done, devinfo: i2c_bus=1, i2c_addr=58
[    6.663814] [Awinic] [i2c-AWDZ8830:00]aw87xxx_device_parse_port_id_dt: read aw-rx-port-id failed,use default
[    6.663817] [Awinic] [i2c-AWDZ8830:00]aw87xxx_device_parse_port_id_dt: rx-port-id: 0x4000
[    6.663819] [Awinic] [i2c-AWDZ8830:00]aw87xxx_device_parse_topo_id_dt: read aw-rx-topo-id failed,use default
[    6.663822] [Awinic] [i2c-AWDZ8830:00]aw87xxx_device_parse_topo_id_dt: rx-topo-id: 0x1000ff01
[    6.663889] [Awinic] [i2c-AWDZ8830:00]aw87xxx_i2c_probe: reset gpio[24c] parse succeed
[    6.667904] [Awinic] [i2c-AWDZ8830:00]aw87xxx_dev_hw_pwr_ctrl: hw power on
[    6.668079] [Awinic] [i2c-AWDZ8830:00]aw87xxx_dev_get_chipid: read chipid[0x5a] succeed
[    6.670218] [Awinic] [i2c-AWDZ8830:00]aw87xxx_dev_hw_pwr_ctrl: hw power off
[    6.672458] [Awinic] [i2c-AWDZ8830:00]aw87xxx_fw_load_init: enter
[    6.672521] [Awinic] [i2c-AWDZ8830:00]aw87xxx_monitor_init: monitor init succeed
[    6.672523] [Awinic] [i2c-AWDZ8830:00]aw87xxx_i2c_probe: succeed, dev_index=[1], g_aw87xxx_dev_cnt= [1]
[    6.672525] [Awinic] [i2c-AWDZ8830:00]aw87xxx_i2c_probe: acpi_c=[2] dev_c=[1]
[    6.676553] [Awinic] [i2c-AWDZ8830:00]aw87xxx_dev_hw_pwr_ctrl: hw power on
[    6.676711] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_malloc_init: Driver struct alloc and mutex init done, devinfo: i2c_bus=1, i2c_addr=5b
[    6.676716] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_device_parse_port_id_dt: read aw-rx-port-id failed,use default
[    6.676718] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_device_parse_port_id_dt: rx-port-id: 0x4000
[    6.676720] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_device_parse_topo_id_dt: read aw-rx-topo-id failed,use default
[    6.676722] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_device_parse_topo_id_dt: rx-topo-id: 0x1000ff01
[    6.677431] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_dev_get_chipid: read chipid[0x5a] succeed
[    6.677609] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_fw_load_init: enter
[    6.677618] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_monitor_init: monitor init succeed
[    6.677620] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_i2c_probe: succeed, dev_index=[2], g_aw87xxx_dev_cnt= [2]
[    6.677623] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_i2c_probe: acpi_c=[0] dev_c=[2]
[    6.960378] Modules linked in: snd_sof_amd_acp63(+) wl(POE+) snd_sof_amd_vangogh snd_sof_amd_rembrandt mac80211(+) snd_sof_amd_renoir snd_sof_amd_acp snd_sof_pci snd_sof_xtensa_dsp intel_rapl_msr btusb amd_atl libarc4 snd_sof btrtl snd_hda_codec_realtek intel_rapl_common snd_sof_utils btintel edac_mce_amd btbcm snd_hda_codec_generic btmtk snd_pci_ps snd_hda_scodec_component snd_hda_codec_hdmi snd_hda_intel snd_amd_sdw_acpi bluetooth ayaneo_platform(OE) kvm_amd iwlwifi soundwire_amd snd_intel_dspcfg snd_intel_sdw_acpi soundwire_generic_allocation xpad joydev spd5118 oxp_sensors soundwire_bus snd_soc_aw87xxx bmi260_i2c(OE) kvm snd_hda_codec snd_rpl_pci_acp6x bmi260_core(OE) snd_pci_acp6x cfg80211 snd_soc_core snd_hda_core bmi160_spi snd_pci_acp5x rapl snd_hwdep regmap_spi wmi_bmof snd_compress snd_rn_pci_acp3x snd_seq ac97_bus snd_acp_config snd_pcm_dmaengine snd_seq_device snd_soc_acpi bmi160_i2c i2c_piix4 thunderbolt pcspkr rfkill soc_button_array snd_pci_acp3x k10temp snd_pcm bmi160_core i2c_smbus
[    9.682214] [Awinic] [i2c-AWDZ8830:00]aw87xxx_fw_load: fw_data parse failed
[    9.682243] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_fw_load: fw_data parse failed
[   21.711495] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer uinput acpi_call nf_conntrack_netbios_ns nf_conntrack_broadcast nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set nf_tables qrtr bnep sunrpc binfmt_misc vfat fat iwlmvm snd_sof_amd_acp63 wl(POE) snd_sof_amd_vangogh snd_sof_amd_rembrandt mac80211 snd_sof_amd_renoir snd_sof_amd_acp snd_sof_pci snd_sof_xtensa_dsp intel_rapl_msr btusb amd_atl libarc4 snd_sof btrtl snd_hda_codec_realtek intel_rapl_common snd_sof_utils btintel edac_mce_amd btbcm snd_hda_codec_generic btmtk snd_pci_ps snd_hda_scodec_component snd_hda_codec_hdmi snd_hda_intel snd_amd_sdw_acpi bluetooth ayaneo_platform(OE) kvm_amd iwlwifi soundwire_amd snd_intel_dspcfg snd_intel_sdw_acpi soundwire_generic_allocation xpad joydev spd5118 oxp_sensors soundwire_bus snd_soc_aw87xxx bmi260_i2c(OE) kvm snd_hda_codec snd_rpl_pci_acp6x bmi260_core(OE) snd_pci_acp6x cfg80211
[   21.713806] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer uinput acpi_call nf_conntrack_netbios_ns nf_conntrack_broadcast nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set nf_tables qrtr bnep sunrpc binfmt_misc vfat fat iwlmvm snd_sof_amd_acp63 wl(POE) snd_sof_amd_vangogh snd_sof_amd_rembrandt mac80211 snd_sof_amd_renoir snd_sof_amd_acp snd_sof_pci snd_sof_xtensa_dsp intel_rapl_msr btusb amd_atl libarc4 snd_sof btrtl snd_hda_codec_realtek intel_rapl_common snd_sof_utils btintel edac_mce_amd btbcm snd_hda_codec_generic btmtk snd_pci_ps snd_hda_scodec_component snd_hda_codec_hdmi snd_hda_intel snd_amd_sdw_acpi bluetooth ayaneo_platform(OE) kvm_amd iwlwifi soundwire_amd snd_intel_dspcfg snd_intel_sdw_acpi soundwire_generic_allocation xpad joydev spd5118 oxp_sensors soundwire_bus snd_soc_aw87xxx bmi260_i2c(OE) kvm snd_hda_codec snd_rpl_pci_acp6x bmi260_core(OE) snd_pci_acp6x cfg80211

-> [ 9.682214] [Awinic] [i2c-AWDZ8830:00]aw87xxx_fw_load: fw_data parse failed
-> [ 9.682243] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_fw_load: fw_data parse failed

@antheas
Copy link
Contributor

antheas commented Oct 27, 2024

paste the whole thing please as a file

@dog-in-space
Copy link
Author

dmesg.txt
lsmod.txt

@antheas
Copy link
Contributor

antheas commented Oct 27, 2024

Your device reads the firmware file and finds the speakers. So first thought is it doesnt like the firmware and wants some ayaneo one.

@dog-in-space
Copy link
Author

This is the same orangepi-xunlong firmware file that Chimera uses in their fix out of the AUR and sound works as expected on Chimera.

Weird...

@dog-in-space
Copy link
Author

This is what Chimera is using - https://aur.archlinux.org/packages/aw87559-firmware

It sure looks the same at least

@antheas
Copy link
Contributor

antheas commented Oct 27, 2024

It does indeed. Maybe i did the merge wrong, unsure. But it fails to bind your device to firmware. Also, the firmware file in that repo updated 3 months ago, there is a previous version there.

Can you try it? sudo rpm-ostree usroverlay --hotfix

@antheas
Copy link
Contributor

antheas commented Oct 27, 2024

Turns out Awinic made the fine decision to name all their firmware files the same. So the orange pi repo has 2 firmware files that have different hashes.

Then, the AUR repo used to reference a google driver rar file with 1S drivers that now is gonezo and was definitely a different hash. This is when Chos 46 was built.

And if you look online, there are some phone dumps with more random files with different hashes

@KyleGospo this will have to be BYO for now. Drop the fw file, and symlink the fw file to /usr/local/ for the F41 release. Then we ask for people to collect the firmware files.

@antheas
Copy link
Contributor

antheas commented Oct 27, 2024

Ok, so there are multiple firmware files depending on your device. I edited the kernel driver to automatically select the correct file depending on the device. We do not have the permission to redistribute the files for now, so you will need to install them yourself.

However, they are easy enough to find. For Ayn MiniPro and Ayaneo, the driver pack for your device (for Ayaneo download the driver pack without Audio in the name), then head into 0X_Audio -> AW87XXX... -> Driver -> Signed -> awinic_smartk_acf.bin (or similar name; ~1kb size) In the case of Orange Pi, here is the file.

Then, place the file in /usr/local/firmware (make the directory first) with the following name depending on device:

❯ sha256sum awinic/*
# Ayn Loki MiniPro
d29703932b73a6588c131ea20d0f2d2cf76221018aa179984a758da2982dab15  awinic/aw87xxx_acf_minipro.bin
# Ayaneo Air 1S
d29703932b73a6588c131ea20d0f2d2cf76221018aa179984a758da2982dab15  awinic/aw87xxx_acf_air1s.bin
# Ayaneo Air Plus (AMD; all variants)
d29703932b73a6588c131ea20d0f2d2cf76221018aa179984a758da2982dab15  awinic/aw87xxx_acf_airplus.bin
# Ayaneo Flip KB/DS
916b0ea592f747a96b59426eb7ceb6419e4634ddde3dcea317bc91bec7f7ffca  awinic/aw87xxx_acf_flip.bin
# Ayaneo Kun
8e6edd2623d9b90a60acbe04aded7eb038abcb2d48e17656319366db9582e21f  awinic/aw87xxx_acf_kun.bin
# Orange Pi (?)
7db2c6eaca3135d732c2e635388e87cb49fc998b3f9a859c2a891ee78797eba3  awinic/aw87xxx_acf_orangepi.bin

Those are the hashes and how to calculate them as well, so you can be sure you have the correct file. Other devices will expect aw87xxx_acf.bin until we identify them.

You can verify the name with the following command:
sudo dmesg | grep "loading firmware name:"

For people in this thread, this is for kernel 6.11.5-306 onward, which is currently building.

@dog-in-space
Copy link
Author

I can confirm this fix is working now with the firmware file manually in place and as of e3832fe successfully links to the provided file. Thank you for the quick response to this 😄

@antheas
Copy link
Contributor

antheas commented Oct 28, 2024

Heads up, we are changing the directory to /usr/local/firmware to not spam files all over /usr/local so you will need to move the file over when you update.

sudo mkdir -p /usr/local/firmware
sudo mv /usr/local/aw87* /usr/local/firmware

@N0tdeadyeet
Copy link

Apologies in advance, this isn't that clear, is the file in the directory meant to be called:

d29703932b73a6588c131ea20d0f2d2cf76221018aa179984a758da2982dab15 awinic/aw87xxx_acf_air1s.bin

or
awinic/aw87xxx_acf_air1s.bin

or

aw87xxx_acf_air1s.bin

Ive tried all three in the directory and once i restart nothing has changed. I might be being a massive noob on this one. Once Ive got clear instructions ill make a youtube video on this as a lot of people will appreciate this change

@antheas
Copy link
Contributor

antheas commented Oct 31, 2024

Just run ujust install-speaker-firmare

@N0tdeadyeet
Copy link

N0tdeadyeet commented Oct 31, 2024

Still no sound from the speakers on my end. I ran in terminal:

sudo dmesg | grep "loading firmware name:"

And it produces:

bazzite@192:~$ sudo dmesg | grep "loading firmware name:"
[sudo] password for bazzite: 
[    8.258845] [Awinic] [i2c-AWDZ8830:00]aw87xxx_fw_load_init: loading firmware name: [aw87xxx_acf_air1s.bin]
[    8.265908] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_fw_load_init: loading firmware name: [aw87xxx_acf_air1s.bin]
bazzite@192:~$ 

So I assume its working, and then I ran:

ujust install-speaker-firmare

and it produces:

/usr/local/firmware/ 100% [============================================================>]      43     --.-KB/s
                          [Files: 1  Bytes: 43  [86 B/s] Redirects: 0  Todo: 0  Errors: ]
/usr/local/firmware/ 100% [============================================================>]      43     --.-KB/s
                          [Files: 1  Bytes: 43  [129 B/s] Redirects: 0  Todo: 0  Errors:]
/usr/local/firmware/ 100% [============================================================>]     756     --.-KB/s
                          [Files: 1  Bytes: 756  [2.39KB/s] Redirects: 0  Todo: 0  Error]
/usr/local/firmware/ 100% [============================================================>]     756     --.-KB/s
                          [Files: 1  Bytes: 756  [2.10KB/s] Redirects: 0  Todo: 0  Error]
/usr/local/firmware/ 100% [============================================================>]     756     --.-KB/s
                          [Files: 1  Bytes: 756  [2.23KB/s] Redirects: 0  Todo: 0  Error]
/usr/local/firmware/ 100% [============================================================>]    1.51K    --.-KB/s
                          [Files: 1  Bytes: 1.51K [5.88KB/s] Redirects: 0  Todo: 0  Erro]

@antheas
Copy link
Contributor

antheas commented Oct 31, 2024

did you reboot afterwards?

@N0tdeadyeet
Copy link

N0tdeadyeet commented Oct 31, 2024

yes sir, reboot and no change - i checked the audio settings and tested the speakers to no avail

@antheas
Copy link
Contributor

antheas commented Oct 31, 2024

Send the full log

sudo dmesg | fpaste

@N0tdeadyeet
Copy link

@antheas
Copy link
Contributor

antheas commented Oct 31, 2024

It says you are using the wrong firmware, specifically that its the wrong size.

sha256sum file it and see if it matches the hash above.

@antheas
Copy link
Contributor

antheas commented Oct 31, 2024

The link is fine delete the other comment.

Here is the log for anyone interested.

[   10.512741] [Awinic] [i2c-AWDZ8830:00.1]aw_check_header_size: acf size check failed,size less-than aw_acf_hdr
[   10.512746] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_acf_parse: load firmware check failed
[   10.512747] [Awinic] [i2c-AWDZ8830:00]aw_check_header_size: acf size check failed,size less-than aw_acf_hdr
[   10.512748] [Awinic] [i2c-AWDZ8830:00.1]aw87xxx_fw_load: fw_data parse failed
[   10.512750] [Awinic] [i2c-AWDZ8830:00]aw87xxx_acf_parse: load firmware check failed

@N0tdeadyeet
Copy link

N0tdeadyeet commented Oct 31, 2024

It says you are using the wrong firmware, specifically that its the wrong size.

sha256sum file it and see if it matches the hash above.

the wrong firmware for the audio driver? I downloaded the ayaneo firmware update file specified and unzipped the Audio file. Where am I going wrong?

I ran this command:

asha256sum admin:/usr/local/firmware/aw87*/703932b73a6588c131ea20d0f2d2cf76221018aa179984a758da2982dab15 awinic⁄aw87xxx_acf_air1s.bin

and this is returned:

sha256sum: awinic⁄aw87xxx_acf_air1s.bin: No such file or directory

@antheas
Copy link
Contributor

antheas commented Oct 31, 2024

Can you run the command and show the result? There are multiple firmware files

Maybe my hash is wrong instead

@N0tdeadyeet
Copy link

sha256sum admin:/usr/local/firmware/aw87*/703932b73a6588c131ea20d0f2d2cf76221018aa179984a758da2982dab15  awinic⁄aw87xxx_acf_air1s.bin
sha256sum: 'admin:/usr/local/firmware/aw87*/703932b73a6588c131ea20d0f2d2cf76221018aa179984a758da2982dab15': No such file or directory

@antheas
Copy link
Contributor

antheas commented Oct 31, 2024

The file needs to be placed in /usr/local/firmware/aw87xxx_acf_air1s.bin. Since you ran the command its there.

Seems like its incorrect for your device. So with the file from your driver pack:

sudo rm /usr/local/firmware/aw87xxx_acf_air1s.bin
sudo cp awinic_smartk_acf.bin  /usr/local/firmware/aw87xxx_acf_air1s.bin

awinic_smartk_acf.bin is the original name and to run the cp command you need to be in the directory of the file

Finally (after moving the firmware), run

sha256sum  /usr/local/firmware/aw87xxx_acf_air1s.bin

And show the result

@N0tdeadyeet
Copy link

bazzite@192:~$ sha256sum /usr/local/firmware/aw87xxx_acf_air1s.bin d29703932b73a6588c131ea20d0f2d2cf76221018aa179984a758da2982dab15 /usr/local/firmware/aw87xxx_acf_air1s.bin

@antheas
Copy link
Contributor

antheas commented Oct 31, 2024

Try some of the other files. That's all I can say

@N0tdeadyeet
Copy link

Good sir, this worked¬! reboot and the sound is working. Thanks for all the follow ups! I shall do a tutorial on Youtube tomorrow

@antheas
Copy link
Contributor

antheas commented Oct 31, 2024

The command I sent you should have worked too, maybe there's an issue in it @HikariKnight

Can you verify the hash is that one?

@HikariKnight
Copy link
Member

HikariKnight commented Nov 1, 2024

@antheas
running the command myself i get these firmware files with the hashes in /usr/local/firmware

4a493b3f487db0ae2bd7a36337f070cbea005f1f89222dd78c5cd4121f250b62  aw87xxx_acf_air1s.bin
4a493b3f487db0ae2bd7a36337f070cbea005f1f89222dd78c5cd4121f250b62  aw87xxx_acf_airplus.bin
916b0ea592f747a96b59426eb7ceb6419e4634ddde3dcea317bc91bec7f7ffca  aw87xxx_acf_flip.bin
8e6edd2623d9b90a60acbe04aded7eb038abcb2d48e17656319366db9582e21f  aw87xxx_acf_kun.bin
d29703932b73a6588c131ea20d0f2d2cf76221018aa179984a758da2982dab15  aw87xxx_acf_minipro.bin
7db2c6eaca3135d732c2e635388e87cb49fc998b3f9a859c2a891ee78797eba3  aw87xxx_acf_orangepi.bin

@antheas
Copy link
Contributor

antheas commented Nov 1, 2024

Well, if you look closer you'll realize your hashes are wrong

@HikariKnight
Copy link
Member

didnt get to read much of the messages as im on my way to work :)

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Jan 31, 2025
@ublue-os ublue-os deleted a comment from dosubot bot Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed
Projects
None yet
Development

No branches or pull requests

5 participants