Annual ALSA Appeal

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
User avatar
hawsey
Posts: 1950
Joined: Sun May 22, 2011 11:23 pm
Location: Northumberland

Re: Annual ALSA Appeal

Post by hawsey » Wed Jun 05, 2019 11:24 pm

I have no real idea what you are doing Pete but did you get this going ?

Sent from my Moto G (4) using Tapatalk

Happy Joggling

User avatar
pete
Posts: 2817
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Annual ALSA Appeal

Post by pete » Thu Jun 06, 2019 1:14 am

Wrote Andy's Ubuntu Disco image to an 8Gb USB stick. Tweaked it a bit increasing the size of the boot partition, adding the eMMC as a swap drive and extending the Ubuntu partition to 8Gb.

Initially updated and upgraded the build.

1 - initially wrote Ubuntu desktop to the build and tinkered with it.
2 - the build worked fine but it was a tad slow as I threw the kitchen sink at it.
3 - redid stick same as before then ran Andy's script to install xorg to the build.

Then also added a light desktop. The only issue that I am having is that I cannot get a remote session going with ssh.

Note this doesn't have anything to do with using the alsa pin change testing; just the remote x ssh stuff.

I am seeing what I saw with my fat builds relating to remote via VNC, SSH X windows and RDP so I guess I am going to start again from scratch.

Maybe will change the EFI O2 boot rom to the Avaya rom as I have had better luck with that rom.

Here is X windows starting:

Code: Select all

root@openframe:/usr/local/sbin# startx

