You are not logged in.
I have Kodi (19.5-2) installed on an Intel NUC, with an external CD/DVD drive attached (LiteOn)
Audio CDs play correctly when "Load audio CD information from online service" is disabled, but when enabled, Kodi freezes completely, displaying a CDDB window saying "Fetching CD Information" with a static progress bar. The only way to escape is to kill all Kodi processes.
Other applications (Asunder, VLC etc) collect CD data correctly.
DVDs play correctly.
Internet access seems to be OK (BBC iPlayer works perfectly).
I have tried disabling the system firewall, and have created an advancedsettings.xml file specifying the cddb database explicitly.
Kodi.log does not appear to contain anything relevant.
I would be very grateful for any advice on how to find solution.
Last edited by myrlin (2023-02-07 16:40:39)
Offline
check whetehr kodi tries to reach freedb.org and make it use gnudb.gnudb.org
http://freedb.org/
In doubt try
# gnudb.gnudb.org
78.47.118.0 freedb.org
in your /etc/hosts
Offline
Unfortunately, adding freedb to /etc/hosts made no difference.
I have confirmed that I can ping the freedb (78.47.118.0) server.
So - I completely removed Kodi, then did a clean reinstallation, but still had the same problem.
I'm a bit perplexed, as an internet search shows few, if any, references to others having the same issue.
I wondered whether it was something specific to my system, so I then installed Kodi on another Intel NUC, and also on a Dell laptop, with the same result each time.
Any ideas would be most welcome.
Offline
https://kodi.wiki/view/Ripping_CDs suggests it's trying to use freedb
You could wireshark it to see what it's trying actually to talk to (whether it resolves the proper IP etc.)
Edit: nope, apparently they switched to gnudb, maybe you've an old entry in a local userdata/advancedsettings.xml ?
https://forum.kodi.tv/showthread.php?tid=355972
Can you
cd-info --cddb-server=gnudb.gnudb.org
?
Last edited by seth (2023-01-30 20:52:22)
Offline
Thank you for giving so much of your time to help me.
In reply to your question, here is the output of cd-info:
[username@intel ~]$ cd-info --cddb-server=gnudb.gnudb.org
cd-info version 2.1.0 x86_64-pc-linux-gnu
Copyright (c) 2003-2005, 2007-2008, 2011-2015, 2017 R. Bernstein
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
CD location : /dev/cdrom
CD driver name: GNU/Linux
access mode: IOCTL
Vendor : Slimtype
Model : eBAU108 6 L
Revision : PL0M
Hardware : CD-ROM or DVD
Can eject : Yes
Can close tray : Yes
Can disable manual eject : Yes
Can select juke-box disc : No
Can set drive speed : No
Can read multiple sessions (e.g. PhotoCD) : Yes
Can hard reset device : Yes
Reading....
Can read Mode 2 Form 1 : Yes
Can read Mode 2 Form 2 : Yes
Can read (S)VCD (i.e. Mode 2 Form 1/2) : Yes
Can read C2 Errors : Yes
Can read IRSC : Yes
Can read Media Channel Number (or UPC) : Yes
Can play audio : Yes
Can read CD-DA : Yes
Can read CD-R : Yes
Can read CD-RW : Yes
Can read DVD-ROM : Yes
Writing....
Can write CD-RW : Yes
Can write DVD-R : Yes
Can write DVD-RAM : No
Can write DVD-RW : No
Can write DVD+RW : No
__________________________________
Disc mode is listed as: CD-DA
CD-ROM Track List (1 - 9)
#: MSF LSN Type Green? Copy? Channels Premphasis?
1: 00:02:00 000000 audio false no 2 no
2: 05:36:18 025068 audio false no 2 no
3: 10:22:05 046505 audio false no 2 no
4: 16:41:53 074978 audio false no 2 no
5: 21:31:23 096698 audio false no 2 no
6: 25:45:30 115755 audio false no 2 no
7: 28:24:53 127703 audio false no 2 no
8: 32:49:00 147525 audio false no 2 no
9: 37:09:68 167093 audio false no 2 no
170: 41:31:00 186675 leadout (418 MB raw, 418 MB formatted)
Media Catalog Number (MCN): 7567826330207
Last CD Session LSN: 0
audio status: no status
volume level port 0: 255 (0..255) 100 (0..100)
volume level port 1: 255 (0..255) 100 (0..100)
volume level port 2: 0 (0..255) 0 (0..100)
volume level port 3: 0 (0..255) 0 (0..100)
__________________________________
CD Analysis Report
No CD-TEXT on Disc.
[username@intel ~]$
Again, it seems that the CDDB database has not been accessed. Could there be a hardware problem, or some missing software?
I can confirm that AsunderCD Ripper is grabbing data from gnudb correctly on this machine.
I can also confirm that I can "ping" 78.47.118.0, freedb.org and gnudb.gnudb.org successfully
All kodi-related folders were deleted before carrying out a clean install of Kodi, so it is unlikely that any old settings files exist. The other two machines used for test installations have never had Kodi in them, so, again, contamination is unlikely!
I have never used Wireshark, so it will take me a little time to work it out, but I'll give it a try.
Thanks again for your help, @Seth
Offline
Both of those should work_:
cddb_query -c off -s gnudb.gnudb.org read misc 0x920ef00b
cddb_query -c off -s gnudb.gnudb.org -p 8880 read misc 0x920ef00b
This will timeout
cddb_query -c off -s gnudb.gnudb.org -p 888 read misc 0x920ef00b
The problem is, likely, that apparently freedb ran on 888 and gnubd on port 8880.
Very smart decision
This was actually fixed for libcddb (which is why asunder now works), but idk whether kodi even uses that.
https://github.com/archlinux/svntogit-p … .org.patch
If there's no way to configure port or protocol of the query, you'll have to iptables-fix that or we'll need a downstream patch for kodi as well
Offline
Many thanks again for your patience.
I've a horrible feeling that I've opened a can of worms here!
cddb_query -c off -s gnudb.gnudb.org read misc 0x920ef00b
cddb_query -c off -s gnudb.gnudb.org -p 8880 read misc 0x920ef00b
cddb_query -c off -s gnudb.gnudb.org -p 888 read misc 0x920ef00b
all fail, with error message:
libcddb: error: ok
error: could not read disc data
I thought I'd try a different command, so tried
cddb_query sites
which failed with:
error: could not read sites data
I tried a different drive, but with the same results. Firewall is disabled.
So it looks like Kodi is not the culprit, but something much deeper is causing the problem.
Offline
error: could not read disc data
This should not even attempt to read the disc as you're passing an ID (0x920ef00b, it's in the manpage and does correctly resolve Massive Attack's Mezzanine from 1998 here)
Though "error: could not read disc data" seems generic because I also get that along "error: unknown host name" when passing a bogus server.
pacman -Qikk libcddb
Offline
Name : libcddb
Version : 1.3.2-7
Description : Library that implements the different protocols (CDDBP, HTTP,
SMTP) to access data on a CDDB server (https://gnudb.org)
Architecture : x86_64
URL : https://sourceforge.net/projects/libcddb/
Licenses : LGPL
Groups : None
Provides : None
Depends On : glibc
Optional Deps : None
Required By : asunder
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 156.35 KiB
Packager : Evangelos Foutras <foutrelis@archlinux.org>
Build Date : Fri 09 Dec 2022 07:42:29 GMT
Install Date : Mon 12 Dec 2022 10:52:30 GMT
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
libcddb: 21 total files, 0 altered files
Offline
That's fine…
cddb_query -c off -s gnudb.gnudb.org -p 8880 -l debug read misc 0x920ef00b
nb. "-l debug"
Offline
debug: cddb_read()
debug: cddb_cache_read()
debug: ...cache disabled
debug: cddb_connect()
debug: cddb_handshake()
debug: cddb_get_response_code()
debug: cddb_read_line()
debug: sock_fgets()
libcddb: error: ok
error: could not read disc data
Offline
Ok, you should™ be getting
…
debug: cddb_read_line()
debug: sock_fgets()
debug: ...read = '200 gnudb.org CDDBP server v1.0.0 ready at Wed, 01 Feb 2023 15:07:10 +0100
'
debug: ...[N] line = '200 gnudb.org CDDBP server v1.0.0 ready at Wed, 01 Feb 2023 15:07:10 +0100'
debug: ...code = 200 (gnudb.org CDDBP server v1.0.0 ready at Wed, 01 Feb 2023 15:07:10 +0100)
debug: cddb_send_cmd()
debug: sock_vfprintf()
debug: ...buf = 'cddb hello anonymous localhost libcddb 1.3.2'
…
200 is the status code for "OK", so that's fine - but libcddb somehow quits that as error.
For whatever reason.
Anything special about your libc? Broken locale maybe?
LC_ALL=C cddb_query -c off -s gnudb.gnudb.org -p 8880 -l debug read misc 0x920ef00b
You however mentioned that asunder works and asunder uses libcddb, so while the cddb_query issue is annoying and prevents this test (which was rather even meant to be a demonstration of the port issue) you should focus on configuring kodi to use gnudbb and port 8880.
Offline
Thank you again for spending so much time on this.
LC_ALL=C cddb_query -c off -s gnudb.gnudb.org -p 8880 -l debug read misc 0x920ef00b
gives exactly the same results as the previous post. There is a pause after "debug: sock_fgets()" before the error message. I don't know if that's significant.
I don't think there is anything special about my machine - I'm afraid that I don't have enough knowledge to dig too deep!
Also, I'm getting the same result from 3 different machines, so something broken on one seems unlikely. I'll carry on trying to get Kodi to work, and report any progress.
Many thanks once again for all your help and patience.
Offline
There is a pause after "debug: sock_fgets()"
How long?
char *sock_fgets(char *s, int size, cddb_conn_t *c)
{
int rv;
time_t now, end, timeout;
char *p = s;
cddb_log_debug("sock_fgets()");
timeout = c->timeout;
end = time(NULL) + timeout;
size--; /* save one for terminating null */
while (size) {
now = time(NULL);
timeout = end - now;
if (timeout <= 0) {
errno = ETIMEDOUT;
return NULL; /* time out */
}
/* can we read from the socket? */
if (!sock_can_read(c->socket, timeout)) {
/* error or time out */
return NULL;
}
/* read one byte */
rv = recv(c->socket, p, 1, 0);
if (rv == -1) {
/* recv() error */
return NULL;
} else if (rv == 0) {
/* EOS reached */
break;
} else if (*p == CHR_LF) {
/* EOL reached, stop reading */
p++;
break;
}
p++;
size--;
}
if (p == s) {
cddb_log_debug("...read = Empty");
return NULL;
}
*p = CHR_EOS;
cddb_log_debug("...read = '%s'", s);
return s;
}
int cddb_get_response_code(cddb_conn_t *c, char **msg)
{
char *line, *space;
int code, rv;
cddb_log_debug("cddb_get_response_code()");
line = cddb_read_line(c);
if (!line) {
if (cddb_errno(c) != CDDB_ERR_OK) {
cddb_errno_log_error(c, CDDB_ERR_UNEXPECTED_EOF);
}
return -1;
}
rv = sscanf(line, "%d", &code);
if (rv != 1) {
cddb_errno_log_error(c, CDDB_ERR_INVALID_RESPONSE);
return -1;
}
space = strchr(line, CHR_SPACE);
if (space == NULL) {
cddb_errno_log_error(c, CDDB_ERR_INVALID_RESPONSE);
return -1;
}
*msg = space + 1; /* message starts after space */
cddb_errno_set(c, CDDB_ERR_OK);
cddb_log_debug("...code = %d (%s)", code, *msg);
return code;
}
char *cddb_read_line(cddb_conn_t *c)
{
char *s;
cddb_log_debug("cddb_read_line()");
/* read line, possibly returning NULL */
if (c->cache_read) {
s = fgets(c->line, c->buf_size, cddb_cache_file(c));
} else {
s = sock_fgets(c->line, c->buf_size, c);
}
/* strip off any line-terminating characters */
if (s) {
s = s + strlen(s) - 1;
while ((s >= c->line) &&
((*s == CHR_CR) || (*s == CHR_LF))) {
*s = CHR_EOS;
s--;
}
} else {
return NULL;
}
cddb_errno_set(c, CDDB_ERR_OK);
cddb_log_debug("...[%c] line = '%s'", (c->cache_read ? 'C' : 'N'), c->line);
return c->line;
}
static int cddb_handshake(cddb_conn_t *c)
{
char *msg;
int code;
cddb_log_debug("cddb_handshake()");
/* check sign-on banner */
switch (code = cddb_get_response_code(c, &msg)) {
case -1:
return FALSE;
case 200: /* read/write */
case 201: /* read only */
break;
case 432:
case 433:
case 434:
cddb_errno_log_error(c, CDDB_ERR_PERMISSION_DENIED);
return FALSE;
}
/* send hello and check response */
if (!cddb_send_cmd(c, CMD_HELLO, c->user, c->hostname, c->cname, c->cversion)) {
return FALSE;
}
switch (code = cddb_get_response_code(c, &msg)) {
case -1:
return FALSE;
case 200: /* ok */
case 402: /* already shook hands */
break;
case 431:
cddb_errno_log_error(c, CDDB_ERR_PERMISSION_DENIED);
return FALSE;
}
/* set protocol level */
if (!cddb_send_cmd(c, CMD_PROTO, DEFAULT_PROTOCOL_VERSION)) {
return FALSE;
}
switch (code = cddb_get_response_code(c, &msg)) {
case -1:
return FALSE;
case 200: /* ok */
case 201: /* ok */
case 502: /* protocol already set */
break;
case 501: /* illegal protocol level */
/* ignore */
break;
}
cddb_errno_set(c, CDDB_ERR_OK);
return TRUE;
}
We don't make it to the debug outputs of sock_fgets, so it goes down in
if (timeout <= 0) {
errno = ETIMEDOUT;
return NULL; /* time out */
}
/* can we read from the socket? */
if (!sock_can_read(c->socket, timeout)) {
/* error or time out */
return NULL;
}
/* read one byte */
rv = recv(c->socket, p, 1, 0);
if (rv == -1) {
/* recv() error */
return NULL;
}
sock_can_read also operates on the timeout which by default is 10 seconds - if the delay is (much) shorter, you for some reason get a recv() error.
Sure about the firewall condition?
Offline
Apologies for the delay in posting a reply.
The delay is 10 seconds, so looks like a timeout.
I have checked Firewall settings and confirmed disabled state - I even temporarily disabled the router's internal fw for testing!
Referring back to Asunder (as a working "control") I notice that has "Use an HTTP Proxy to Connect to the Internet" checked. It is using proxy.gnudb.org (port 80). I don't know if this relevant.
I have several Virtual Machines installed, so thought I'd have a go at using them over the weekend to see what happens! I'll report back when I have some more information.
Offline
cddb_query -c off -P http -s gnudb.gnudb.org read misc 0x920ef00b # http instead of cddbp
http_proxy=http://proxy.gnudb.org cddb_query -c off -P proxy -s gnudb.gnudb.org read misc 0x920ef00b # use the proxy
Offline
FANTASTIC!!!
Both commands work!
Thank you SO much @Seth
Offline
We'll still need to fix kodi
But you're blocking cddbp, somewhere. … ?
Offline
Hmm.....
I can't work out what's blocking cddbp - my system is fairly standard with most packages from the main repos. Do you think I need to set up port forwarding in my router (4G)?
In the meantime, I have tried to use the Internet Access section of Kodi to set up an HTTP proxy, using info from the working test, I have tried various configurations, but without success. The "System Information" section only shows "Internet Connected" when the proxy is disabled
Thank you again for giving me so much help.
Offline
I need to set up port forwarding in my router
No. As long as your router or any other firewall doesn't actively block the port, it should™ be fine.
Compare
tracepath -b gnudb.gnudb.org
tracepath -bp 80 gnudb.gnudb.org
tracepath -bp 8880 gnudb.gnudb.org
and see where the last one dies where the former ones proceeded.
Forget about the proxy, that's not relevant (the direct htto connection to gnudb.gnudb.org worked)
You can try whether asunder still works if you
a) disable it
b) set the server to "gnudb.gnudb.org" and the port to "80" (asunder hopefully takes that as "use http, please")
Offline
Asunder performs exactly as predicted.
All "tracepath" commands produce the following identical response:
1?: [LOCALHOST] pmtu 1500
1: _gateway (192.168.1.1) 4.419ms
1: _gateway (192.168.1.1) 1.448ms
2: no reply
.
.
8: no reply
9: 195.66.227.169 (195.66.227.169) 186.142ms asymm 11
10: 195.66.227.209 (195.66.227.209) 72.529ms asymm 11
11: core6.par.hetzner.com (213.239.252.169) 68.693ms
12: 213-239-245-213.clients.your-server.de (213.239.245.213) 94.119ms
13: core23.fsn1.hetzner.com (213.239.245.226) 94.513ms
14: spine1.cloud2.fsn1.hetzner.com (213.239.239.126) 99.585ms
15: no reply
16: 18801.your-cloud.host (162.55.112.188) 140.829ms
17: no reply
.
.
30: no reply
Too many hops: pmtu 1500
Resume: pmtu 1500
Offline
That's the correct trace, so why does the cddbp request time out…
Before we waste too much time on this, you should wireshark kodi and see whether
a) it's trying to reach gnudb anyway
b) on which port
Because as long as it's using 888, there's no kodi-specific solution but a patch (for the discontinued module) or an iptables entry.
If it's however operating on port 80, there's a different problem.
You can btw. control the server, unfortunately apparently not the protocol, https://kodi.wiki/view/Advancedsettings.xml#cddbaddress
And it seems it's defaulting to gnudb anyway, https://github.com/xbmc/xbmc/pull/18193 … 2e9263e6d7
Offline
I quite agree. You have already spent an enormous amount of time providing me with support, for which I am extremely grateful.
I am happy to "park" the Kodi issue for now, but I am mystified that cddbp requests time out, even for cddb_query requests, and on three different machines. If I could solve this issue, the Kodi problem may well solve itself.
I'll keep trying, and report any developments
Thank you again for all your help, @Seth
Offline
Can you move one of the machines into a different network (ie. it's a laptop and you take it to some friend)?
http://www.knopper.net/knoppix-info/index-en.html ships libcddb, on both versions (CD and DVD) so you could test that sw stack on your LAN as well.
Offline
Yes - I will try both, but it may take a couple of days (I live in the "sticks")!!
I will post again when I get some results.
Offline