-
Notifications
You must be signed in to change notification settings - Fork 140
Enable SOF on Broadwell/Samus (bdw-rt5677) #1659
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
Enable SOF on Broadwell/Samus (bdw-rt5677) #1659
Conversation
|
@plbossart I cc'ed you on a patch a few hours ago to alsa that should fix the issue with regards to the SPI links. |
The patch doesn't help, I have the Kconfig selected but somehow the SPI probe fails. There is something missing either in my configuration or the SPI probe stuff. This is with the seabios/legacy mode installed with chrx. |
|
Is your bios defining the SPI port? ID RT5677AA? |
Yes it's defined in the DSDT and I just checked it's copy/pasted from the Coreboot parts. |
|
Looks related to ID INT3430 which is found in these drivers, which reminds me of when I had to fix the bug in the spi bus after suspend/resume issues. |
5e18bbb to
d16a77f
Compare
I got it, it's indeed a miss with the SPI_MASTER and SPI_PXA2XX dependencies not modeled. Fixed now with the update. |
|
well not quite, I saw one error with DMAs now: @cujomalainey this reminds me of an error reported by others on the Chrome team? |
|
Ah yes I remember those errors with the uprev team. That appears to be slightly different iirc. It was a transient failure on samus, it was on buddy that it was consistent. Does rebooting solve it? Also the only solution to date afaik is still to revert that really old sst D3 crash prevention patch. |
I can't reproduce it so far on Samus after rebooting so it does look like a transient. I guess now that I've seen it I would be more inclined to revert this code that no one is able to explain anyways. |
|
Looked up the old bug, that actually is the exact error message we were seeing on samus, so that is definitely the bug |
The existing machine driver depends on SPI Master capabilities, but the Kconfig does not model this dependency and the SPI controller needs to be selected as well. Without this patch the machine driver probe would fail with the spi-RT5677AA:00 component never registered by the ACPI/LPSS subsystem. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The legacy driver uses dummy cpu_dai and platform, SOF requires actual values to bind. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
c8c1e62 to
7b822a2
Compare
|
@cujomalainey @fredoh9 @xiulipan with these patches I get nice sound on Samus :-) |
sound/soc/intel/boards/bdw-rt5677.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart are you possibly missing the virtual widgets for the other three "AIF1 Capture", "AIF1 Playback" and "DSP Buffer"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AIF1 playback/capture are on the codec side, so are defined by the codec driver.
I have no idea what the 'DSP Buffer' is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DSP Buffer is for the codecs internal DSP power graph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart That was strange, I redo the test without this patch on samus with the latest tplg from https://github.com/thesofproject/sof/blob/c68605403c52ac43ac1b97dec780b9407026ec7f/tools/topology/sof-bdw-codec.m4 and it works without error.
dnl CODEC is defined and will be expanded, need to undefine it before use
undefine(`CODEC')
VIRTUAL_WIDGET(SSP0 CODEC OUT, output, 0)
VIRTUAL_WIDGET(SSP0 CODEC IN, input, 1)
VIRTUAL_WIDGET(DSP Capture, input, 2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiulipan thanks for testing, indeed this is not needed, I was using an old topology file :-(
Fixed now
|
Instructions to reproduce my setup:
For now playback works fine in PulseAudio with jack detection and switching between speakers and headphones. I haven't tested the capture at all. |
|
@cujomalainey @juimonen can you take a look at the UCM file at https://github.com/plbossart/UCM/tree/master/sof-bdw-rt5677? I can get capture to work fine but the switch between internal mic and headset mic is not automatic. I wonder if this is supported by PulseAudio or if there is a way to express an action to be taken on headset plug? Thanks! |
|
evtest reports the jack name as "bdw-rt5677 Mic Jack" try changing that |
doesn't help. evtest does dectest sof-bdw-rt5677 Headphone and Mic Jack, but if I use 'JackControl "sdw-bdw-rt5677 Headphone Jack"' then the automatic switch is broken for playback, and the value of the string has no impact for capture. Must be a PulseAudio restriction maybe? |
|
is the jack being detected in amixer? if it is then I would leave it with pulse |
|
@plbossart I will update #1484 to cover only |
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've no other comments to add other than those already discussed. I'm assuming this works for XPS13 too ?
7b822a2 to
fb03cd4
Compare
|
I think we are good to merge, the only issues I see for now are
Considering that Samus never worked before, this is small potatoes to fix. |
Ack
I'm assuming this is consistent rather than random ? Fwiw, could be the FRAME_POLARITY logic needs negated, I do remeber running into this in the last few years but I cant remember the platform. |
yes, it's not the result of an underflow, I have a consistent inversion both on speakers and headphones. But I am not 100% it's firmware, the UCM file I took from Chrome folks has weird settings such as
yes, that'd be my next check. I have a Samus device wired with the SSP pins blue-wired so I'll try to capture the signals with my LogicPro when I have a bit of time. |
| DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port"))); | ||
| #else | ||
| SND_SOC_DAILINK_DEF(ssp0_port, | ||
| DAILINK_COMP_ARRAY(COMP_DUMMY()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One too many brackets there. Fails to compile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Travis did catch the error
https://travis-ci.org/thesofproject/linux/jobs/633817565#L2610

before we even look at SOF support on Broadwell, the current mailine code is broken with the legacy driver (w/ legacy BIOS and Ubuntu installed with chrx)
I was able to restore functionality with the patches in this PR, but there's clearly a problem registering the SPI component.
Without the last patch which essentially removes the SPI/Hotword support, I see errors such as
@cujomalainey what is needed to probe this SPI thingy? Could this be a legacy BIOS issue?
@xiulipan @fredoh9 @ranj063 FYI.