Opened 16 years ago

Last modified 16 years ago

#4222 closed enhancement

Update MythMusic to continue playing in the background after exiting it. — at Version 11

Reported by: paulh Owned by: paulh
Priority: minor Milestone: 0.21
Component: mythmusic Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description (last modified by paulh)

This is a preview patch that I would like anyone who is interested in this feature to test and provide some feedback.

It allows you to start a playlist playing in MythMusic then exit and use other parts of myth while continuing to play music in the background.

When you exit the MythMusic playback screen you are given the option to exit and stop playing or exit and continue playing. If you choose to continue playing you can then use other parts of Myth while your music is still playing.

When a new track starts and you are not in the main music playback screen a mini popup player is shown for a few seconds then disappears. While the mini player is on screen you can press Escape to remove it or press SELECT and it will stay on screen until you press escape. There is also a new jump point that will instantly show the mini player anywhere in Myth except when playing tv/video etc. While the miniplayer is on screen you can use most of the key bindings available in the main playback screen to change tracks, fast forward, rewind, pause, stop, mute the audio, increase/decrease the volume etc. Like other part of Myth the miniplayer is fully themeable.

TODO:

Test the Repeat and Shuffle modes are working correctly.

CD track playback works but returning to the main playback screen always rescans the CD and starts playing from the first track again rather that continuing where it left of.

Add a mechanism to detect when something else needs the audio output, like playing a recording, live TV or a DVD for example and pause/stop the music player while it's in use then possibly restart playing after it's finished. Currently you have to stop music playback before playing anything else.

Change History (17)

Changed 16 years ago by paulh

Attachment: 4222-v1.patch added

Patch to allow MythMusic to play in the background

Changed 16 years ago by paulh

Attachment: miniplayer_background.png added

This new image should be copied to mythplugins/mythmusic/mythmusic/images/miniplayer_background.png

comment:1 Changed 16 years ago by otto at kolsi dot fi

Tested this with two machines. No problems when applying & compiling patch. So far the miniplayer/background play seems to work very well. Nice work, this is much needed enhancement :) I identified two issues:

  • When miniplayer is closed with esc, there's this line in logs. Not sure if it is related or is nothing to worry about: "Could not find widget to detach"
  • When MythMusic is playing music in the background and MythFrontend is exited, there's a segfault (not that big deal because you are exiting mfe anyway).

comment:2 in reply to:  1 ; Changed 16 years ago by paulh

Replying to otto at kolsi dot fi:

Tested this with two machines. No problems when applying & compiling patch. So far the miniplayer/background play seems to work very well. Nice work, this is much needed enhancement :) I identified two issues:

Thanks for testing.

When miniplayer is closed with esc, there's this line in logs. Not sure if it is related or is nothing to worry about: "Could not find widget to detach"

This is actually harmless. We detach the dialog before its displayed so when the MythDialog? destructor I think tries to detach it again it fails. The virtual keyboard displays the same message as well. There's no point fixing this because that code will be removed if/when things start to move over to the new UI anyway.

When MythMusic is playing music in the background and MythFrontend is exited, there's a segfault (not that big deal because you are exiting mfe anyway).

This is not so good :-(

I don't seem to get any segfault when MythFrontend exits. Any chance you could get a backtrace so I know what area of the code I should be looking at?

comment:3 in reply to:  2 Changed 16 years ago by Mike Rice <mikerice1969@…>

Replying to paulh:

Replying to otto at kolsi dot fi:

Tested this with two machines. No problems when applying & compiling patch. So far the miniplayer/background play seems to work very well. Nice work, this is much needed enhancement :) I identified two issues:

Thanks for testing.

When miniplayer is closed with esc, there's this line in logs. Not sure if it is related or is nothing to worry about: "Could not find widget to detach"

This is actually harmless. We detach the dialog before its displayed so when the MythDialog? destructor I think tries to detach it again it fails. The virtual keyboard displays the same message as well. There's no point fixing this because that code will be removed if/when things start to move over to the new UI anyway.

When MythMusic is playing music in the background and MythFrontend is exited, there's a segfault (not that big deal because you are exiting mfe anyway).