X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.0-143-generic i686 Ubuntu
Current Operating System: Linux openframe 5.1.3op1 #1 Fri May 17 10:08:19 BST 2019 i686
Kernel command line: acpi=force acpi_backlight=openframe-bl intel_idle.max_cstate=2 rootwait net.ifnames=0 biosdevname=0 panic=20 reboot=acpi thermal.psv=80 BOOT_IMAGE=/vmlinuz-5.1.3op1 root=/dev/sda2 rootfstype=ext2 ro quiet rootwait
Build Date: 03 April 2019  09:03:57AM
xorg-server 2:1.20.4-1ubuntu3 (For technical support please see http://www.ubuntu.com/support) 
Current version of pixman: 0.36.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Thu Jun  6 05:06:03 2019
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
pci id for fd 14: 8086:8108, driver (null)
(II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
Looks fine to me (but really I do not know)

Here is starting gparted via remote ssh.

Code: Select all

root@openframe:~# gparted
/sys/firmware/efi/systab: SMBIOS entry point missing
======================
libparted : 3.2
======================
Only thing is that gparted is displayed on the console and not remotely.
- Pete

Auto mater

User avatar
roobarb!
Posts: 1543
Joined: Sat Mar 05, 2011 1:30 pm
Location: Manchester, UK
Contact:

Re: Annual ALSA Appeal

Post by roobarb! » Fri Jun 07, 2019 10:13 am

pete wrote:
Wed Jun 05, 2019 1:49 pm
Why did the sound configuration work fine when I updated Buzz's build to Ubuntu 18.04 a few months ago?
Likely it's using kernel 3.16 or 3.18, where the pin patches work - I can roll an Ubuntu Disco image with kernel 3.18 right now which will have working audio. In fact, that might be worthwhile - having two identical versions of the OS, one with kernel 3.18 and one with the very latest kernel 5.1. Might make comparisons between ALSA outputs easier.

You can still apply the same patches to later kernels, but they no longer work as expected. Also, the pre-compilation kernel patch only bakes-in a configuration change which can be made from userland anyway; setting 'owneapdctl' to enabled. Interestingly, it seems to me that the detection of headphone / line out jack presence is working just fine - it's just muting the headphones / line out when they're connected instead of the internal speakers. :roll:
birdslikewires.net - home of the Reflash System, SqueezePlay (OS) and various tools for the Joggler!

User avatar
pete
Posts: 2817
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Annual ALSA Appeal

Post by pete » Fri Jun 07, 2019 10:40 am

Thank you Andy.

Yes the updated OpenPeak to 18.04 was using old kernel. But that was the modded Openpeak 1 which is different from the O2 Joggler.

Using old and new would work. Here forgot that my Squeezeplayers are O2 Jogglers and Openpeak2's (with the speakers in front). The Openpeak 1's are all Seabios'd with embedded XP and one is running with an Avaya EFI doing Ubuntu.

I only tested the O2 speakers output in the O2 updated with latest posted Disco Build. Added firefox and it did stream / play back audio.

I have an old IBM desktop speaker with USB power that I use on the headphone jack to test with and will test.

Starting again today with a new build mostly to see if I can get the remote x windows stuff working as it has not worked.
- Pete

Auto mater

User avatar
roobarb!
Posts: 1543
Joined: Sat Mar 05, 2011 1:30 pm
Location: Manchester, UK
Contact:

Re: Annual ALSA Appeal

Post by roobarb! » Fri Jun 07, 2019 12:14 pm

Rolling some new images now. I'll make them 8GB so you don't have to faff with the filesystem.

Kernels are compiling...
birdslikewires.net - home of the Reflash System, SqueezePlay (OS) and various tools for the Joggler!

User avatar
pete
Posts: 2817
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Annual ALSA Appeal

Post by pete » Fri Jun 07, 2019 12:32 pm

Thank you Andy.

Here is is Kika clean up Friday. Kika is my now 41 year old parrot. So I am hanging around here.

(IE: take her cage apart some, give her a bath, wash her sleeping blankets, et al)

Switched here to using an older but faster Kingspec 8Gb SSD USB stick. It is much larger than the regular USB stick but way faster.
I have a few of these from early Joggler testing.

I will wait to write to it. Using Etcher here ...works great for me.

Looking for my IBM old desktop speaker....

Will document the step by step here on the forum as earlier.

Found the IBM desktop speaker. Here is a picture of what I am using to test:

1 - logitech wireless keyboard
2 - old APC USB hub (for logitech wireless dongle and USB stick)
3 - IBM speaker which will be externally powered as the USB draw is probably too high for the O2 Joggler.
4 - Kingspec 8Gb SSD stick (fast).
Testing.jpg
- Pete

Auto mater

User avatar
roobarb!
Posts: 1543
Joined: Sat Mar 05, 2011 1:30 pm
Location: Manchester, UK
Contact:

Re: Annual ALSA Appeal

Post by roobarb! » Fri Jun 07, 2019 2:39 pm

Well, this is taking a while. Some weirdness with the boot process, just tracking it down.

Oh, for goodness sake. Fixed the boot, now audio on 3.18 is broken for some reason. :lol:

Now building 3.16 to check my sanity. Or test it, one or the other.
birdslikewires.net - home of the Reflash System, SqueezePlay (OS) and various tools for the Joggler!

User avatar
pete
Posts: 2817
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Annual ALSA Appeal

Post by pete » Fri Jun 07, 2019 3:13 pm

OK downloaded

1 - disco-ext2-8000-32-disco-3.18.140op1.img.gz
2 - disco-ext2-8000-32-disco-5.1.7op1.img.gz

Will wait and not modify boot partition, add apt cache and use internal mmc as a cache drive.

Tested old build with external speaker. Very noisy and no sound. (sound still works with internal speaker).
- Pete

Auto mater

User avatar
roobarb!
Posts: 1543
Joined: Sat Mar 05, 2011 1:30 pm
Location: Manchester, UK
Contact:

Re: Annual ALSA Appeal

Post by roobarb! » Fri Jun 07, 2019 3:22 pm

Those builds may be stuffed, pete - don't rely on them! Likelihood is the 3.18 one won't even boot.
birdslikewires.net - home of the Reflash System, SqueezePlay (OS) and various tools for the Joggler!

User avatar
pete
Posts: 2817
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Annual ALSA Appeal

Post by pete » Fri Jun 07, 2019 3:25 pm

Understood...

Just wrote the 3.18 one to the USB stick....I can edit the boot partition maybe?

It is showing an error "boot argument" and no init found and redoing a panic boot...it did appear to have issues writing the image to the SSD stick (really slow).

Will write the 5.x build to same SSD USB stick....looking for another SSD stick and will label each one with each kernel.

Same errors on boot with the 5.X build. Switching over to W7 for a bit here and doing a low level HDD format of the two USB SSD sticks...just to rejunvenate them ...was going to do same thing with the eMMC stuff on the the other jogglers running windows.

Gotta look as I think I have a DOS (russian one) low level formatting tool that might work via a dos boot stick...
hdd.jpg
- Pete

Auto mater

User avatar
roobarb!
Posts: 1543
Joined: Sat Mar 05, 2011 1:30 pm
Location: Manchester, UK
Contact:

Re: Annual ALSA Appeal

Post by roobarb! » Fri Jun 07, 2019 3:50 pm

The build system didn't recreate the loop devices properly when installing, so the whole thing ended up a mess.

Very interestingly, I'm having the audio issues with Ubuntu Disco which seem unrelated to the kernel version. I'll hop back to Bionic and try again.
birdslikewires.net - home of the Reflash System, SqueezePlay (OS) and various tools for the Joggler!

User avatar
pete
Posts: 2817
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Annual ALSA Appeal

Post by pete » Fri Jun 07, 2019 4:02 pm

Understood...

Will wait...

Done low level formatting SSD USB sticks here.

Kika is being a little B this morning and nipped my arm I was cleaning the inside of her cage. She is a macaw sized parrot and the largest of the Amazon family, old and cranky now...

Typically she is fine. But she likes my full attention.
kika.jpg
- Pete

Auto mater

User avatar
roobarb!
Posts: 1543
Joined: Sat Mar 05, 2011 1:30 pm
Location: Manchester, UK
Contact:

Re: Annual ALSA Appeal

Post by roobarb! » Fri Jun 07, 2019 4:06 pm

pete wrote:
Fri Jun 07, 2019 4:02 pm
old and cranky now...
Like this OpenFrame. :mrgreen:

Gah, I'm going to have to quit and revisit this. I'm now getting the same problem on every build - presence and absence of the headphones / line out is being completely ignored, regardless of whether the patch is applied to the kernel or not. I must be missing something because I'm doing too many things at the same time.
birdslikewires.net - home of the Reflash System, SqueezePlay (OS) and various tools for the Joggler!

User avatar
pete
Posts: 2817
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Annual ALSA Appeal

Post by pete » Fri Jun 07, 2019 4:16 pm

Not an issue Andy...

Concurrently here building a new PFSense (BSD) firewall with one of those new little mini computers (will multiple NICs).

http://cocoontech.com/forums/topic/3167 ... -computer/
- Pete

Auto mater

User avatar
pete
Posts: 2817
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Annual ALSA Appeal

Post by pete » Fri Jun 07, 2019 5:48 pm

Started over again with old (new build).

Installed thin ubuntu desktop.

Noticed sound comes out of speaker even though I have external speaker amp plugged in.

Looking at:

root@openframe:/home/joggler# cat /sys/class/sound/hwC0D0/init_pin_configs
0x07 0x01c5e150
0x08 0x01451130
0x0a 0x0221401f
0x0b 0x02a19020
0x0c 0x01813021
0x0d 0x01014010
0x10 0x500701f0
0x11 0x90330122
0x15 0x50a001f1

Installed updated alsa stuff.

found this:

You can echo (pin, config) pairs to it at run-time to override the start-up defaults. e.g.:

$ sudo sh -c "echo 0x08 0x40f000f0 > /sys/class/sound/hwC0D0/user_pin_configs" # Applies an override
$ cat /sys/class/sound/hwC0D0/user_pin_configs # List all overrides
0x08 0x40f000f0
$ sudo sh -c "echo 0x09 0x40f000f1 > /sys/class/sound/hwC0D0/user_pin_configs" # Applies another override
$ cat /sys/class/sound/hwC0D0/user_pin_configs # List all overrides
0x08 0x40f000f0
0x09 0x40f000f1
- Pete

Auto mater

User avatar
pete
Posts: 2817
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Annual ALSA Appeal

Post by pete » Fri Jun 07, 2019 7:33 pm

I see it sensing the audio jack output and disabled muting with alsamixer. So this results in sound coming from the internal speaker and external speaker.

Now playing with pin configuration.

Almost...doing speaker test without external speaker works, plug in external speaker and it mutes internal speaker but no sound yet on external speaker.

Got it. Loaded up the hdajackretask in one of the squeezeplayers and wrote down the overides on the pins.

Then while running speaker-test got it working such that without external speakers plugged in - internal speakers work and when plugged in only external speakers work.

Well it worked once.

Now only sound comes out when external speakers are plugged in. When unplugged there is no sound....getting close

Got it...only two changes and in alsamixer option to automute is on.

Attached pictures of two changes as I still cannot run remote x windows stuff.

so when running hda-jack-retask it creates a file called /lib/firmware/hda-jack-retask.fw which looks like this:

[codec]
0x83847632 0x00000100 0

[pincfg]
0x07 0x01c5e150
0x08 0x01451130
0x0a 0x90170150
0x0b 0x02a19020
0x0c 0x01813021
0x0d 0x0321403f
0x10 0x500701f0
0x11 0x90330122
0x15 0x50a001f1

It is called up by /etc/modprobe.d/hda-jack-retask.conf

which looks like this:

# This file was added by the program 'hda-jack-retask'.
# If you want to revert the changes made by this program, you can simply erase this file and reboot your computer.
options snd-hda-intel patch=hda-jack-retask.fw,hda-jack-retask.fw,hda-jack-retask.fw,hda-jack-retask.fw
Sound-fixed-Disco.jpg
So on the old O2 running joggler alsamixer looks like this:
SP-Joggler-AlsaMixer.jpg
On the squeezeplayer joggler found this file /lib/firmware/of1-stac9202.patch
which looks like this:
[codec]
0x83847632 0x100 0

[pincfg]
0x07 0x01110014
0x08 0x01410013
0x0a 0x02111011
0x0d 0x02214012
0x0c 0x01810022
0x0b 0x01a10021
0x10 0x01010031
0x11 0x01310023
0x15 0x01d10024

[verb]
0x06 0x701 0x0000
0x07 0x70c 0x0002
0x14 0x390 0x0000
0x14 0x3a0 0x0000
0x0f 0x707 0x0000

[hint]

In /etc/modprobe.d/ see this file ==> of1-stac9202.conf which looks like this:

options snd-hda-intel position_fix=1 bdl_pos_adj=64 patch=of1-stac9202.patch

So basically going to copy the two files over to the disco build and see what happens. Well the patch file is already there but there was no conf file so only copied that one.

Rebooted and ran speaker test and it works fine now with internal speaker only or externally plugged in speaker only.

So now on the disco build only issue is related to some wierd efi boot video thing which is what is not letting me do the remote X windows via SSH.
- Pete

Auto mater

User avatar
roobarb!
Posts: 1543
Joined: Sat Mar 05, 2011 1:30 pm
Location: Manchester, UK
Contact:

Re: Annual ALSA Appeal

Post by roobarb! » Fri Jun 07, 2019 9:51 pm

pete wrote:
Fri Jun 07, 2019 7:33 pm
So now on the disco build only issue is related to some wierd efi boot video thing which is what is not letting me do the remote X windows via SSH.
Whoa, you mean it's worked? I was just getting set up here with a test Joggler, making sure I hadn't messed up too badly with kernel 3.16. I'll just test my work there and roll a new kernel 5.1 version of Disco and see if I can replicate your work. :)

Okay, issue on 3.16 traced to a bug in a revised version of my of-identifier script, which applies or removes the patches. I'll fix that and move on.
birdslikewires.net - home of the Reflash System, SqueezePlay (OS) and various tools for the Joggler!

User avatar
pete
Posts: 2817
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Annual ALSA Appeal

Post by pete » Fri Jun 07, 2019 9:57 pm

Yeah!!

It does work.

You do not have to build another one with kernel 3.16.

Just do the same as above on your Disco build.

Video EFI is a wierd error that I see when starting...it saids something about writing over video memory. That said the desktop boots fine but I cannot do x windows stuff via ssh.

IE: ssh -Y joggler@ipofjoggler or ssh -X joggler@ipofjoggler

When I run a program it shows up on the joggler rather than my terminal window.

joggler@openframe:~$ xclock

No errors though.
- Pete

Auto mater

User avatar
pete
Posts: 2817
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: Annual ALSA Appeal

Post by pete » Fri Jun 07, 2019 10:01 pm

Thank you Andy!!!!

Now going to try a mini Disco build on the O2 Joggler for use running a screen saver...wondering if it will fit on the 1 Gb emmc and finishing up with Kika ...
- Pete

Auto mater

User avatar
roobarb!
Posts: 1543
Joined: Sat Mar 05, 2011 1:30 pm
Location: Manchester, UK
Contact:

Re: Annual ALSA Appeal

Post by roobarb! » Fri Jun 07, 2019 10:06 pm

pete wrote:
Fri Jun 07, 2019 9:57 pm
Yeah!!

It does work.
Wowsers - okay, so I'll drop /lib/firmware/hda-jack-retask.fw into place and use /etc/modprobe.d/hda-jack-retask.conf to trigger it, as if hda-jack-retask had put them there. Just cloning a fresh kernel 5.1 system now...

Okay, tried this out. We're almost there...

- With no patches applied on a kernel 5.1 system, plugging in headphones results in audio continuing to come from the internal speakers and only a crackling sound to be heard over the headphones.

- With this patch applied, plugging in headphones results in the audio being switched from internal speakers to the headphones properly; but the crackling sound is transferred to the internal speakers while the headphones are attached.

You can replicate this behaviour under a kernel 3.16 system by not choosing "Line Out+Speaker" on the Auto-Mute option, but picking the option before that (I can't remember if it says "Speaker" or "Line Out" as the muting option). You get three options on a completely working system - the "Line Out+Speaker" option prevents the audible crackling from the internal speaker when headphones are connected. Currently we only get "Enabled" and "Disabled" as Auto-Mute options.

So we have switching, we just need to lose the crackle - and I bet it's another of those outputs which needs remapping.
birdslikewires.net - home of the Reflash System, SqueezePlay (OS) and various tools for the Joggler!

Post Reply