libera/#maemo-leste/ Friday, 2024-07-26

KREYRENIs there a way to write the OS to the N900's internal storage somehow?01:11
* KREYREN is trying to figure out a deployment method for nixos where his infrastructure management deploys OS directly to the drives for purity01:12
siceloKREYREN: easiest way would be to partition the internal storage, then have an u-boot config that will point to that. you  probably don't want to remove Maemo07:22
siceloanyway, we generally prefer SD cards since they're (likely to be) much faster than the emmc.07:23
freemangordonWizzup: ok, it is not only mafw07:59
freemangordonactually paplay does not work right after reboot here07:59
freemangordon[pulseaudio] shm.c: mmap() failed: Cannot allocate memory08:00
freemangordonseems we hit some shmem limit08:00
freemangordonhttps://pastebin.com/GA00WiSr08:01
freemangordonthis is from paplay08:01
freemangordonpulseaudio has 45 shmem maps and that seems to be the limit08:04
freemangordonok, so 45*64MB = 2880MB, ~3GB, which is basically the max 32 bit address space, no?08:11
freemangordonso, does anyone know what would be the issue if we reduce shm-size-bytes to 8MB or something?08:40
freemangordonheh, on fremanlte shm is disabled :D08:42
freemangordonI think we shall use https://man.archlinux.org/man/pulseaudio.1.en#disable_shm08:47
sicelothanks Wizzup (@ merging)08:57
Wizzupfreemangordon: interesting @ shm...10:52
WizzupPlease note that data transfer via shared memory segments is always disabled when PulseAudio is running with --system enabled (see above).10:52
Wizzupfremantle was running in system so yeah10:52
Wizzupfreemangordon: but why do we hit this limit10:53
Wizzupah, I see...10:53
freemangordonbecause we are 32 bits :)11:07
freemangordonWizzup: not only fremantle is running with --system, shm is also disabled in client.conf11:08
freemangordonon fremantle that is, check it11:08
Wizzupbut system disabled shm11:20
Wizzupdisables11:20
Wizzupbut yeah we can control client.conf changes11:20
Wizzupwant me to try?11:20
freemangordonI've already disabled shm here and everything looks fine so far11:27
freemangordonbut, we have the option to not allocate 64MB VM space per client11:28
uvos__why would it be holding so mutch shm anyhow11:28
freemangordonit does not11:28
freemangordonit just allocates the space11:28
uvos__would not a couple of meg per client be enough11:28
uvos__ok11:28
freemangordonI don;t know, was about to ask :)11:28
uvos__but why dose it allocate all the this space11:28
freemangordonthis is the default11:29
uvos__sure i get that but i dont understand under which circumstances this would be benefital11:29
uvos__i gues we need to ask pa devs11:29
freemangordonI was not able to find anything useful in inet11:30
uvos__we dont really want to disable shm ofc11:30
uvos__since it saves cpu time over using the socket11:30
freemangordonshm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB11:30
uvos__iirc enableing shm (via loss of system) was what a factor that made call audio tollerable on n90011:31
uvos__freemangordon: ok yeah we can just make it smaller thne11:31
freemangordonyeah, but how much?11:31
uvos__i gues we mesure how mutch it uses11:32
freemangordonthere is absolutely no explanation what this is used for11:32
freemangordonno, as it deletes /dev/shm files11:32
freemangordonso we don't know the real size11:32
uvos__iiuc its used to transfer samples11:32
freemangordonand I am not sure what to check in /proc/$pid11:32
uvos__ok ill see if i can figure it out11:33
freemangordonbut yeah, I guess we can make it 1MB and see if it is ok11:33
uvos__otherwise lets ask  #pulseaudio on matrix11:33
freemangordondo I need account fo that?11:34
freemangordon*for11:34
freemangordonsee https://github.com/gavv/gavv.github.io/blob/hugo/content/articles/009-pulseaudio-under-the-hood.md11:36
freemangordon"Zero-copy mode"11:36
uvos__freemangordon: yes at account11:40
uvos__but i can do it11:40
freemangordonplease do11:40
uvos__freemangordon: hmm maybe its pas fault at all11:41
freemangordonwtym? it is PAs fault11:41
uvos__depends on for what reason shm regions are allocated11:41
uvos__a misbehaveing client mit be creating the problem by transfering a tonne of small buffers?11:42
freemangordonno matter, on 32bits we have 3GB address space per process11:42
freemangordonno, no, it allocates ^$MB address space, not memory11:42
freemangordon*64MB11:42
uvos__sure but i think pa mapps client space on thair request11:42
freemangordondoes not matter11:43
freemangordonif it is mapped or not, as long as it is allocated11:43
uvos__ok not sure why not but ok11:43
freemangordonso, for every new client PA allocates 64MB of virtual address space11:43
WizzupI think the point is that there's a limit to how much more can be allocated virtually11:43
freemangordonyes11:43
uvos__yeah but dose pa allocate vm space because it wants to or because a client is requesting for it to happen11:44
uvos__ok11:44
freemangordonand that limit for 32 bit linux is 3GB11:44
freemangordonPA allocates no matter what client does11:44
uvos__ok11:44
freemangordonit is sevrer setting11:44
freemangordon*server11:44
freemangordonsee   pa_mempool_new()11:44
uvos__i gues an application might be creating a tonne of pa connections, ie being lots of clients11:44
uvos__but other than that ok11:44
uvos__if its 64MiB per client and its exausting 3GiB space then thats over 40 clients11:45
uvos__which seams excessive11:45
freemangordonyes, that's what happens it seems11:45
freemangordonwe have 45 pools11:46
freemangordonso, more that one connection per client11:46
freemangordonbut we have about 20 something clients11:46
freemangordonhow is that excessive?11:46
uvos__40 clients seams excessive11:46
uvos__20 is maybe less so11:46
uvos__still seams high for the amount of stuff we have running11:46
freemangordonclients are ~20, but they have more than one connection11:47
uvos__20 clients that want to play audio?11:47
uvos__who are these11:47
freemangordonmhm11:47
freemangordonsphone, mafw, xinput-sounds, accounts, notifications, etc,etc11:47
freemangordondo pa-info and you will see them11:48
freemangordonbut yes, we have them11:48
Wizzuppacmd11:48
Wizzuplist-clients11:48
Wizzupall of the ones I see now are valid ones11:48
Wizzupbut yeah like fmg just said11:48
freemangordonstill, 20 clients should not lead to resource exhaust11:49
Wizzupin any case we clearly need to allow more clients than 20/4011:49
Wizzupyeah11:49
uvos__i only have 1111:49
uvos__but ok11:49
freemangordonwell, you don;t run leste then11:49
Wizzupsystemd-logind also has one open :D11:50
Wizzuptwo actually11:50
freemangordonmhm11:50
freemangordonand it opens new one for each session IIUC11:50
freemangordonso every ssh session has new PA connection11:51
Wizzuplol11:52
Wizzupwell this might be less of an issue eventually with pipewire11:53
freemangordondon;t quote me on that one though11:53
Wizzupso we can decrease shm or disable it I guess11:53
freemangordondecrese11:53
freemangordonso, with 64MB we have 1024 'slots', whatever it is11:53
freemangordonwith 8MB segment size we will have 128 slots11:54
freemangordonand that will allow ~380 clients11:55
freemangordonmaybe we can do 16MB, dunno, lets see what uvos__ can get from PA devs11:55
Wizzupseems easy enough to try to change client.conf and see11:55
freemangordonthere is client.conf.d :)11:55
Wizzupyeah that too, but I mean for us now11:56
freemangordonyeah, I'll make it 16, you can make it 3211:56
Wizzupno 8?11:56
freemangordonno idea11:57
Wizzupso you want this:11:57
Wizzupshm-size-bytes = 32768 # setting this 0 will use the system-default, usually 64 MiB11:57
freemangordon*bytes*11:57
Wizzupoh11:57
Wizzup4096 then11:57
freemangordon32*1024*102411:57
Wizzupoh sorry11:58
Wizzupwaking up still :)11:58
freemangordonlemme see if it parses MB11:58
Wizzupshm-size-bytes= Sets the shared memory  segment  size  for  clients,  in  bytes.  If  left unspecified  or  is  set  to 0 it will default to some system-specific default, usually 64 MiB. Please note that usually there is no need  to  change  this  value,  unless  you  are running an OS kernel that does not do memory overcommit.11:58
Wizzupmaybe the last part there is relevant11:59
freemangordonmaybe12:04
freemangordonperhaps that our issue12:04
freemangordonlemme check12:05
freemangordonovercommit_memory is 012:05
freemangordonhttps://www.kernel.org/doc/Documentation/vm/overcommit-accounting12:05
freemangordonbut, I still think we cannot overcommit more than address space12:06
freemangordonWizzup: do you know if we have something like PAE on arm?12:09
Wizzupit does exist yes12:09
freemangordonmaybe it is disabled in our kernel12:10
freemangordonFeatures: half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd3212:10
freemangordonno lpae here12:10
WizzupI don't think it works like that on arm12:10
Wizzupmaybe12:10
Wizzuphttps://developer.arm.com/documentation/den0013/d/ARM-Architecture-and-Processors/Architecture-history-and-extensions/Large-Physical-Address-Extension--LPAE-12:11
freemangordonI think it we have to enable huge pages12:11
WizzupLPAE is optional in the v7-A architecture and is presently supported by the Cortex-A7, Cortex-A12, and Cortex-A15 processors12:11
freemangordonand then we'll ahve more than 4G address space per process12:11
uvos__if lpae is like x86 pae then no12:13
uvos__that extends physical address space only, virtual memory space is still 32bit12:14
uvos__ie you can have more than 4GiB allocated on physical ram, but the mmu can only map 4GiB at a time12:15
freemangordonhmm, yeah, right, address space is still 4GB12:15
uvos__anyhting else would make no sense anyhow, the abi would have to change to account for bigger pointers12:16
freemangordonyeah, agree12:16
freemangordonok, I am going to decrease segment size to 16MB, Wizzup to 32MB, if you want you can make yours 8MB12:17
freemangordonto see what will work12:17
uvos__ok12:19
uvos__where is the config file exactly?12:19
uvos__found it12:20
uvos__ok done12:20
freemangordon/etc/pulse/client.conf.d12:20
uvos__838860812:20
freemangordonmhm12:20
freemangordonhmm, client.conf.d seems to be ignored12:23
Wizzupfreemangordon: I put it in client.conf, but ou want us to start a call then, and then try omp?12:24
freemangordonpaplay does the job too12:25
freemangordoncat maps | grep memfd | wc -l12:26
freemangordonin /proc/$pid_of_pa12:26
freemangordonbetter restart first, so all clients to connect12:28
freemangordonWizzup: please verify that setting took effect, in /proc/$pa/smaps12:35
freemangordonas here it seems to be ignored12:36
freemangordonWizzup: no ide why, but that setting is ignore13:00
freemangordonWizzup: uvos__: the change must be made in daemon.conf, not in client.conf13:04
freemangordonoh, ok13:23
freemangordon*both* daemon.conf and client.conf have to have shm-size-bytes, otherwise one side keeps 64MB13:24
Wizzupah...13:43
Wizzupwill do in a bit! on a call atm13:43
Wizzupfreemangordon: btw did you push anything for the headset? or forgot the status13:48
KREYRENsicelo, i kinda need a solution that lets me plug a cable and flash the thing ideally tbh it seems that the maemo-flasher works that way though?13:54
freemangordonWizzup: no14:06
freemangordonwill try to do it after I am back14:07
freemangordonbtw, I still ahve issues with reboot/poweroff14:07
Wizzupyeah I do have it now (@reboot)14:22
freemangordonWizzup: also, it would be good to push some stuff to -stable, if you have time14:24
freemangordonfor wure tracker/mafw14:24
freemangordon*sure14:24
freemangordonI can do as well, if you give me the diff script14:24
Wizzupfreemangordon: shall we do that a bit later @ devel?15:11
Wizzupmaybe when you're back?15:11
freemangordonok15:11
KREYRENsicelo, for context nixos is heavily focused on reproducibility so ideally i need a way to flash the firmware and the internal storage in one go prior to system boot15:12
WizzupKREYREN: can you dd to the sd card?15:16
Wizzupor, how does this impact rperoducability?15:16
KREYRENWizzup, I can, but i want to be able to flash the internal storage as well for e.g. setup where the OS runs there and sdcard is used for swappable things15:18
* KREYREN wants to use the device for gaming15:18
KREYRENThe idea is kinda to get a bunch of very cheap sdcards and then place playstation and j2me games on them to swap them like it's nintendo ds with prints alike https://www.datart.cz/pametova-karta-sandisk-micro-sdxc-128gb-uhs-i-u3-v30-pro-nintendo-switch-100r-90w-sdsqxao-128g-gnczn.html tbh15:20
Wizzupyou can do this either using an os from the microsd card or if you prepare it correctly, using 0xffff, but I don't know how15:21
KREYREN0xffff can write to the internal storage?15:21
freemangordonyes15:21
KREYRENoh cool thanks15:21
freemangordon(IIRC)15:21
freemangordonKREYREN: see https://code.tools/man/1/0xFFFF/ , 'supported image types'15:24
freemangordon'mmc'15:24
KREYRENperfect, i can define a nixos-generator for this15:25
freemangordonbut, don't ask me how to create FIASCO image :)15:25
KREYRENis that what pali uboot uses to flash the uboot via 0xffff?15:26
freemangordonI don't think so as it is executed on device15:27
freemangordonand there we have flasher, iirc15:27
freemangordonunfortunately Pali did a rage-quit on everything FOSS a while ago, so we can't ask him :(15:28
KREYRENsad15:28
KREYRENis the uboot unmaintained for the device then?15:29
freemangordonyeah. still, FIASCO image format is well known, but not by me15:29
KREYRENwhat's fiasco15:29
freemangordonthey dropped n900 a while ago15:29
freemangordon"0xFFFF is the Open Free Fiasco Firmware Flasher for Maemo devices. It supports generating and unpacking FIASCO images."15:29
freemangordonhttps://github.com/pali/0xFFFF15:29
KREYRENoh15:30
freemangordonhttps://github.com/pali/0xFFFF/blob/master/doc/fiasco15:30
KREYRENi see15:30
KREYRENwhy did they ragequit15:33
Wizzupdisagreements with uboot maintainers15:33
KREYRENi see15:34
KREYRENso the uboot compat for the device is up for grabs? I am currently working on maintaining that for teres-i15:35
freemangordonI think they dropped n90015:36
freemangordonthey = upstream15:37
KREYRENhttps://github.com/u-boot/u-boot/blob/master/dts/upstream/src/arm/ti/omap/omap3-n900.dts it's still there15:37
KREYRENlast week relevant update15:37
freemangordonhmm15:37
freemangordonno idea then15:37
freemangordonbut yeah, nothing stops you from asking15:37
KREYRENHmm seems that the uboot support is implemented and they are merging linux kernel development on top of it15:38
KREYRENhttps://github.com/u-boot/u-boot/blob/master/dts/upstream/src/arm/ti/omap/omap3-n900.dts#L14-L2315:38
freemangordonhttps://github.com/u-boot/u-boot/tree/master/board15:38
freemangordonno nokia/rx51 I can see15:39
KREYRENhttps://github.com/u-boot/u-boot/tree/master/board/ti/omap3evm ?15:40
freemangordonthat's unrelated15:41
KREYRENwill look through it15:41
freemangordonsee https://github.com/ARM-software/u-boot/tree/master/board/nokia15:42
freemangordonthat's not in master15:42
KREYRENi see15:43
KREYRENthanks for info15:47
dsc_freemangordon: requestLeave() on a channel from conversations for leaving channels16:22
dsc_how is this picked up on the manager side of things?16:22
dsc_e.g telepathy-tank16:22
dsc_do you know?16:22
freemangordonno, sorry16:23
dsc_https://github.com/TelepathyIM/telepathy-qt/blob/188dece432d090809c5ad88a91cd573c5af61c09/TelepathyQt/channel.cpp#L184116:24
dsc_i dont know what signal to listen for16:24
freemangordonsorry, don;t have time now16:25
freemangordonin a week :)16:25
dsc_np :)16:26
dsc_I think I need to install a ChannelInterfaceGroupInterface16:26
dsc_then listen to MembersChanged16:26
dsc_will investigatge further16:26
Wizzupfreemangordon: with server.conf and client.conf I still have working omp after calls16:42
Wizzupwith 32mb16:43
arno11Wizzup: server.conf ? i guess you mean daemon.conf or ?17:15
arno11anyway if it works, that's great17:16
Wizzuparno11: daemon.conf and client.conf yes17:17
arno11ok17:21
freemangordonWizzup: when it bugs, it is clearly visible in syslog17:42
arno11Wizzup: sicelo: amazing...i did the shm changes after discovering that i'm able to record sound @8000Hz on N900 now.18:35
arno11and then calls work both ways @8000Hz now !!!18:35
arno11(with 2 small changes in cmtspeechdata)18:36
arno11(previously PA was crashing @8000Hz)18:40
arno11it even works @16000Hz but sound is distorded18:48
dsc_arno11: /usr/bin/maemo_kodi_remote exists now18:50
dsc_(after apt upgrade)18:52
arno11dsc_: cool will try this night18:52
dsc_i didnt test on n900 so not sure if it scales well, I did try to account for smaller screens though18:53
arno11ok18:53
arno11but @8000hz cpu usage is very high due to xorg burning 40%18:59
Wizzuparno11: shm changes being, decreasing the size?19:25
arno11yep i just tried 32MB atm19:26
arno11but really not sure it is directly related19:26
arno11but i can't explain why PA stopped crashing @8KHz (as you know it was a well known old issue)19:37
arno11sound is very good btw (as expected)19:39
freemangordonarno11: 32MB might be related with memory_overcommit precent19:45
freemangordon*percent19:45
arno11ok, btw do you think i should try a lower value ?19:47
freemangordonI am using 16MB on d4 for the last few hours19:49
arno11ok19:49
freemangordonbut, lets run different values for now19:49
freemangordonas we don't know what potential issues that could have19:49
arno11yep makes sense19:49
Wizzuphonestly even 16MB is quite a lot for 44.1khz19:56
arno11ok20:26
arno11Wizzup: with 32MB, already a big diff in emulators21:06
freemangordonWizzup: does this mean that you have an idea how this shared mem is used?21:41
WizzupI assumed data is put in it and played from pa21:43
Wizzupnot sure what else it would be used for for the most part21:43
Wizzupsince it still communicates over unix socket21:43
arno11well, sound through headset is also very good @8KHz now22:11
arno11let's try dsc's kodi remote now22:20
freemangordonWizzup: no, they said they communicate over shm22:21
Wizzuparno11: sweet @ better sound22:21
Wizzupfreemangordon: it says that unix socket is a requirement to use shm22:22
Wizzupiirc in the link you provided22:22
freemangordonbut it is used as a kind of mutex/semaphore/event22:22
freemangordonnot for data transfer22:22
freemangordonanyway, I think we can decrease shm size to somethign like 4MiB or somesuch22:23
freemangordonthis is still *lots of* data dammit22:24
freemangordonand if we see issues, well, can always increase22:24
arno11Wizzup: yes :)22:28
Wizzupfreemangordon: agree22:49
arno11dsc_: kodi gui is ok but can't connect to my kodi (both manual and auto)22:55
arno11*atm22:55
arno11i'll have a look tomorrow22:55
arno11rebooting with shm 4MB23:02
KREYRENarno11, hey got the tips? :p23:56

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!