This is not so good :-(

I don't seem to get any segfault when MythFrontend exits. Any chance you could get a backtrace so I know what area of the code I should be looking at?

I tested and it looks like it is working fairly well. I'll put it on my main frontend and give it a bit more workout.

I can reproduce the seg fault on exit. I've attached my log. Hope it helps.

Changed 16 years ago by Mike Rice <mikerice1969@…>

Attachment: gdbfrontend.txt added

comment:4 Changed 16 years ago by dbatt@…

A great enhancement. Seems to work well. Seg faults if hitting "play" on an album folder or artist folder on my combined fe/be, but works ok on playlists or playing the first track within an album. Will try and attach a log of seg fault.

With reference to pause/stopping playback when entering playback of video/tv, It might be nice to provide a choice to instead mute the video/tv audio (if that's possible to do), allowing one to listen to music and watch the TV muted, which some of us like to do, ie, watching sport.

I'll continue to test.

comment:5 Changed 16 years ago by Benoît LORAND <benoit.lorand@…>

Great !!

I have installed it yesterday and it's working properly for me. But it there possible to allow change volume in mythgallery ?

Thanks a lot, there's many time i would like this function.

Changed 16 years ago by otto at kolsi dot fi

Attachment: gdbfrontend2.txt added

comment:6 in reply to:  2 ; Changed 16 years ago by otto at kolsi dot fi

Replying to paulh:

When MythMusic is playing music in the background and MythFrontend is exited, there's a segfault (not that big deal because you are exiting mfe anyway).

This is not so good :-(

I don't seem to get any segfault when MythFrontend exits. Any chance you could get a backtrace so I know what area of the code I should be looking at?

I've also attached frontend backtrace. I'm not sure if it's a proper one, there's not so much info.

Earlier when I tested I only used wireless keyboard. Now I've also used remote/LIRC and there I have problem. I can enable the miniplayer with the remote but after that no normal MythMusic commands get through. Only remote key that miniplayer accepts is ESC. And when ESC is pressed, it is sort of interpreted twice. So miniplayer is not only closed but immediately frontend is also about to be closed (second ESC).

At the same the keyboard is working properly. How to diagnose this further?

Changed 16 years ago by paulh

Attachment: 4222-v2.patch added

Updated patch

comment:7 Changed 16 years ago by paulh

Attached an updated patch.

  • Shutdown and delete the music player in an orderly fashion when exiting MythFrontend - should hopefully fix the segfault when exiting MythFrontend.
  • Fix the segfault when pressing select on an artist or album in the music tree.
  • Add some feed back in the mini player when changing volume, muting, changing repeat mode and shuffle mode.

comment:8 in reply to:  5 Changed 16 years ago by paulh

Replying to Benoît LORAND <benoit.lorand@blorand.org>:

I have installed it yesterday and it's working properly for me. But it there possible to allow change volume in mythgallery ?

The mini popup player will allow you to change the volume anywhere. At the moment the jump point to call the popup doesn't quite work properly because it always takes you back to the main menu.

comment:9 in reply to:  6 Changed 16 years ago by paulh

Replying to otto at kolsi dot fi:

Earlier when I tested I only used wireless keyboard. Now I've also used remote/LIRC and there I have problem. I can enable the miniplayer with the remote but after that no normal MythMusic commands get through. Only remote key that miniplayer accepts is ESC. And when ESC is pressed, it is sort of interpreted twice. So miniplayer is not only closed but immediately frontend is also about to be closed (second ESC).

At the same the keyboard is working properly. How to diagnose this further?

I'm going to have to see if I can reproduce this. My dev box doesn't currently have lirc setup so all my testing was done with a keyboard. The player uses the same techniques as the virtual keyboard so I wasn't expecting any problems using a remote. Anyone else tested it and is using a remote?

comment:10 Changed 16 years ago by paulh

(In [14969]) Allow jump points that don't return to the main menu before jumping.

This adds a new REG_JUMPEX macro to mythmainwindow.h that adds an extra parameter that allows you to indicate whether a jump point should return to the main menu before jumping. It will be used by the jump point that shows the popup mini player in MythMusic.

This requires a 'make clean' and rebuild of the plugins.

Refs #4222.

Changed 16 years ago by paulh

Attachment: 4222-v3.patch added

Updated patch (requires mythtv >= r14969 to be installed)

comment:11 Changed 16 years ago by paulh

Description: modified (diff)

Attached an updated patch. You need to update mythtv to r14969 or later for this patch to compile.

  • Fixes the mini popup player not working with a remote.
  • The jump point to show the popup player now doesn't return you to the main menu before showing it.
  • Fixed the visualizer not working after returning to the main playback screen after playing music in the background. There's a couple of seconds delay before the visualizer catches up with the audio output but thats better than no visualizer at all :-)
Note: See TracTickets for help on using tickets.