No sound on linux [32 bit Slimjet] (Solved)

General discussion about Slimjet, or other issues related to web browser in general.
michael-hi
Posts: 2
Joined: Mon Aug 19, 2019 10:26 am

Re: No sound on linux [32 bit Slimjet] (partly Solved)

Post by michael-hi » Mon Aug 19, 2019 1:47 pm

Strange. I just tried Jango and got sound. Couldn't get anything on iHeartRadio but that's probably because I'm in a different country. The pages were mostly blank. It doesn't work for me on Firefox either.

For what it's worth, I have Slimjet version 23.0.10.0 and the libffmpeg.so file that I'm using is the topmost one (0.39.2) on this page:
https://github.com/iteufel/nwjs-ffmpeg- ... t/releases

That webpage is one that Slimjet themselves point to in this info:
https://www.slimjet.com/en/libffmpeg.php

I believe this replaced an earlier version of the document which linked to an Ubuntu repository instead. But, as I say, I am using 0.39.2 rather than the 0.37.4 version mentioned in their text. I don't know if that makes any difference.

Edited to correct second link
Last edited by michael-hi on Tue Aug 20, 2019 2:21 am, edited 1 time in total.

sleeper10
Posts: 350
Joined: Thu Jun 23, 2016 7:34 pm

Re: No sound on linux [32 bit Slimjet] (partly Solved)

Post by sleeper10 » Mon Aug 19, 2019 7:13 pm

I know, it's all quite confusing. I'm on Linux Mint 18, with the latest Slimjet. I tried all the libffmpegs within reason. Slimjet won't even open for me with the ones you mentioned. I'm using one from a previous Slimjet version, not even sure which one it is now. So, lots of variables here which is probably why I don't get sound everywhere.

1mabloom
Posts: 2
Joined: Thu Aug 22, 2019 10:38 am

Re: No sound on linux [32 bit Slimjet] (partly Solved)

Post by 1mabloom » Fri Aug 23, 2019 12:23 pm

It took quite a bit of experimentation with the slimjet wrapper to be able to get slimjet running under ltrace, but when I finally got that working, I saw the following elaboration of the "socket(): Operation not permitted" message :

Code: Select all

[pid 24918] libpulsecommon-8.0.so->socket(1, 0x80001 , 0) = -1
This is an invocation of the socket() system call being made from within libpulsecommon.so.
I'm not sure what it's trying to do. I searched to try to find the meaning of the 0x80001 bit pattern and did not find it. While the "1" bit" is almost certainly SOCK_STREAM, it's unclear what the 0x80000 bit is intended to be. Not being defined anywhere might be a good justification for an "socket(): Operation not permitted" message.

That the 64bit version of slimjet works just fine tells us it is likely that the slimjet code that tries to initialize pulseaudio has a 64-bit assumption at or shortly prior to a call it had made to initialize the library.

Potentially, any one of us could have fixed this ages ago if we had access to flashpeak's modifications to the chromium sources, but here we are depending on someone delivering the tease of 32 bit slimjet without promising to actually make it work.

It is WAY too crappy that chromium hadn't been released under an open source license that requires releasing modified sources. This browser derivation provides the perfect argument for the importance of having a GNU style license !

Here's something to try for someone who has time: Download a copy of "unstrip" to make a copy of /opt/slimjet/slimjet that has a symbol table built up from the relocation information.
Then in a copy of the slimjet wrapper, replace the line reading

Code: Select all

exec -a "$0" "$HERE/slimjet" "$@
with lines reading something like:

Code: Select all

echo "$@" > /tmp/args
 gdb   $HERE/<your copy of slimjet>
Once in gdb, set the program args to what's in /tmp/args, but change argv[0] to 69flashpeak-slimjet or something that will compare past the first 2 characters against the value slimjet sees when doing a readlink on /proc/self/exe. The comparison has to be a successful match, otherwise you'll quickly be told to use the slimjet wrapper, even though you are already using the slimjet wrapper.( Reading the preceding words should give you an idea of what it took to find out where that "Operation not permitted" message came from).
If you can find where that 0x80001 is coming from, a binary patch to change it to 0x1 might be all that is needed to get slimjet working with pulseaudio without having to bypass it.

