thesofproject / sof

Sound Open Firmware
Other
562 stars 318 forks source link

[QUESTION] THX Spatial Audio on Razer Blade 15 2022 - QHD 240Hz - GeForce RTX 3060 #7168

Open mbana opened 1 year ago

mbana commented 1 year ago

Hi, folks,

I don't know much about audio (on Linux).

THX Spatial Audio

If this isn't the right place to ask this question, please let me know where I should post it.

Is anyone familair with https://thesofproject.github.io and THX Spatial Audio?

The sound on Windows seems vastly superior than it does on Linux. Is there a way to get the same sound quality on Linux as I do get on Windows.

I also wonder if it's possible to reverse engineer what Windows is doing and replicate that on Windows? If so, are there any guides on how to do this?

I have the [1] laptop.

Topology file

I had to resort to the fix documented in [2] to get the microphone recognised:

mkdir -pv /tmp/alsa-sof-firmware
cd /tmp/alsa-sof-firmware
curl -L --output ./sof-hda-generic-2ch-pdm1.zip "https://github.com/thesofproject/linux/files/5981682/sof-hda-generic-2ch-pdm1.zip"
unzip ./sof-hda-generic-2ch-pdm1.zip -d .
rm ./sof-hda-generic-2ch-pdm1.zip
# Make `sof-hda-generic-2ch.tplg.xz`
mv -v sof-hda-generic-2ch-pdm1.tplg sof-hda-generic-2ch.tplg
xz -C crc32 sof-hda-generic-2ch.tplg
# Copy new topology file over and then reboot
sudo cp -v ./sof-hda-generic-2ch.tplg.xz /lib/firmware/intel/sof-tplg/sof-hda-generic-2ch.tplg.xz
sudo chmod o+r,g+r /lib/firmware/intel/sof-tplg/sof-hda-generic-2ch.tplg.xz
sudo systemctl reboot

The only issue is the left and right speaker are reversed. How do I understand the topology file and fix this?

System Information

[1]: https://www.razer.com/gb-en/gaming-laptops/Razer-Blade-15/RZ09-0421EWD3-R3W1. [2]: To get the microphone to work I had to resort to the fix documented here: https://bana.io/blog/razer-blade-15-2022-RZ09-0421-laptop-linux/#fixing-the-microphone


If you need further information, please let me know.

plbossart commented 1 year ago

@mbana there's no good or easy solution to your question.

The SOF firmware and topology distributed for Linux distros do not include any 3rd party IP - due to obvious legal issues and a complete lack of re-distribution rights of closed-source 3rd party IP. This is regrettable from an end-user experience perspective but not something that the SOF development team can correct. It is what it is.

The ChromeOS firmware includes 3rd party IP, but the firmware is managed with a different branch and accessible to partners only. This would not help you anyways for a device that's not supported by ChromeOS.

Using firmware from Windows is not an option since it's a different firmware branch completely unrelated at the moment to the SOF code. This will change in the future but that's the future.

Compiling your own firmware to add Dynamic Range Control is possible if you have access to Cadence tools, usually not really an option for individual contributors.

mbana commented 1 year ago

@mbana there's no good or easy solution to your question.

The SOF firmware and topology distributed for Linux distros do not include any 3rd party IP - due to obvious legal issues and a complete lack of re-distribution rights of closed-source 3rd party IP. This is regrettable from an end-user experience perspective but not something that the SOF development team can correct. It is what it is.

The ChromeOS firmware includes 3rd party IP, but the firmware is managed with a different branch and accessible to partners only. This would not help you anyways for a device that's not supported by ChromeOS.

Using firmware from Windows is not an option since it's a different firmware branch completely unrelated at the moment to the SOF code. This will change in the future but that's the future.

Compiling your own firmware to add Dynamic Range Control is possible if you have access to Cadence tools, usually not really an option for individual contributors.

Thank you very much for getting back to me. Much appreciated.

I have a few questions:

  1. Where is this, https://github.com/thesofproject/linux/files/5981682/sof-hda-generic-2ch-pdm1.zip, file in the source code? I cannot seem to locate it.
  2. How do I go about fixing the left and right speaker being reversed when I use sof-hda-generic-2ch-pdm1.zip or even by default? If you could point me towards a guide that would be great.
  3. What particular tool from Cadence are you referring to me.

Again, this is all new to me so I would appreciate it if you could be a bit more verbose when replying.

Also, It would be wonderful if THX spatial audio worked on Linux. Do you have a rough idea as to how long it might take to implement such a thing. I have access to a Windows 11 laptop that has it enabled but I don't know where to begin to figure out what's really happening underneath to figure out what's really happening.