diff mbox

Intel SST on a Bay Trail tablet

Message ID 20150626150528.f9fdee3942f7e975d23dd701@ao2.it (mailing list archive)
State Superseded
Headers show

Commit Message

Antonio Ospite June 26, 2015, 1:05 p.m. UTC
On Thu, 25 Jun 2015 22:17:17 +0530
Vinod Koul <vinod.koul@intel.com> wrote:

> On Thu, Jun 25, 2015 at 12:21:24PM +0200, Antonio Ospite wrote:
> > On Thu, 25 Jun 2015 11:20:46 +0530
> > Vinod Koul <vinod.koul@intel.com> wrote:
> > 
> > > On Wed, Jun 24, 2015 at 03:46:13PM +0530, Vinod Koul wrote:
> > > > On Tue, Apr 14, 2015 at 05:06:27PM +0300, Jarkko Nikula wrote:
> > [...]
> > > > > 
> > > > > Which makes me thinking how does those strings describe the SSP port
> > > > > setup? E.g. do they reflect what port is actually used or could it
> > > > > be possible that those are just driver strings but firmware could
> > > > > have been tuned for SSP0? If I looked at earlier right, Teclast has
> > > > > the low pin-count Baytrail without SSP2 but I'm not sure about that.
> > > > The FW doesnt provide way to changes ports from driver in this, so this
> > > > doesnt mean much. If we are sure it is not ssp2, I can provide ssp1 fw for
> > > > test
> > > I ahve pushed latest BYT version we have as well as added binary for second
> > > SSP port. Please give it a try:
> > > 
> > > https://git.kernel.org/cgit/linux/kernel/git/vkoul/firmware.git/commit/?h=byt&id=28ff420dd33ec299217bad7d526ff3bfd163b551
> > > 
> > 
> > Thanks Vinod, but I see these are in the ELF format, and the mainline
> > driver does not support this format, at least the last time I checked it
> > didn't.
> My bad, updated the patch now with right format
> 
> https://git.kernel.org/cgit/linux/kernel/git/vkoul/firmware.git/commit/?h=byt
>

(Adding Michele to CC)

OK, so Jarkko was right: after a quick test I confirm that with
fw_sst_0f28_ssp0.bin I get sound; this is quite an improvement,
thanks!

I am going to update the report on bugzilla:
https://bugzilla.kernel.org/show_bug.cgi?id=86581

I used the amixer commands which Vinod provided in the other thread,
in particular, the playback path is this one:

> amixer -c0 sset 'codec_out0 mix 0 pcm0_in' on
> amixer -c0 sset 'media0_out mix 0 media1_in' on

The sound is a bit distorted tho, I can alleviate this effect by
lowering the values of these controls:
  - codec_out0 Gain0
  - media1_in Gain0
  - pcm0_in Gain0

but the distortions do not go completely away, and they are not present
in Android even at the highest volume.

I will perform more tests (capture, headphones) when 4.2-rc1 is out
and report back the results.

JFTR, I made sure to use the DPCM driver by preventing the other one
from being loaded:


Would it be worth providing a SSP0 variant of
fw_sst_0f28.bin-48kHz_i2s_master too? Or is the intel/atom/sst/sst_acpi.c
going to completely replace intel/common/sst-acpi.c?

Thanks a lot,
   Antonio

Comments

Vinod Koul June 27, 2015, 2:47 p.m. UTC | #1
On Fri, Jun 26, 2015 at 03:05:28PM +0200, Antonio Ospite wrote:
> On Thu, 25 Jun 2015 22:17:17 +0530
> Vinod Koul <vinod.koul@intel.com> wrote:
> 
> > On Thu, Jun 25, 2015 at 12:21:24PM +0200, Antonio Ospite wrote:
> > > On Thu, 25 Jun 2015 11:20:46 +0530
> > > Vinod Koul <vinod.koul@intel.com> wrote:
> > > 
> > > > On Wed, Jun 24, 2015 at 03:46:13PM +0530, Vinod Koul wrote:
> > > > > On Tue, Apr 14, 2015 at 05:06:27PM +0300, Jarkko Nikula wrote:
> > > [...]
> > > > > > 
> > > > > > Which makes me thinking how does those strings describe the SSP port
> > > > > > setup? E.g. do they reflect what port is actually used or could it
> > > > > > be possible that those are just driver strings but firmware could
> > > > > > have been tuned for SSP0? If I looked at earlier right, Teclast has
> > > > > > the low pin-count Baytrail without SSP2 but I'm not sure about that.
> > > > > The FW doesnt provide way to changes ports from driver in this, so this
> > > > > doesnt mean much. If we are sure it is not ssp2, I can provide ssp1 fw for
> > > > > test
> > > > I ahve pushed latest BYT version we have as well as added binary for second
> > > > SSP port. Please give it a try:
> > > > 
> > > > https://git.kernel.org/cgit/linux/kernel/git/vkoul/firmware.git/commit/?h=byt&id=28ff420dd33ec299217bad7d526ff3bfd163b551
> > > > 
> > > 
> > > Thanks Vinod, but I see these are in the ELF format, and the mainline
> > > driver does not support this format, at least the last time I checked it
> > > didn't.
> > My bad, updated the patch now with right format
> > 
> > https://git.kernel.org/cgit/linux/kernel/git/vkoul/firmware.git/commit/?h=byt
> >
> 
> (Adding Michele to CC)
> 
> OK, so Jarkko was right: after a quick test I confirm that with
> fw_sst_0f28_ssp0.bin I get sound; this is quite an improvement,
> thanks!
Okay that is great

