Bug 220011 - Sound card recognized but not sound in Acer Asprie SW3-013
Summary: Sound card recognized but not sound in Acer Asprie SW3-013
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: Intel Linux
: P3 blocking
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-14 11:17 UTC by agarplayerarlon
Modified: 2025-04-23 15:05 UTC (History)
2 users (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments
alsa-info.txt (97.99 KB, text/plain)
2025-04-14 17:02 UTC, agarplayerarlon
Details
working kernel patch (57.93 KB, patch)
2025-04-16 15:45 UTC, agarplayerarlon
Details | Diff
UCM files (2.77 KB, application/zip)
2025-04-16 15:48 UTC, agarplayerarlon
Details

Description agarplayerarlon 2025-04-14 11:17:47 UTC
After some tribulation I've been able to install Fedora Linux 41 on my Acer Asprie SW3-013, WiFi works but sadly audio doesen't.

Although the operating system does recognize the sound card (bytcr-rt5640) there is still no audio.


Info about the system:

Linux Kernel Version in use:
Linux 6.13.10-200.fc41.x86_x64

Processor:
Intel Atom Z3735F

Sound Card:
bytcr-rt5640

-------------------

I've tried everything, from the most common workaround found here
https://github.com/plbossart/UCM/tree/master/bytcr-rt5640

to adding custom quirks here
/etc/modprobe.d/bytcr.conf

"options snd_soc_sst_bytcr_rt5640 quirk=0x10b"

I've tried 0x10b, 0x2b, 0x01, 0x2f, 0x21 but I still get the same error when I run this command: "sudo dmesg | grep -i rt5640"

"Invalid routing, bytcr detected but no SSP0-based quirk, audio cannot work with SSP2 on bytcr"



If you need more informations let me know, thanks in advance.
Comment 1 Artem S. Tashkinov 2025-04-14 16:51:42 UTC
Please upload ``alsa-info.sh` output.
Comment 2 Artem S. Tashkinov 2025-04-14 16:51:57 UTC
`sudo alsa-info.sh` output.
Comment 3 agarplayerarlon 2025-04-14 17:02:44 UTC
Created attachment 307962 [details]
alsa-info.txt
Comment 4 agarplayerarlon 2025-04-14 17:03:06 UTC
I've uploaded the file
Comment 5 Lewis J. Johnson 2025-04-15 06:35:44 UTC Comment hidden (spam)
Comment 6 agarplayerarlon 2025-04-15 06:45:47 UTC Comment hidden (spam)
Comment 7 Takashi Iwai 2025-04-15 08:03:02 UTC
You need to test with proper quirk values.  The low 4 bits represent mapping from 0 to 4.  The next 4 bits (bits 4-7) represent the GPIO, from 1 to 6 of 15 for EXT_GPIO.  The next 5 bits (bits 8-12) show the over-current threshold microamp, either 6, 15 or 20.  And the next 2 bits (bits 13-14) show the over-current scale factor, from 0 to 3.

You can take a look at the existing quirk values from sound/soc/intel/boards/bytcr_rt5640.c and try one by one.
Comment 8 agarplayerarlon 2025-04-15 11:58:46 UTC Comment hidden (spam)
Comment 9 Takashi Iwai 2025-04-15 14:44:17 UTC
(In reply to agarplayerarlon from comment #8)
> (In reply to Takashi Iwai from comment #7)
> > You need to test with proper quirk values.  The low 4 bits represent
> mapping
> > from 0 to 4.  The next 4 bits (bits 4-7) represent the GPIO, from 1 to 6 of
> > 15 for EXT_GPIO.  The next 5 bits (bits 8-12) show the over-current
> > threshold microamp, either 6, 15 or 20.  And the next 2 bits (bits 13-14)
> > show the over-current scale factor, from 0 to 3.
> > 
> > You can take a look at the existing quirk values from
> > sound/soc/intel/boards/bytcr_rt5640.c and try one by one.
> 
> I don't know how to do that I'm sorry, I've used chatgpt to help me test the
> quirks as I don't have much developer knowledge.
> 
> chatgpt also helped me patch the kernel with this code inside of
> /sound/soc/intel/boards/bytcr_rt5640.c, but I still had no sound after
> succesfully patching the kernel
> 
> >{
> >    .matches = {
> >        DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
> >        DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW3-013"),
> >    },
> >    .driver_data = (void *)(BYT_RT5640_SSP0_AIF1 |
> >                            BYT_RT5640_DIFF_MIC |
> >                            BYT_RT5640_IN1_MAP |
> >                            BYT_RT5640_IN3_MAP |
> >                            BYT_RT5640_DMIC1_MAP |
> >                            BYT_RT5640_MCLK_EN),
> >},

What a crap! You surely know that one cannot trust ChatGPT seriously for coding :)

Just try to copy the driver_data contents of other existing similar quirk entries there instead, but change DMI_MATCH() to match with your actual device name.  Judging from the alsa-info.sh output, the above DMI_MATCH() lines look OK.  But you can check the kernel log with the patched kernel whether it shows the messages corresponding to your quirk bits.  e.g. "quirk DMIC1_MAP enabled" should appear when the quirk bit BYT_RT5640_DMIC1_MAP is set.
Comment 10 agarplayerarlon 2025-04-15 16:14:21 UTC Comment hidden (spam)
Comment 11 Takashi Iwai 2025-04-15 16:18:53 UTC
You need to try different setups, trial-and-error; there are many different quirk entries as you see there.

Also, you'll possibly need to set up the mixer.  For the tailored system, it's  typically done via UCM, but initially you might need to to adjust manually by yourself.
Comment 12 agarplayerarlon 2025-04-15 17:21:08 UTC Comment hidden (spam)
Comment 13 Takashi Iwai 2025-04-16 07:15:29 UTC
Yes, it's your machine, it's your joy of hacking.  Of course, you can ask Acer for the support, but I guess they would answer that they won't support Linux for those models.  And Intel provides only the material that can be used on the machines.

The bug assignee is responsible for helping and merging the fix to the upstream.
Developing the proper fix is in your hands.
Comment 14 agarplayerarlon 2025-04-16 15:37:43 UTC Comment hidden (spam)
Comment 15 agarplayerarlon 2025-04-16 15:45:01 UTC Comment hidden (spam)
Comment 16 agarplayerarlon 2025-04-16 15:46:36 UTC Comment hidden (spam)
Comment 17 agarplayerarlon 2025-04-16 15:48:02 UTC Comment hidden (spam)
Comment 18 agarplayerarlon 2025-04-16 15:50:06 UTC Comment hidden (spam)
Comment 19 Takashi Iwai 2025-04-17 07:31:56 UTC
Awesome!

Care to submit an official patch by yourself for merging to the upstream kernel?
  https://docs.kernel.org/process/submitting-patches.html

Or if you don't mind, I just pick up the change and submit by myself with the reference to this bugzilla entry, too.
Comment 20 agarplayerarlon 2025-04-18 09:12:25 UTC Comment hidden (spam)
Comment 21 agarplayerarlon 2025-04-18 09:24:38 UTC Comment hidden (spam)
Comment 22 Takashi Iwai 2025-04-20 08:58:49 UTC
OK, the patch submitted now:
  https://lore.kernel.org/20250420085716.12095-1-tiwai@suse.de
Comment 23 agarplayerarlon 2025-04-23 15:05:47 UTC Comment hidden (spam)

Note You need to log in before you can comment on or make changes to this bug.