P.S. If you are on a Debian based system that uses their "alternatives" system, that same readlink will prevent you from being able to invoke slimjet from Thunderbird (which invokes the x-www-browser symlink to the chosen browser). There are two possible workarounds: One is to replace -a "$0" with -a 69flashpeak-slimjet, but a cleaner approach would be to replace the flashpeak-slimjet symlink in /usr/bin with the following 3-line shell script:

Code: Select all

#!/bin/sh
/opt/slimjet/flashpeak-slimjet "$@"
exit 0
I had sent a bug report about this twice, with no acknowledgement, for two successive releases preceding the current release. Maybe it's best for people to start tearing apart the binary to fix things themselves.

sleeper10
Posts: 350
Joined: Thu Jun 23, 2016 7:34 pm

Re: No sound on linux [32 bit Slimjet] (Solved)

Post by sleeper10 » Tue Sep 03, 2019 9:01 pm

It turns out that my sound was blocked by extensions on iHeartRadio & Jango. So, now that I seem to have sound everywhere, I marked this as Solved.

1mabloom
Posts: 2
Joined: Thu Aug 22, 2019 10:38 am

Re: No sound on linux [32 bit Slimjet] (Solved)

Post by 1mabloom » Mon Sep 09, 2019 6:57 pm

sleeper10 wrote:
Tue Sep 03, 2019 9:01 pm
It turns out that my sound was blocked by extensions on iHeartRadio & Jango. So, now that I seem to have sound everywhere, I marked this as Solved.
On the basis of your post, I removed all extensions. Still no sound in slimjet, on my system, though.

I think you may have lucked out, in having the symptom being caused by an action taken by an extension, rather than being due to being on a system in which the symptom is (likely) due to slimjet doing something, not done by other programs, that causes libpulsecommon to issue a call to socket(domain,type,protocol) that fails due to having the 0x80000 bit being set in socket's type argument(producing a "socket(): Operation not permitted" error message).

Likely, this can be a problem on a system in which use of that bit value in the type argument is not supported (that includes my Mint 18.1 system), but in which it is possible for the version of libpulsecommon supplied with the system to set that bit on the socket() call.

If I can find some free time, I will try substituting the C library's wrapper for the socket call with one that strips that bit out before invoking the actual socket system call. This may be done by writing a small one-function library that contains a private definition of socket() which makes use of the syscall() function (see man syscall). One would compile this for position independent code (-fPIC in gcc) and link it as a shared library.
The command

Code: Select all

gcc -fPIC -shared -c mysocket.c -Wall -o mysocket.so
should accomplish both the compile and link.
Afterward, it would just be necessary to make the replacement available to slimjet by setting
export LD_PRELOAD=/path/to/mysocket.so
followed by manual invocation of /usr/bin/flashpeak-slimjet
(or from a menu:

Code: Select all

LD_PRELOAD=/path/to/mysocket.so /usr/bin/flashpeak-slimjet
as a single command.)

The only problems I could foresee running into might be 32 bit dependencies, given that while the syscall() function is generic and does not know about argument sizes, the default wrappers for individual syscalls do have such knowledge and could perform undocumented conversions that might need to be emulated in order to correctly get one's arguments into the kernel when using the syscall() function. If it doesn't work first time off, it might be necessary to disassemble the default wrapper for socket() in the C library (to examine the function prologue and the code path used for passing the actual arguments to the kernel). With any luck, that wouldn't be necessary, though.
-----------------------------------------------------
First update:
I tried the replacement for the socket() call. The "socket(): Operation not permitted " error message is now gone, but I fear I may have run into the problem suggested in my previous paragraph, as Slimjet is now blocking in a poll() call and proceeding to bring up a window. It will take some examination.

I could not find a definition for the 0x80000 bit in headers on my 32 bit Mint 18 system. Could someone with a different system check to see if that bit is defined for being or'ed in to the type argument for socket() on your machine? - thanks

sleeper10
Posts: 350
Joined: Thu Jun 23, 2016 7:34 pm

Re: No sound on linux [32 bit Slimjet] (Solved)

Post by sleeper10 » Mon Sep 09, 2019 8:45 pm

You don't get sound anywhere with this command?:

Code: Select all

 pasuspender -- /usr/bin/flashpeak-slimjet --alsa-output-device=hw:0,0 
That's odd because on Mint 18 Mate 32 bit, I got sound most everywhere even with extensions. Only a few sites were blocked by an extension. Try it in incognito mode & see if that makes any difference. Also, you might try the command with hw:1,0. If none of that helps, I don't know. I just know it works for me.

Post Reply