@guhl While waiting for my compile run to compile the KF5 framework for my project, I was reading through your sound section on your wiki.
I see you are installing some python packages, create a python script and using systemd to run that script, just to set the hardware volume to max 30 and let pulseaudio control the 0 - 30 section by pushing all alsa to pulseaudio similar as I do in my project.
So you do not need that whole python script and associated libraries if you use this command;
i2cset -y 1 0x4b 30
If you combine this with a udev rule that runs a command as soon as it sees the usb respeaker device, you do not need systemd as well. Just create a â10-usb-sound.rulesâ within â/etc/udev/rules.dâ with the following content;
I donât have a respeaker device so canât test it for you, but if you could please be so kind to test and report back to me. We both benefit from it as it would allow me to support that device within my project without the whole hardware set/get stuff that the Mycroft devâs are doing within that mark 2 skill.
EDIT: Oh, hang on. that hardware volume is for the Adafruit. Oh well, the principle is the same. You just need to change the SUBSYSTEM and the ATTR vendor/product variables to the adafruit ones. Will see if I can dig them up from google, otherwise just dump that command straight into your systemd service
@j1nx thanks for the tip with i2cset I tested this and it works.
But I do not see how the udev rule should be set up / working on Subsystem USB.
The Adafruit is not connected to USB but only to I2C .
But what I did is:
Create a /etc/udev/rules.d/10-i2c-sound.rules with the content:
This is kind of blindly executing the command as soon as the I2C controller is seen but I do not see how I could use udev to checked if the AdaFruit is really there. The only thing I can get by running:
udevadm info -a -p /sys/bus/i2c/devices/i2c-1
is
looking at device â/devices/platform/soc/3f804000.i2c/i2c-1â:
KERNEL==âi2c-1â
SUBSYSTEM==âi2câ
DRIVER==ââ
ATTR{name}==âbcm2835 I2C adapterâ
looking at parent device â/devices/platform/soc/3f804000.i2câ:
KERNELS==â3f804000.i2câ
SUBSYSTEMS==âplatformâ
DRIVERS==âi2c-bcm2835â
ATTRS{driver_override}==â(null)â
looking at parent device â/devices/platform/socâ:
KERNELS==âsocâ
SUBSYSTEMS==âplatformâ
DRIVERS==ââ
ATTRS{driver_override}==â(null)â
looking at parent device â/devices/platformâ:
KERNELS==âplatformâ
SUBSYSTEMS==ââ
DRIVERS==ââ
but the good think is: I works! So I think this is definitely a better solution as it kicks in a lot earlier than the systemd user service and the cracking sounds are not really disturbing during boot.
I will add that to the trac wiki
btw: trying to build the KDE plasma-workspace is driving my crazy. I did successfully build plasma-nano but I think I actually need to build plasma-workspace to start a plasma-shell.
But to be totally true I have very little knowledge of KDE. Maybe we find a way to work together on that before I loose my nerves.
I am not really sure why it is necessary to run this on plasma in the first place. In Sailfish OS where also everything is QML, Wayland and QT based we donât use KDE as far as I see.
Yeah, sorry about the USB confusion I wasnât reading properly, hence my edit, but guess was still unclear.
AnyhowâŚ
Nice that you at least can run the command when it sees and loads the broadcom I2C adaptor. That is fine for you as you know for sure your ADA is there, but might be a bit more problematic for my supporting it in MycroftOS like that. If something else is connected to the I2S I expect monkey business.
Perhaps something is shown in âdmesgâ as that is low level kernel stuff. Just run the command; dmesg and scroll through the message in search for I2S stuff. Perhaps you can get the IdVendor and IdProduct from there. If there is any offcourseâŚ
About Plasma-Workspace: Reading through the code, it is only needed for the config headers and is used for Reboot and Shutdown code. So you can enable halt or reboot the device from the GUI.
If you strip that out and just use some enclosure Python code to handle the reboot and halt voice command, I guess you donât need it.
Am posting my complete step by step guide to building a custom image I experimented with for the raspberry pi4 using ubuntu 18.04 minimal server and KDE Neon as base which includes all the required development packages to build Mycroft-GUI, Plasma-Nano, Mycroft-Gui-Mark-2 and other dependencies all from master branch without having to rebuild Qt or any other major KDE framework, or having to modify any repository . Link To Step By Step Guide: https://github.com/AIIX/Documentation/blob/master/Custom-RPI4-MycroftImage.md
This should also help anyone whoâs building a custom OS/Image for the RPI4 to get an overview of the structure of the image and config files required.
If I would have had this earlier it would have saved me a probably a week of time but I am very thankful that you did not post it earlier because it also would have cost me a week of learning and experience!
I know, the pictures are not good, but this is the mycroft-gui running on plasma-nano on my PI3 based mark2 build:
This based on the build log of @AIIX and I re-documented it here Trac-Wiki mycroft-gui-mark-2_sys This is still work in progress but I will document my progress there.
I first tried to do this with Ubuntu server 20.04 but I could by no means get the SDDM up. So I used the same 18.04 image as AIIX.
Still a lot to polish but this is a by far easier way to get the GUI up than building all QT and KDE from sources.
@j1nx would you have an idea how to manage screen rotation with plasma/wayland/X11?
If I do the screen rotation in config.txt as shown above the screen is rotated until SDDM kicks in but then the PI crashes (did not investigate logs yet).
Is there a standard way on how to do screen rotation in X11/xrandr,⌠on the PI3?
Have fun - Guhl
If you have copied over all the files from â7. Download Scripts/Overlays from RPI4 for Mycroftâ part to the image and are booting into plasma nano it should already be running mycroft embedded.
The desktop variant is for âfull blownâ desktop evironments, where as the embedded variant is running directly onto the plasma shell and therefor integrated things as a onscreen keyboard, quick access to certain settings via sliding panel etc.
sorry but in what file exactly do you see that it should auto start the mark2 plasma containment?
I have it autologin and it has a network connection but it just does not start anything and I just donât see what file should start the plasma containment.
I just donât have any KDE experience thatâs why I am so lost here. 20 years of Gnome and GTK leave a trace
I am sorry, going to leave that to AIIX as I have no experience with it either (yet).
It looks like all the overlay files configure to autologin with the mycroft user, with plasma-nano as default desktop (which look to be very minimal and only a shell) , whereas plasma-nano appears to be configured with the whole mark-2 look and feel stuff.
But how to get there if it doesnât auto start at boot ? Sorry, no clue as well. In the end those thing always appear to be a missed file, a wong comma somewhere etc.