> 
> I am going to update the report on bugzilla:
> https://bugzilla.kernel.org/show_bug.cgi?id=86581
> 
> I used the amixer commands which Vinod provided in the other thread,
> in particular, the playback path is this one:
> 
> > amixer -c0 sset 'codec_out0 mix 0 pcm0_in' on
> > amixer -c0 sset 'media0_out mix 0 media1_in' on
> 
> The sound is a bit distorted tho, I can alleviate this effect by
> lowering the values of these controls:
>   - codec_out0 Gain0
>   - media1_in Gain0
>   - pcm0_in Gain0
> 
> but the distortions do not go completely away, and they are not present
> in Android even at the highest volume.
I dont think the gain is causing the distortion. It can be SSP settings
DO you see distortion in one channel or both (try with headset)

Also on Android, do you know kernel source for this, if vendor did release
we cna check the settings there and configure the same here. Also cna you
confirm which machine driver was loaded

> 
> I will perform more tests (capture, headphones) when 4.2-rc1 is out
> and report back the results.
> 
> JFTR, I made sure to use the DPCM driver by preventing the other one
> from being loaded:
You should blacklist that one ...
Istvan Sandor July 15, 2015, 10:11 a.m. UTC | #2
Vinod Koul <vinod.koul <at> intel.com> writes:

> > The sound is a bit distorted tho, I can alleviate this effect by
> > lowering the values of these controls:
> >   - codec_out0 Gain0
> >   - media1_in Gain0
> >   - pcm0_in Gain0
> > 
> > but the distortions do not go completely away, and they are not present
> > in Android even at the highest volume.
> I dont think the gain is causing the distortion. It can be SSP settings
> DO you see distortion in one channel or both (try with headset)

Hi Vinod,

I've been following this thread since a while and trying out the various things
suggested. I have an Acer Aspire Switch 10 which seems to have the same audio
chip like the Teclast and the other tablets mentioned in the bugzilla thread. I
also had to change the interrupt index and tried the other driver with the
fw_sst_0f28.bin-48kHz_i2s_master firmware, got overheating etc. etc. Finally
following the advice in this thread I got to the same point, mfld driver with
ssp0 firmware and applying the alsa settings as in

http://mailman.alsa-project.org/pipermail/alsa-devel/2015-June/094080.html

I get the distorted sound. I've been playing around with the mixer controls and
wanted to report back my findings, maybe it can help. What I've found:

1) Sound seems only to be coming from the right speaker. If I turn off
"Speaker R"
   there's no sound. Turning off "Speaker L" doesn't seem to do anything. If I
   turn off both playback stalls. Generally If I turn off any of the setting
   suggested in your mail playback stalls (mplayer).

2) By turning on "HPO MIX DAC1" "HPO MIX DAC2" "HP L" and "HP R" I get sound
   from the headset. Here also the sound is distorted and is only coming
from the
   right channel.

3) Volume controls "Headphone" "Speaker" have no effect (I can't turn off
the volume).

My kernel is: 4.1.0

Modules:

	$ lsmod | grep snd

	snd_soc_sst_bytcr_rt5640    16384  0 
	snd_soc_rt5640         86016  1 
	snd_soc_rl6231         16384  1 snd_soc_rt5640
	regmap_i2c             16384  1 snd_soc_rt5640
	snd_intel_sst_acpi     16384  1 
	snd_intel_sst_core     69632  1 snd_intel_sst_acpi
	snd_soc_sst_mfld_platform    69632  3 snd_intel_sst_core
	snd_soc_core          155648  4
snd_soc_rt5640,snd_soc_sst_mfld_platform,snd_soc_sst_bytcr_rt5640
	snd_compress           20480  1 snd_soc_core
	snd_pcm               106496  4
snd_soc_rt5640,snd_soc_core,snd_soc_sst_mfld_platform,snd_soc_sst_bytcr_rt5640
	snd_timer              28672  1 snd_pcm
	snd                    69632  7
snd_soc_core,snd_timer,snd_pcm,snd_soc_sst_mfld_platform,snd_compress
	soundcore              16384  1 snd

alsa.state is "baytrailcraudio" with the setting suggested in your mail.

I hope this info will be helpful!

regards
Istvan
LemonZou Sept. 18, 2015, 12:41 a.m. UTC | #3
Yes, with ssp0 firmware, my board sound work too, but the mic don't work,
when using arecord -f dat -t wav -d 5 foobar.wav, the record data is 0.

hexdump foobar.wav 
0000000 4952 4646 a624 000e 4157 4556 6d66 2074
0000010 0010 0000 0001 0002 bb80 0000 ee00 0002
0000020 0004 0010 6164 6174 a600 000e 0000 0000
0000030 0000 0000 0000 0000 0000 0000 0000 0000
*
00ea62c

my analog microphone is connected to the IN2+ and MIC_BIAS1 codec pins
I set alsa as :
Stereo ADC MIXL ADC1 on
Stereo ADC1 Mux ==> ADCL
RECMIXL INL on
RECMIXL BST2 on
pcm1_out mix 0 codec_in1 on
diff mbox

Patch

diff --git a/sound/soc/intel/common/sst-acpi.c b/sound/soc/intel/common/sst-acpi.c
index 42f293f..66ee705 100644
--- a/sound/soc/intel/common/sst-acpi.c
+++ b/sound/soc/intel/common/sst-acpi.c
@@ -266,7 +266,6 @@  static struct sst_acpi_desc sst_acpi_baytrail_desc = {
 static struct acpi_device_id sst_acpi_match[] = {
        { "INT33C8", (unsigned long)&sst_acpi_haswell_desc },
        { "INT3438", (unsigned long)&sst_acpi_broadwell_desc },
-       { "80860F28", (unsigned long)&sst_acpi_baytrail_desc },
        { }
 };
 MODULE_DEVICE_TABLE(acpi, sst_acpi_match);