User fxkrait (@fxkrait?) reported in #postmarketOS, that Audio isn't working on the N900.
I guess this could be a kernel regression, as it was clearly working before (#702).
@pavelmachek, @craftyguy, @MartijnBraam: Could you test if it works for you?
@pavelmachek: do you know if it is a kernel regression?
@fxkrait: you could check if it works with linux-postmarketos-stable instead of linux-postmarketos-mainline. Just replace it in the depends of aports/device/device-nokia-n900/APKBUILD, run pmbootstrap build device-nokia-n900 --force, zap your chroots and install again.
On my N900 the audio works, I will check which kernel version I have installed
I got the same problem after upgrading. The upgrade included updates for alsa, linux, and a lot of audio libraries, so I don't know which is causing the problem! I tried to reinstall as an attempt to fix the problem, but since #1408 in pmbs, I can't can't do it!
Here is some stuff from dmesg:
[ 0.000000] Linux version 4.15.12 (pmos@localhost) (gcc version 6.4.0 (Alpine 6.4.0)) #1-postmarketOS PREEMPT Wed Mar 21 22:53:54 UTC 2018
...
[ 1.058197] rx51-audio n900-audio: could not get speaker enable gpio
...
After I try to play audio, mpg123 hangs, and then shows:
[src/libout123/modules/alsa.c:241] error: Fatal problem with alsa output, error -5.
[src/libout123/libout123.c:658] error: Error in writing audio (I/O error?)!
main: [src/mpg123.c:809] error: Deep trouble! Cannot flush to my output anymore!
And then, a new dmesg pops up:
...
[ 630.732879] tlv320aic3x-codec 2-0018: Unable to sync registers 0x3-0x5. -121
Here is the full report: dmesg-n900.txt
I tested some v4.16-rcX kernels, so I expect audio to work in v4.16.
It was broken in -next-for-v4.17 IIRC.
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
my depends is set to stable by default, I didn't touch it. I'm on kernel 4.15.12, same as nikksaan. Similar (same?) errors.
Since we did not change the kernel _config_ in months, looks like we can rule out that this is the cause.
Could you guys test a different kernel version (e.g. the latest one), by editing aports/main/postmarketos-linux-stable/APKBUILD, then running:
$ pmbootstrap build linux-postmarketos-stable --arch=armhf
$ pmbootstrap zap
$ pmbootstrap install --sdcard=.... # usual installation
With right configuration, audio should work in 4.14 and 4.15.
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
(@NikkSaan: FYI: in #1408 is a workaround for the uboot issue, and it should be fixed upstream soon)
I can get mainline installed by editing APKBUILD, but it still installs and boots to stable. I'm not sure how to get it to boot mainline. There are mainline image entries in /boot, and I tried editing boot.scr from stable to mainline, but it wouldn't boot after that.
@ollieparanoid Thank you!
Sadly, reinstalling didn't work. I also tried compiling a newer kernel, pkgver=4.16.0 and pkgver=4.16.2 but pmbs keeps producing this same error:
'/home/pmos/build/src/config-postmarketos-stable.armhf' -> '/home/pmos/build/src/build/.config'
make: Entering directory '/home/pmos/build/src/linux-4.16'
make[1]: Entering directory '/home/pmos/build/src/build'
getconf: LFS_CFLAGS: unknown variable
getconf: LFS_LDFLAGS: unknown variable
getconf: LFS_LIBS: unknown variable
HOSTCC scripts/basic/fixdep
GEN ./Makefile
YACC scripts/kconfig/zconf.tab.c
/bin/sh: bison: not found
HOSTCC scripts/kconfig/conf.o
make[2]: *** [scripts/Makefile.lib:217: scripts/kconfig/zconf.tab.c] Error 127
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/home/pmos/build/src/linux-4.16/Makefile:514: olddefconfig] Error 2
make[1]: Leaving directory '/home/pmos/build/src/build'
make: *** [Makefile:146: sub-make] Error 2
make: Leaving directory '/home/pmos/build/src/linux-4.16'
>>> ERROR: linux-postmarketos-stable: all failed
(001019) [04:26:05] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(001019) [04:26:05] NOTE: The failed command's output is above the ^^^ line in the logfile: /home/nix/pmwd/log.txt
(001019) [04:26:06] ERROR: Command failed: (native) % cd /home/pmos/build; busybox su pmos -c CC=armv6-alpine-linux-muslgnueabihf-gcc CROSS_COMPILE=armv6-alpine-linux-muslgnueabihf- SUDO_APK='abuild-apk --no-progress' CARCH=armhf abuild -d -f
Don't count on me tho. I am compiling in a VM on a 10 y.o macbook. Also, I'd rather focus on other aspects of the device; the kernel isn't my my forte.
@fxkrait I'm not 100% sure about this, but since boot.scr is generated when building device-nokia-n900 package, editing it afterwords on the device shouldn't do anything.
Instead, edit uboot-script.cmd inside the package. Then, regenerate checksums, build, and install as usual:
$ pmbootstrap checksum device-nokia-n900
$ pmbootstrap build --arch=armhf device-nokia-n900 --force
$ pmbootstrap install ....
Alternativelly you can edit uboot-script.cmd outside the package, then generate a new uboot image manually:
$ # Replace `/path/to/uboot-script.cmd` with the real path!
$ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n postmarketos -d "/path/to/uboot-script.cmd" "boot.scr"
Then transfer the new boot.scr to the sdcard ( backup your old first ) and try to boot.
@NikkSaan I think I had that same exact error when installing mainline. Try rm -R pmos directory, and any other ones except your pmbootstrap directory, and build and install again. Should work. Your tips above worked great for editing boot order. Thanks man.
@ollieparanoid I'm already running stable, so I installed mainline 4.16 rc6, but it doesn't boot.
@fxkrait Thanks, I might try compiling tomorrow!
@ollieparanoid Sound in 4.16.2 is working!
@NikkSaan Are you running mainline? Can you list out all the steps you got it to work and boot?
like
1) Edit APK build to linux-postmarketos-mainline
2) change uboot.cmd from stable to mainline
3) compile mainline with "blah" ?
4) Install
@NikkSaan: Awesome news! I guess you've updated linux-postmarketos-stable to that version - do you want to make a PR with that change?
@fxkrait No, I'm running stable! I updated by
linux-postmarketos-stable/APKBUILD to pkgver=4.16.2$ ./pmbootstrap.py checksum linux-postmarketos-stable$ ./pmbootstrap.py build linux-postmarketos-stable --arch=armhfubootThen, after I verified audio was working in a fresh install, I also updated the kernel on my main installation (on another sdcard) by following these instructions.
@ollieparanoid Yes, -stable! By PR you mean a pull request, right? Something like:
Did I get that wright? What do I name the new branch?
4.16.3 just released so we should update to that
@NikkSaan what did you do to fix that error, I'm getting something similar when compiling stable.
@fxkrait It fixed itself. But I suspect It was because, for some reason, bison was missing in the native chroot - just as the log suggested! Chroot into native and install bison.
Why do you need sound so much, most people really don't care. Are you using an n900 as mp3 player or something?
@NikkSaan Bro thanks. You're the best. I saw that in log, just didn't know it was part of chroot. My system had bison so I got confused.
Audio is really quiet in speakers. And Headphones are extremely quiet. Not sure how to make louder. Adjusting PCM does not do much.
The main reason, is I want to run the same software, and have the same setup and configs everywhere. Hate the fragmentation of android, the lack of keyboards, how closed it is, lack of linux software. Using n900 mainly as planner with calcurse, and use emacs and nextcloud. With audio, I can load videos (smoothly if I can figure out how to overclock like on maemo), youtube (cli youtube-viewer), use ncmpcpp. I love i3-wm, keyboard, and a real linux os on mobile. Hardware is lacking though.
You should be able to find working mixer settings in unicsy-demo
package.
OTOH... there were some warnings saying that internal speakers can be
damaged by too loud music.
Ok. For headphones, the volume control is "TPA6130A2 Headphone" works great. You also need to set Jack Function to Headphones. Audio somewhat quiet though at max volume.
Also "sudo udevadm trigger" is no longer needed.
@NikkSaan: yes, I meant a pull request with "PR" like you described it. An example for a good branch name would be fix/1404-n900-audio. While you're at it, could you add bison to the makedepends as well?
@fxkrait: thanks for explaining how you use the N900 today, that's very interesting!
Also "sudo udevadm trigger" is no longer needed.
Where does it say that it is needed, and if you don't mind, could you remove it from where it is not necessary anymore?
It's great to read that you both have it figured out now, great job! :tada:
@fxkrait Glad I could help! For my mixer settings follow this, specifically the last part, where I advice to create a diff. I've been using it since I got my n900, works great. I can write an entire wiki page just on the audio subsystem, but I don't want to take the time now, as I am trying to turn my n900 into a 'super feature phone'. Instead I'll just paste an excerpt from my dev journal pertaining to the audio jack, hope it helps you:
[...]
Heaphones are working
From a state of all 'off' and 'mute'...
* PCM ( Volume ) [ to taste ]
* Line ( Switch ) { on }
* Right DAC MUX ( Mux ) [ DAC_R3 ] <--o Choosing DAC_x3 for
* Left DAC MUX ( Mux ) [ DAC_L3 ] <-/ performance reasons.
* TPA6130A2 ( Volume ) [ to taste ]
* Jack Function ( Switch ) { !off }
[...]
Be careful with max volumes, that TPA chip is powerful! Also, note that new headphones with mics designed for iOS, Android will NOT work. They give will you low, none or mono output because of their connector rings being different from what Nokia use to use. My workaround this was to create a converter. Use regular headphones with 3-pole TRS connector to test.
@ollieparanoid I updated the wiki
@NikkSaan In your PR, add flex to the make depends. I was missing that along with bison in my chroot. Man if I could place and receive calls and text on the n900 in a decent interface, I would cry. Also take a look at the Gemini pda. Might be up your alley. Way better specs but needs dev work.
@ollieparanoid I followed the steps, but trying to push gives me this:
$ git push --set-upstream origin fix/1404-n900-audio
Username for 'https://github.com': nikksaan
Password for 'https://[email protected]':
remote: Permission to postmarketOS/pmbootstrap.git denied to NikkSaan.
fatal: unable to access 'https://github.com/postmarketOS/pmbootstrap/': The requested URL returned error: 403
I obviously don't know how to use git. Maybe someone who does should do this!
@fxkrait I know about Gemini. If I find one for cheap, I'll get it. Hack-a-day project is trying to revive the Psion Series 5 by replacing the motherboard, which is more interesting to me.
Maybe you should do the PR, I'm new to git, so trying a PR failed!
@fxkrait Do you want to cry? You can do text messages and voice calls
on N900. Look for "unicsy-demo" package for GUI, and
"libcmtspeechdata" for voice support. libcmtspeechdata needs packaging
for pmOS (likely lot of fun), but more importantly it needs fixes, as
audio quality is currently poor.
If you want good audio quality without too much hassle, look for
Motorola Droid 4. Pretty good mainline support, and unicsy-demo does
good job there.
Before buying Gemini, check how big their diff to mainline is. It may
be unsuitable for free software projects.
@NikkSaan I might be wrong, but you probably should fork the repository, and push the changes to your own repo/branch, after which you should make a Pull Request (via Web Interface I believe) requesting to merge your branch with official pmOS.
@NikkSaan: Yes, @sicelo is completely right, you would need to fork the repository first. There's lots of documentation on how to create a pull request etc, let us know if this is still unclear :+1:
In case you want to follow @pavelmachek's suggestion I think the steps would be:
unicsy_demo, but @pavelmachek updated his upstream source some more, so it is probably easier to start with the git version right now)libcmtspeechdata (How to create a package) (is this the right source @pavelmachek?)I would be more than happy to help with any of that if someone wants to invest some time into following these steps and testing on their N900!
One year of postmarketOS is coming up in roughly a month, and of course there will be a blog post about it. And it looks like we will be able to present phone calls on mainline by that time on the Nexus 5 (some folks are doing amazing work on that at the moment). It would be incredible to show phone calls on the N900 as well!
Using n900 mainly as planner with calcurse, and use emacs and nextcloud. With audio, I can load videos (smoothly if I can figure out how to overclock like on maemo), youtube (cli youtube-viewer), use ncmpcpp. I love i3-wm, keyboard, and a real linux os on mobile. Hardware is lacking though.
I can write an entire wiki page just on the audio subsystem, but I don't want to take the time now, as I am trying to turn my n900 into a 'super feature phone'.
Writing about how it's used as "super feature phone" with pmOS, and having all these programs running on it would be great to share in the blog post! It would be fantastic if you guys could take photos of your setups (and put them either in the wiki, or in the next post issue).
Reading through this issue is amazing, thanks to all of you for all the work you put into improving the N900 port, and actually doing something useful with it :grinning:
I'd actually recommend trying unicsy_demo, as packaged for pmOS,
first.
Yes, I did more changes since that, but they are for Droid 4, and I'm
currently focusing on Droid 4.
Oh and thanks for the calcurse pointer.
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Most helpful comment
On my N900 the audio works, I will check which kernel version I have installed