Re: [alsa-devel] WM5102 - Help to make baytrail machine driver work
On 5/4/16 8:21 PM, Paulo Sergio wrote:
Hi list,
I've been trying to make Lenovo Yoga 2 (Model 1051F) sound work on Android-x86/ Linux. [1]
Based on already discussed info from Christian Hartmann with members (see [2] and [3] ) of this list and some efforts (basically patch pxa2xx with Mika Westerberg changes, set the correct gpio int values {246 for reset / 405 for ldoena and 342 for irq_gpio} and set LDO1 vcc suppliers) we could have wm5102 initialized through spi / regmap (arizona code on drivers/mfd) and register the DAI's.
I also ported a machine driver code from a kernel Lenovo made available for a similar hardware (Lenovo yoga 2 1050 - uses the same baytrail Z3745 and wolfson wm5102 audio) [4]
There are quite a few references in the machine driver to concepts related to Clovertrail+ and early versions of Baytrail. I am fairly convinced the mentions of 'BYT_COMMS_BT' or 'modem mixing' are no longer supported with the DPCM platform driver/firmware you used.
To enable this codec it would be simpler to start with a newer machine driver derived from the bytcr_rt5640 one, with just a basic SSP0-aif1 link for starters (+ MCLK). Better yet, do this work with a MinnowBoard and an WM5102 eval board and test all this with more control on how the hardware is setup.
If you stick to working directly on the Lenovo device, make sure you use all the DSP controls set in the UCM files used for baytrail/baytrail-CR (see github.com/plbossart/UCM).
Although machine driver is registered, we still don't have sound. Tried some mixer settings / routes used on raspberry pi, but none help. Application (in this case alsa / Android players) returns a "Device or resource busy" when trying to ioctl pcm device:
04-30 13:05:07.877 1784 2078 E audio_hw_primary: out_write: error -1 - cannot prepare channel: Device or resource busy
# This is raised here (external/tinyalsa/pcm.c):
if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_PREPARE) < 0)
return oops(pcm, errno, "cannot prepare channel");
Note: As pointed here [5] had to change the acpi_ipc_irq_index to 0 on sound/soc/intel/atom/sst/sst_acpi.c because this is the 1st ACPI entry listed on DSDT I'm also trying to use a fw version that uses SSP0 [6] instead of SSP2 used as default - but no sound with both
I'd like some help from you in order to make this work. I've collect several info which can be found here [7]
- /proc/asound/cards
- /proc/interrupts
- amixer controls list
- dmesg
- DSDT file (decoded with iasl)
Source code with changes made so far is available on github [8]
Any hint is appreciated
Thanks, Paulo Sérgio Travaglia (pstglia)
[1] - https://groups.google.com/forum/#!forum/android-x86 [2] - http://www.spinics.net/lists/linux-acpi/msg58680.html [3] - https://goo.gl/vBKOeI [4] - http://goo.gl/zriwbw [5] - https://bugzilla.kernel.org/show_bug.cgi?id=86581 [6] - http://thread.gmane.org/gmane.linux.alsa.devel/134554/focus=140634 [7]
Hi Pierre, how are you?
I also ported a machine driver code from a kernel Lenovo made available for a similar hardware (Lenovo yoga 2 1050 - uses the same baytrail Z3745 and wolfson wm5102 audio) [4]
There are quite a few references in the machine driver to concepts related to Clovertrail+ and early versions of Baytrail. I am fairly convinced the mentions of 'BYT_COMMS_BT' or 'modem mixing' are no longer supported with the DPCM platform driver/firmware you used.
Yes, the code I ported was originally wrote for kernel 3.10.x targeted for Android
In any case, I didn't enable this option on our kernel config
To enable this codec it would be simpler to start with a newer machine driver derived from the bytcr_rt5640 one, with just a basic SSP0-aif1 link for starters (+ MCLK).
Thanks for the tip. I can try it ( create a machine driver derived from bytcr_rt5640 ). Will just wait for Charles help on analyzing CODEC output I provided. [1] If he says this part seems ok, I will work on machine driver
I'm not sure this hardware uses SSP0 or SSP2, so I'm testing with both firmwares. Is there any method I can confirm it? (querying an ACPI entry listed on DSDT maybe?)
Better yet, do this work with a MinnowBoard and an WM5102 eval board and test all this with more control on how the hardware is setup.
This is probably the best approach (minnowboard + WM5102 eval board). But unfortunatelly my skills are limited...
If you stick to working directly on the Lenovo device, make sure you use all the DSP controls set in the UCM files used for baytrail/baytrail-CR (see github.com/plbossart/UCM).
In fact, currently I don't have this device. Some volunteers from Android-x86 google group are testing changes made on their hardware and provide the info I ask for (logcat / dmesg / mixer output, etc)
Thanks Pstglia
[1] - https://drive.google.com/file/d/0BxO6THtB865fS2NxUkdOa18zUlE/view?usp=sharin...
participants (2)
-
Paulo Sergio
-
Pierre-Louis Bossart