Subject: Text garbage on audacious modinfo window

From: Joker
Date: Thu Apr 20 20:58:01 2006

To: UADE-Developer-discussion
The listview of the songinfo window (the one which shows up when pressing
the &quot;Info&quot; button) displays overlapping text.

Example: 
http://www.netswarm.net/screenshots/audacious-uade-modinfo.png

I also expirienced some segfaults after i had this window open. If fixing
the text output doesn't help, i guess i'll have to rebuild all stuff with
debug etc.

---

From: mld/uade team
Date: Thu Apr 20 22:22:46 2006

To: UADE-Developer-discussion
hmmh, can't confirm this bug, displays fine here ...

Maybe a GTK2 Bug or locale? Distro, GTK2 version? Any other mod where it happens?

---

From: mld/uade team
Date: Thu Apr 20 23:23:18 2006

To: UADE-Developer-discussion
it seems in the places where the output was garbled a \t (tab) was used for alignement. That might be the cause of the problem...

I replaced now all tab stops in modinfo with white spaces. Please check out CVS and report back if it fixed your problem.

---

From: Joker
Date: Fri Apr 21 00:40:13 2006

To: UADE-Developer-discussion
It looks good now. I just get tonnes of the following messages when
opening or scrolling the listviews:

(audacious:7309): Gdk-CRITICAL **: gdk_text_width: assertion `font != NULL' failed

And i think my crash is not related to this. I get the crash when UADE
is not playing any file(Stop state or playing mp3/ogg/dumb) and i open
&quot;View File Info&quot; on a MOD.
While UADE is playing something, the MODInfo window opens without
segfaults.

---

From: mld/uade team
Date: Fri Apr 21 09:15:20 2006

To: UADE-Developer-discussion
sounds like a null pointer... I'll check into this

---

From: shd
Date: Fri Apr 21 10:16:44 2006

To: UADE-Developer-discussion
[quote:5479a6af1c="mld/uade team"]sounds like a null pointer... I'll check into this[/quote:5479a6af1c]

Yes. Happens with XMMS too. When a song is not being played, uadesong is not initialized. I never tested these features without playing something in the background so no wonder I never catched this bug ;)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1213388000 (LWP 5407)]
0xb71b8403 in uade_get_cur_subsong (def=0) at plugin.c:212
212         subsong = uadesong-&gt;cur_subsong;

---

From: mld/uade team
Date: Fri Apr 21 10:24:04 2006

To: UADE-Developer-discussion
heh, you were just a tiny bit faster than me... Just fixed it for audacious by adding a sanity check if uadesong == NULL in get_*_subsong (min,cur, max)

seems to work

---

From: shd
Date: Fri Apr 21 10:30:19 2006

To: UADE-Developer-discussion
[quote:56565522c9="mld/uade team"]heh, you were just a tiny bit faster than me... Just fixed it for audacious by adding a sanity check if uadesong == NULL in get_*_subsong (min,cur, max)

seems to work[/quote:56565522c9]

You were faster with Audacious plugin, I got an up-to-date conflict when committing.

I fixed your fix btw. There was a potential race condition:
[code:1:56565522c9]
 if &#40;uadesong != NULL&#41;
   foo&#40;&#41;;
 lock&#40;&#41;;
 subsong = uadesong-&gt;cur_subsong;
 unlock;
[/code:1:56565522c9]

uadesong might (in theory) become NULL after the first check. I have to see our locking code again, but this should be safer in the long run.

---

From: mld/uade team
Date: Fri Apr 21 10:37:54 2006

To: UADE-Developer-discussion
:-) yeah, didn't thought about uadesong getting NULL after the check.

BTW, Joker could you test if you get any more gdk_* errors and if the font ist still fixed width? I removed the (bogus?) gtk style now from modinfo.

---

From: shd
Date: Fri Apr 21 10:47:29 2006

To: UADE-Developer-discussion
[quote:303d07c98f="mld/uade team"]:-) yeah, didn't thought about uadesong getting NULL after the check.
[/quote:303d07c98f]

I added locking to aud/xmms plugins to each place where uadesong is set to NULL.

There's another bug btw. Getting file info always gets subsongs from the currently playing song rather than the real file. The fundamental bug is that file info uses uadesong which is not necessarily related.

We should somehow synchronize and limit the information that GUI code can access. Maybe some lock/copy semantics. When GUI info is opened, uade_lock() is called, and relevant structures are copied and passed to info code.

---

From: Joker
Date: Fri Apr 21 13:40:44 2006

To: UADE-Developer-discussion
The good:
Audacous plugin runs now stable and doesn't crash anymore.

The bad:
The gdk messages are still present:
(audacious:15236): Gdk-CRITICAL **: gdk_text_width: assertion `font != NULL' failed

... and the ugly:
There are minor glitches left from the crash fix. Values which you
can only get when playing a module are &quot;sticky&quot; when you info
a different module than the one you're playing.

For example you'll see:
--------------------------------------
Module: condom_corruption
            (ChineseDream.MOD)
--------------------------------------
Or:
--------------------------------------
Module: Wispers.MOD

Playerformat: TFMX Pro

Curr. subsong:   1
Min. subsong:     0
Max. subsong:   21
--------------------------------------

While this cannot be fully changed since you need the player
active to optain the information. I suggest a check for
&quot;info window file&quot; != &quot;playing file&quot; and then empty some strings
delete some widgets or/and ghost the &quot;?&quot; button.

The audacious-dumb plugin does somthing similar when it doesn't
have some information. For example theres no &quot;message&quot; in an
old MOD. It does gtk_notebook_remove_page() if thats the case.
Since uade isn't glade you maybe can avoid the widgets at creation
time.

However thats purly cosmetic and not that important. It just confused
me when i saw it first.

---

From: Joker
Date: Fri Apr 21 13:43:23 2006

To: UADE-Developer-discussion
Argh i should also have read shds comment which already mentions the different info. 
Sorry, i didn't sleep well enough.

---

From: Joker
Date: Tue May 9 19:41:22 2006

To: UADE-Developer-discussion
When i mark text (keep button pressed an move the mouse around)
It messes up the text like mad. I can provide screenshots if you can't
reproduce it.

---

From: Guest
Date: Tue May 9 19:54:36 2006

To: UADE-Developer-discussion
just upgraded to gtk 2.8  and can confirm that issue, now... Odd... 2.6 didn't had that...

I'll see if I can fix it.

mld

---

From: mld/uade team
Date: Fri May 12 00:38:29 2006

To: UADE-Developer-discussion
seems to be a gtk2.8 bug... Some other people complained about the same things you reported here:
http://forums.gentoo.org/viewtopic-t-393284-highlight-gtk+fonts.

I'm not sure how to fix it atm. It *was* working all right on 2.6.10 iirc. If anyone has a suggestion, speak up :-)

---

From: mld
Date: Fri May 12 12:45:21 2006

To: UADE-Developer-discussion
I seem to have found the problem. They broke the legacy font and text handling in gtk+-2.8.*. Since I already planned to get rid of the GTK_BROKEN define, it was a good reason to get going.

Rewriting the font setting and textprinting to the gtk2 style an old beepmp problem reappeared when sometimes the modinfo remained empty 

It seems gtk2 doesn't like non UTF-8 texts, so g_convert is used to get non ascii and amiga locale characters to be displayed/replaced.

ok, hope it works now. I'm off for the weekend, so anything has to wait to monday now :-)

Michael