Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Aqualung player does not start (solved)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Sat Aug 26, 2023 10:42 am    Post subject: Aqualung player does not start (solved) Reply with quote

I'm on the search for a gapless audioplayer that supports Jack and came across Aqualung. It is supposed to do that and is available in Portage.

So I emerged Aqualung and it emerged without any warnings or errors. So I wanted to start it. Nothing happens. So I tried starting it from a terminal and got this:

Code:
ikke@daw /usr/bin $ ./aqualung
Creating directory /home/ikke/.config/aqualung
cannot create config directory: mkdir: File exists


Same if I try this as root.

But when I look at /home/ikke/.config/aqualung:
Code:
ikke@daw ~/.config $ ls aqua*
ls: cannot access 'aqua*': No such file or directory


So it wants to create a directory, mkdir replies that the file already exists and ls cannot find anything. Someone got an idea what is going on?
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Sat Aug 26, 2023 12:07 pm    Post subject: Reply with quote

Ok, found a way to get it started. I had to create the folder /home/ikke/.config/aqualung myself. Then it starts. Bit strange why you have to create it yourself. Permissions?

A bit of a strange interface but that will be getting used to it I guess.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21644

PostPosted: Sat Aug 26, 2023 3:17 pm    Post subject: Re: Aqualung player does not start (solved) Reply with quote

Spanik wrote:
Code:
ikke@daw /usr/bin $ ./aqualung
Creating directory /home/ikke/.config/aqualung
cannot create config directory: mkdir: File exists
This may be complaining that ~/.config exists, and aqualung expected to be the one to create it. This is a bug, in my opinion. It is rare that the failure of mkdir with the error EEXIST should be an error, and especially so when trying to create a directory that is shared among many programs. strace before you got aqualung functioning might have been informative. It will probably not show anything noteworthy now.
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Sat Aug 26, 2023 3:30 pm    Post subject: Reply with quote

I just deleted ~/.config/aqualung and emerged strace. Nothing lost, I hadn't configured anything yet in aqualung. After deleting that directory aqualung refused to start. So I ran strace (I only copied the last part):
Code:
futex(0x7f9517ad7800, FUTEX_WAKE_PRIVATE, 2147483647) = 0
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=3733456, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 3733456, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9511998000
close(3)                                = 0
newfstatat(AT_FDCWD, "/home/ikke/.config/aqualung", 0x7ffc8db5aa30, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/ikke/.aqualung", 0x7ffc8db5aa30, 0) = -1 ENOENT (No such file or directory)
getcwd("/usr/bin", 1024)                = 9
chdir("/home/ikke/.config/aqualung")    = -1 ENOENT (No such file or directory)
write(2, "Creating directory /home/ikke/.c"..., 47Creating directory /home/ikke/.config/aqualung
) = 47
mkdir("/home/ikke/.config", 0700)       = -1 EEXIST (File exists)
mkdir("/home/ikke/.config", 0700)       = -1 EEXIST (File exists)
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=2998, ...}, AT_EMPTY_PATH) = 0
read(3, "# Locale name alias data base.\n#"..., 4096) = 2998
read(3, "", 4096)                       = 0
close(3)                                = 0
openat(AT_FDCWD, "/usr/share/locale/en_IE.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_IE.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_IE/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "cannot create config directory: "..., 51cannot create config directory: mkdir: File exists
) = 51
exit_group(1)                           = ?
+++ exited with 1 +++
ikke@daw /usr/bin $


This confirms your suspicions?
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21644

PostPosted: Sat Aug 26, 2023 4:10 pm    Post subject: Reply with quote

Spanik wrote:
This confirms your suspicions?
Yes:
Spanik wrote:
Code:
chdir("/home/ikke/.config/aqualung")    = -1 ENOENT (No such file or directory)
write(2, "Creating directory /home/ikke/.c"..., 47Creating directory /home/ikke/.config/aqualung
) = 47
mkdir("/home/ikke/.config", 0700)       = -1 EEXIST (File exists)
mkdir("/home/ikke/.config", 0700)       = -1 EEXIST (File exists)
It tried to enter the application-specific directory, and failed. It tried to create the outer directory, received EEXIST because ~/.config exists, and treated that as an error. I am unclear why it tried twice to create the upper directory. This looks to me like an upstream bug.
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 812

PostPosted: Sat Aug 26, 2023 5:34 pm    Post subject: Reply with quote

This seems to be a bug, looking at the code for aqualung 1.1 in file src/core.c lines 1908-1916:
Code:

        if (chdir(options.confdir) != 0) {
                if (errno == ENOENT) {
                        fprintf(stderr, "Creating directory %s\n", options.confdir);
                        /* Try creating .config before .config/aqualung */
                        mkdir(dirname(options.confdir), S_IRUSR | S_IWUSR | S_IXUSR);
                        if (mkdir(options.confdir, S_IRUSR | S_IWUSR | S_IXUSR) < 0) {
                                perror("cannot create config directory: mkdir");
                                exit(1);
                        }

The intention seems to be to cd to options.confdir, and if that fails it tries to create it's parent directory (.config) first and ignore the result, and try to create options.confdir.
I guess they missed an important line in the dirname(3) manual:
Code:

       Both dirname() and basename() may modify the contents of  path,  so  it
       may be desirable to pass a copy when calling one of these functions.

So it's dirname in the first mkdir that changes the path and makes the second mkdir fail because .config already exists.

In aqualung 1.2 (also in portage but masked) this bug is solved, src/core.c lines 1909-1923:
Code:

        if (chdir(options.confdir) != 0) {
                if (errno == ENOENT) {
                        fprintf(stderr, "Creating directory %s\n", options.confdir);
                        /* Try creating .config before .config/aqualung */
                        config_dir = strdup(options.confdir);
                        if (!config_dir) {
                                perror("strdup failed");
                                exit(1);
                        }
                        mkdir(dirname(config_dir), S_IRUSR | S_IWUSR | S_IXUSR);
                        free(config_dir);
                        if (mkdir(options.confdir, S_IRUSR | S_IWUSR | S_IXUSR) < 0) {
                                perror("cannot create config directory: mkdir");
                                exit(1);
                        }

I don't know the reason why it's masked but it might be worth a try.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Sun Aug 27, 2023 7:20 pm    Post subject: Reply with quote

pa4wdh wrote:
In aqualung 1.2 (also in portage but masked) this bug is solved, src/core.c lines 1909-1923:
Code:

        if (chdir(options.confdir) != 0) {
                if (errno == ENOENT) {
                        fprintf(stderr, "Creating directory %s\n", options.confdir);
                        /* Try creating .config before .config/aqualung */
                        config_dir = strdup(options.confdir);
                        if (!config_dir) {
                                perror("strdup failed");
                                exit(1);
                        }
                        mkdir(dirname(config_dir), S_IRUSR | S_IWUSR | S_IXUSR);
                        free(config_dir);
                        if (mkdir(options.confdir, S_IRUSR | S_IWUSR | S_IXUSR) < 0) {
                                perror("cannot create config directory: mkdir");
                                exit(1);
                        }

I don't know the reason why it's masked but it might be worth a try.

Today I went to look for the 1.2 version and it wasn't masked anymore. So I updated my version. Deleted the ~/.config/aqualung directory like before. And it starts the first time straight away. So it looks like the 1.2 version is the way to go.

Thanks you all.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum