No sound in mnemosyne

147 views
Skip to first unread message

Francesco Ariis

unread,
Jun 2, 2015, 3:03:34 PM6/2/15
to mnemosyne-...@googlegroups.com
Hello,
I recently filed a bug on Debian regarding mnemosyne [1] (tl;dr:
mnemosyne doesn't play sounds).

Is there anything I can do to help the maintainer diagnosing this?
I started mnemosyne from the command line but there are no errors/
warnings and even the --debug file is empty.


[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=787442

Gwern Branwen

unread,
Jun 2, 2015, 3:38:09 PM6/2/15
to Mnemosyne mailing list
On Tue, Jun 2, 2015 at 3:00 PM, Francesco Ariis <fa...@ariis.it> wrote:
> I recently filed a bug on Debian regarding mnemosyne [1] (tl;dr:
> mnemosyne doesn't play sounds).
>
> Is there anything I can do to help the maintainer diagnosing this?

You could try systrace: '$ strace /usr/bin/mnemosyne'. That might turn
up a relevant error.

I have occasional sound troubles on Debian too. What happens is that
it seems some other audio-using program, such as Flash for Youtube
somehow 'steals' or 'locks' audio, and only once it is done such as by
closing it, will I again hear sounds from Mnemosyne. Could there be
something running which does that?

--
gwern
http://www.gwern.net

Francesco Ariis

unread,
Jun 2, 2015, 5:54:38 PM6/2/15
to Mnemosyne mailing list
On Tue, Jun 02, 2015 at 03:37:48PM -0400, Gwern Branwen wrote:
> You could try systrace: '$ strace /usr/bin/mnemosyne'. That might turn
> up a relevant error.
>
> I have occasional sound troubles on Debian too. What happens is that
> it seems some other audio-using program, such as Flash for Youtube
> somehow 'steals' or 'locks' audio, and only once it is done such as by
> closing it, will I again hear sounds from Mnemosyne. Could there be
> something running which does that?

Hello Gwern, thanks for the tips.

I logged-off/in again and ran mnemosyne before any other application (I
don't have a DE, so after starting X+xmonad): still no sound.

I don't see errors on strace output (but it's the first time I have
ever run it so probably I am missing much; I attach a small portion
of the systrace, when mnemosyne tries to open the audio file).

I see that mnemosyne depends on "python, python-qt4, python-qt4-sql,
python-matplotlib, python-cherrypy3, libicu52, libqt4-sql-sqlite".
Which of these package is used to output sound? I guess qt4?
Maybe I can try similar apps using that package and see if it's
something broken in the dependencies.


trace

Peter Bienstman

unread,
Jun 3, 2015, 2:38:02 AM6/3/15
to mnemosyne-...@googlegroups.com
Hi,

It's indeed Qt that takes care of sound playing.

Cheers,

Peter
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mnemosyne-proj-u...@googlegroups.com.
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-
> users/20150602215106.GA10772%40casa.casa.
> For more options, visit https://groups.google.com/d/optout.

Francesco Ariis

unread,
Jun 3, 2015, 11:13:01 AM6/3/15
to mnemosyne-...@googlegroups.com
On Wed, Jun 03, 2015 at 08:37:50AM +0200, Peter Bienstman wrote:
> Hi,
>
> It's indeed Qt that takes care of sound playing.

Sad but true, Qt4 on debian (and derivatives, I think) doesn't work with
Alsa [1]; I opened a thread on debian-users [2] to check whether there are
any workarounds.

If mnemosyne could (optionally) rely backends error it would be awesome
for debugging purposes.


[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=740451
[2] https://lists.debian.org/debian-user/2015/06/msg00095.html

Peter Bienstman

unread,
Jun 4, 2015, 3:21:06 AM6/4/15
to mnemosyne-...@googlegroups.com
Hi,

As a fallback, you can rely on playing audio through mplayer.

In pyqt_ui/pyqt_render_chain.py, you find:

class PyQtRenderChain(RenderChain):

id = "default"

if sys.platform == "win32":
filters = [Latex, EscapeToHtml, ExpandPaths, MplayerAudio,
MplayerVideo, RTLHandler, NonLatinFontSizeIncrease]
else:
filters = [Latex, EscapeToHtml, ExpandPaths, Html5Audio,
Html5Video, RTLHandler, NonLatinFontSizeIncrease]

renderers = [HtmlCss]

Just replace 'if sys.platform == "win32":' by 'if True:'.

Cheers,

Peter

> -----Original Message-----
> From: mnemosyne-...@googlegroups.com [mailto:mnemosyne-
> proj-...@googlegroups.com] On Behalf Of Francesco Ariis
> Sent: 03 June 2015 17:09
> To: mnemosyne-...@googlegroups.com
> Subject: Re: [mnemosyne-proj-users] No sound in mnemosyne
>
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mnemosyne-proj-u...@googlegroups.com.
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-
> users/20150603150926.GA15285%40casa.casa.

Francesco Ariis

unread,
Jun 4, 2015, 6:56:23 AM6/4/15
to mnemosyne-...@googlegroups.com
On Thu, Jun 04, 2015 at 09:20:53AM +0200, Peter Bienstman wrote:
> Hi,
>
> As a fallback, you can rely on playing audio through mplayer.
>
> In pyqt_ui/pyqt_render_chain.py, you find:
>
> class PyQtRenderChain(RenderChain):
>
> id = "default"
>
> if sys.platform == "win32":
> filters = [Latex, EscapeToHtml, ExpandPaths, MplayerAudio,
> MplayerVideo, RTLHandler, NonLatinFontSizeIncrease]
> else:
> filters = [Latex, EscapeToHtml, ExpandPaths, Html5Audio,
> Html5Video, RTLHandler, NonLatinFontSizeIncrease]
>
> renderers = [HtmlCss]
>
> Just replace 'if sys.platform == "win32":' by 'if True:'.

Hello Peter,
I tried replacing the offending line and running mnemosyne, receiving
a `NameError: `MplayerAudio' is not defined`.
I tried to modify line 17 in a similar way and this time got a
`'module' object has no attribute 'STARTUPINFO'`.

I attach a .jpg with both complete errors.
arr.jpg

Peter Bienstman

unread,
Jun 4, 2015, 8:04:00 AM6/4/15
to mnemosyne-...@googlegroups.com
Yeah, you also needed to change line 17 in a similar way, that's right.

As for the startup info related error, I seem to recall that the procedure to call external programs in Python also had some platform specific stuff, so it could be that it does not work out of the box.

Unfortunately, I no longer have access to a linux development machine, but I think you need to remove 'info = subprocess.STARTUPINFO()' from mplayer_audio.py and all references to it.

Cheers,

Peter

> -----Original Message-----
> From: mnemosyne-...@googlegroups.com [mailto:mnemosyne-
> proj-...@googlegroups.com] On Behalf Of Francesco Ariis
> Sent: 04 June 2015 12:53
> To: mnemosyne-...@googlegroups.com
> Subject: Re: [mnemosyne-proj-users] No sound in mnemosyne
>
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mnemosyne-proj-u...@googlegroups.com.
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-
> users/20150604105241.GA2681%40casa.casa.

Francesco Ariis

unread,
Jun 4, 2015, 10:59:45 AM6/4/15
to mnemosyne-...@googlegroups.com
On Thu, Jun 04, 2015 at 02:03:58PM +0200, Peter Bienstman wrote:
> Yeah, you also needed to change line 17 in a similar way, that's right.
>
> As for the startup info related error, I seem to recall that the procedure to call external programs in Python also had some platform specific stuff, so it could be that it does not work out of the box.
>
> Unfortunately, I no longer have access to a linux development machine, but I think you need to remove 'info = subprocess.STARTUPINFO()' from mplayer_audio.py and all references to it.
>
> Cheers,
>
> Peter

Thanks Peter,
you have been extremely helpful! There was some more tweaking
to do, so I attach 3 .diffs with the changes made. For debian and
derivatives users, the relevant folder where to apply the patches is

/usr/lib/python2.7/dist-packages/mnemosyne/pyqt_ui/

-F
mplayer_audio.py.diff
mplayer_video.py.diff
pyqt_render_chain.py.diff

Peter Bienstman

unread,
Jun 4, 2015, 11:00:43 AM6/4/15
to mnemosyne-...@googlegroups.com
OK, thanks for sharing these diffs for future users.

Hopefully Debian is able to fix the Qt bug soon.

Cheers,

Peter

> -----Original Message-----
> From: mnemosyne-...@googlegroups.com [mailto:mnemosyne-
> proj-...@googlegroups.com] On Behalf Of Francesco Ariis
> Sent: 04 June 2015 16:56
> To: mnemosyne-...@googlegroups.com
> Subject: Re: [mnemosyne-proj-users] No sound in mnemosyne
>
> --
> You received this message because you are subscribed to the Google Groups
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mnemosyne-proj-u...@googlegroups.com.
> To post to this group, send email to mnemosyne-proj-
> us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mnemosyne-proj-
> users/20150604145610.GA7930%40casa.casa.

juergen....@t-online.de

unread,
Jul 3, 2017, 11:18:54 AM7/3/17
to mnemosyne-proj-users
On Thursday, June 4, 2015 at 9:21:06 AM UTC+2, Peter Bienstman wrote:
> Hi,
>
> As a fallback, you can rely on playing audio through mplayer.
>
> In pyqt_ui/pyqt_render_chain.py, you find:
>
> class PyQtRenderChain(RenderChain):
>
> id = "default"
>
> if sys.platform == "win32":
> filters = [Latex, EscapeToHtml, ExpandPaths, MplayerAudio,
> MplayerVideo, RTLHandler, NonLatinFontSizeIncrease]
> else:
> filters = [Latex, EscapeToHtml, ExpandPaths, Html5Audio,
> Html5Video, RTLHandler, NonLatinFontSizeIncrease]
>
> renderers = [HtmlCss]
>
> Just replace 'if sys.platform == "win32":' by 'if True:'.
>
> Cheers,
>
> Peter

Hi Peter,
I recently upgraded my debian system to 9.0 and also upgraded to the distro's version of Mnemosyne (2.4-0.1).
Unfortunately Mnemosyne was mute afterwards.
I also tried versions 2.4.1 and 2.5 from your download area - still mute.
I spent hours, installing, reinstalling and removing various Python and Qt packages, that I figured might be relevant - still mute.
Then I looked into pyqt-render-chain.py and saw, that Mnemosyne needs MPlayer!
After installing Mnemosyne plays sound like a charm.
Perhaps you should mention this requirement in your install requirements.
Cheers, Juergen (otherwise very happy with Mnemosyne :-))

Peter Bienstman

unread,
Jul 3, 2017, 11:24:55 AM7/3/17
to mnemosyne-proj-users
Good point, I've updated the install instructions for Linux.

Thanks!

Peter

Jim Ivy

unread,
Jul 6, 2022, 3:12:29 AM7/6/22
to mnemosyne-proj-users
Add the html audio element as described here: https://www.w3schools.com/html/html5_audio.asp
Before you add the element, select the file that you wish to use using the right-click menu, Then, below that, add the html audio element as described.

Peter Bienstman

unread,
Jul 6, 2022, 3:13:47 AM7/6/22
to mnemosyne-proj-users
Just do the right click thing, no need to manually add tags.

Also, make sure mplayer is installed. 

Peter 

--
You received this message because you are subscribed to the Google Groups "mnemosyne-proj-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mnemosyne-proj-u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages