maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Multimedia (https://talk.maemo.org/forumdisplay.php?f=32)
-   -   A couple of Mediabox questions (https://talk.maemo.org/showthread.php?t=30593)

pycage 2009-09-01 06:32

Re: A couple of Mediabox questions
 
They do register in MessageBus as they're derived from Component. What shows you that they don't register? The components in components_extra and components_htpc are only loaded if specified on the command line with --plugin-dir, though.

pycage 2009-09-01 06:33

Re: A couple of Mediabox questions
 
Oh, and please ignore SideStrip. It's deprecated and will be removed. :)

maacruz 2009-09-01 15:35

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by pycage (Post 319336)
They do register in MessageBus as they're derived from Component. What shows you that they don't register?

A "print(mediator)" in add_mediator... but now I see that AudioWidget and VideoWidget do not register until they start playing a file for the first time. Quite confusing.
DisplayLight and HeadSet do not register at my desktop pc... I just checked and they do register in the device.
IdleDetector wasn't meant to be there, I did not deleted that line before posting...
Quote:

The components in components_extra and components_htpc are only loaded if specified on the command line with --plugin-dir, though.
Thanks :)

maacruz 2009-09-01 22:53

Re: A couple of Mediabox questions
 
2 Attachment(s)
With this patch, cummulative with my previous ones, all possible handle_message in trunk are converted to handle_<MESSAGE>
The profiling shows that the time spent in MessageBus.send_event() during 30 min of somafm playback is 1,5 seconds, while in 0.96.5 was 260 seconds. 173 times more efficient. Now, if there are no screen updates, the %cpu is 0.0 during playback much of the time.
Also, included, there is another small bugfix patch to AbstractBackend I missed in the previous set of patches.

pycage 2009-09-02 07:26

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by maacruz (Post 319555)
A "print(mediator)" in add_mediator... but now I see that AudioWidget and VideoWidget do not register until they start playing a file for the first time. Quite confusing.

The reason is because those only get instantiated by the Factory component when you start playing a file. Every viewer gets its own media widget.

Quote:

Originally Posted by maacruz (Post 319555)
DisplayLight and HeadSet do not register at my desktop pc... I just checked and they do register in the device.

Yes, these are Maemo-specific and check for the presence of Maemo. You can of course change that by removing the check in the __init__.py file of the plugin, but it will have no effect on non-Maemo systems, or crash due to missing stuff. :)

pycage 2009-09-02 07:28

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by maacruz (Post 319815)
With this patch, cummulative with my previous ones, all possible handle_message in trunk are converted to handle_<MESSAGE>
The profiling shows that the time spent in MessageBus.send_event() during 30 min of somafm playback is 1,5 seconds, while in 0.96.5 was 260 seconds. 173 times more efficient. Now, if there are no screen updates, the %cpu is 0.0 during playback much of the time.
Also, included, there is another small bugfix patch to AbstractBackend I missed in the previous set of patches.

Wow, that sounds great! Thanks!

Laughing Man 2009-09-04 01:52

Re: A couple of Mediabox questions
 
I can't wait for improvements in resource management. :)

Quick question though, I thought MediaBox had support for Portrait mode? Tried it today and nope (text goes off the screen, some UI elements go off screen).

Also I'm not sure if this is intentional, a bug, or just a bug on my system. But if your in the player, and fullscreen it. The previous and next arrow are not lined up and are literally right next to the right side of the screen making them hard to hit.

pycage 2009-09-06 16:58

Re: A couple of Mediabox questions
 
The next version will have full support for portrait mode, if the OS supports it. Fremantle and Mer ought to support portrait out of the box, and Diablo requires a patched kernel.

maacruz 2009-09-07 17:26

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by Laughing Man (Post 321204)
I can't wait for improvements in resource management. :)

Don't worry, I've some more waiting in line to be developed as soon as I get some time :D

Céltalan 2009-09-07 19:46

Re: A couple of Mediabox questions
 
Took me a month and a half to try several options for the "right mp3 player". I found mediabox as the only one which is able to go by the filename and where you can browse the directory structure as it is on the SD-Card; this is very useful if you have a mp3-collection with a lot of screwed up tags.
Also the bookmarks are very useful for 90-minute-lectures.
So thumbs up for this "heavy weight" mp3 player :-)
Thanks for the work

VulcanRidr 2009-09-09 18:38

Re: A couple of Mediabox questions
 
1 Attachment(s)
pycage,

Two questions for you. First, I believe I read in a thread somewhere that in fullscreen mode, the display snould look like

|< album art file info >|

However, mine looks like the screenshot below.

Second question, is it possible to add fast forward/fast rewind within a track?

Bonus question: ow do you embed album art into an mp3 or ogg? I know some of my podcasts (Car Talk, Distrowatch Weekly) have embedded art, but none of the other podcasts nor any of the music I upload from amaroK.

Thanks, --vr

pycage 2009-09-11 12:59

Re: A couple of Mediabox questions
 
What do you mean looks wrong in your screenshot? Mine looks the same.

Fast forward and rewind are available in 0.96.5 by pressing left and right on the D-pad. It doesn't work well with some media files, however.

There is plenty of software available for embedding album art, e.g. albumart-qt. But album art doesn't have to be embedded. You can also put a cover.jpg into the same folder as the music files.

VulcanRidr 2009-09-11 13:48

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by pycage (Post 325382)
What do you mean looks wrong in your screenshot? Mine looks the same.

I thought the fast forward and rewind were supposed to be on either side of the album art. Perhaps I was wrong?

Quote:

Fast forward and rewind are available in 0.96.5 by pressing left and right on the D-pad. It doesn't work well with some media files, however.
The problem is that I have an in-car mount for it, and it is difficult to get to the D-pad while it is in this mount. I have been using the N810 more and more for my main mp3 player...One less piece of kit I have to drag around with me. :)

Quote:

There is plenty of software available for embedding album art, e.g. albumart-qt. But album art doesn't have to be embedded. You can also put a cover.jpg into the same folder as the music files.
Okay. I noticed that some podcasts and the mp3s I have been buying have come with embedded art, which I thought amaroK was doing as well. Apparently different methods. Amarok is apparently embedding it into its database rather than in the media files.

Thanks,
--vr

Laughing Man 2009-09-11 20:22

Re: A couple of Mediabox questions
 
Pycage, might i suggest moving the < and > keys (I know they don't look like that) away from the side?

On the n800, it's to close to the bezel making finger operation of it slightly difficult.

VulcanRidr 2009-09-12 01:31

Re: A couple of Mediabox questions
 
I don't really have a problem with the FF and REW keys being on the same side, I thought they were supposed to be on opposite sides. Maybe you could present them as buttons.

maacruz 2009-09-17 20:15

Re: A couple of Mediabox questions- A new patchset
 
1 Attachment(s)
Hi pycage,

I have fixed a few bugs more, most of them noticeable with inet media.
This is the changelog:
MPlayerBackend.py:
- fix high cpu usage when "connecting"
- fix high cpu usage when "buffering..."
- move busy_loop to a more useful position, since the delay between mplayer loading and start of stream playing can be very large
- fix repetitive error dialogs due to temporary server failure, one error dialog at definitive failure is enough (happens often with shoutcast streams)
- detect better stream failure
AbstractBackend.py:
- when a stream failure happens, pressing play again (in the track/player window) doesn't try to reopen the stream. fix.
File.py
- fix high cpu usage when loading large lists
Widget.py
- lower cpu usage with animations
KineticScroller.py
- very noticeable when a stream is "connecting" and using mplayer backend: scrolling a list will scroll for a second, stop for a second, and repeat. fix.

Other bugs I've found and will try to fix in the near future:
- Can't change stream in certain cases (when stream takes time to fail, when is "connecting" or "buffering")
- when the backend changes, starts playing with the wrong volume
- shoutcast fails to download genres/stations very very often, should permanently store them and redownload by demand

Some features I want to add.
- Detect screen status to further reduce cpu usage ("low power mode")
- Replaygain support (in the not so near future)

pycage 2009-09-19 20:53

Re: A couple of Mediabox questions
 
Hi maacruz,

I'm merging your patches with my code and noticed that you sometimes use code like this:
Code:

gobject.timeout_add(1000, lambda : False)
...
gtk.main_iteration(True)

What exactly does it do? It doesn't seem to delay for 1000 ms. Is the 1000 an arbitrary value here just to ensure that something is in the event queue when calling main_iteration later?
Why is this working better than gtk.main_iteration(False) ?

Keep up the good work! :)

maacruz 2009-09-20 10:51

Re: A couple of Mediabox questions
 
1 Attachment(s)
Quote:

Originally Posted by pycage (Post 329956)
Hi maacruz,

I'm merging your patches with my code and noticed that you sometimes use code like this:
Code:

gobject.timeout_add(1000, lambda : False)
...
gtk.main_iteration(True)

What exactly does it do? It doesn't seem to delay for 1000 ms. Is the 1000 an arbitrary value here just to ensure that something is in the event queue when calling main_iteration later?
Why is this working better than gtk.main_iteration(False) ?

Keep up the good work! :)

In those places you have a tight event loop running gtk.main_iteration(False) with a timed exit.
main_iteration(False) is a non blocking call, and if there is no event it returns inmediatly, so it becomes a busy loop which pegs the cpu at 100%
main_iteration(True) is a blocking call, so if there is no event, it sleeps indefinitely waiting for a event, and while it is sleeping, there is no cpu usage. The gobject.timeout_add is there to provide a timed event (with the lambda function provided which does nothing but inmediatly return) at the moment the loop should end, so making sure the main_iteration(True) doesn't sleeps indefinitely and the event loop ends properly. The 1000 ms in the example is the 1 second check (time.time() < timeout) used later to end the loop.
This approach has three advantages:
1- The linux scheduler rewards sleeping (I/O bound) tasks with high priority and punishes cpu hogs with low priority, so mediabox is more responsive/interactive.
2- The tablet as a whole is more responsive, as the cpu is free for other tasks
3- The battery lasts longer

By the way, I have attached a little ui bugfix patch:
- KineticScroller.py, ImageStrip.py: when using kinetic scroll to reach the end of the list, the scroll stops before reaching the end for a while, then jumps. Most noticeable with fast movements. Fixed.

I now... you told me ImageStrip is going to be deprecated, but .... it WAS a bug .... I couldn't stand it... I.... I had to do it... don't you understand? .... I HAD TO DO IT :D

pycage 2009-09-21 16:40

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by maacruz (Post 330190)
1- The linux scheduler rewards sleeping (I/O bound) tasks with high priority and punishes cpu hogs with low priority, so mediabox is more responsive/interactive.
2- The tablet as a whole is more responsive, as the cpu is free for other tasks
3- The battery lasts longer

This does sound very good. :) I'm gonna put it into SVN today.

Quote:

Originally Posted by maacruz (Post 330190)
By the way, I have attached a little ui bugfix patch:
- KineticScroller.py, ImageStrip.py: when using kinetic scroll to reach the end of the list, the scroll stops before reaching the end for a while, then jumps. Most noticeable with fast movements. Fixed.

:eek: You really fixed that bug? This is awesome! I was looking for it a few times but never found a way to fix it. Thanks!

Quote:

Originally Posted by maacruz (Post 330190)
I now... you told me ImageStrip is going to be deprecated, but .... it WAS a bug .... I couldn't stand it... I.... I had to do it... don't you understand? .... I HAD TO DO IT :D

Hehe, ImageStrip is gone, but KineticScroller is still there. Lists are now rendered by the ui.itemview.GridView class, which is basically ImageStrip written from scratch, but simpler and capable of displaying a grid of items instead of only a one-dimensional list. The list, of course, is a special case of the grid. :)
Some other things have changed as well and parts of the GUI are still missing in the current SVN version. Mainly, the user interface became simpler and better prepared for operation in portrait mode. The next release will support landscape and portrait modes, have automatic screen rotation on the N900, and manual screen rotation (if rotation support was installed) on the other NITs.

VulcanRidr 2009-09-22 03:09

Re: A couple of Mediabox questions
 
I haven't seen this show up in the feeds, not to rush you guys...pycage, is the version on http://mediabox.garage.maemo.org/download.html newer than the ones in the standard feed?

Also, are there a theme-making howtos? I would like to create a couple of themes. I use your darkbox theme, since I mainly use it in the car, but it seems a little bland for that use. I wanted to try my hand at creating one that matches the instrument panels on my RSX, which is dark with red details.

--vr

pycage 2009-09-22 06:51

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by VulcanRidr (Post 331152)
I haven't seen this show up in the feeds, not to rush you guys...pycage, is the version on http://mediabox.garage.maemo.org/download.html newer than the ones in the standard feed?

No, 0.96.5 is still the latest release. But we're heading towards a 0.97 release. But I think I'm gonna leave the 0.x versioning scheme and call it 2009.10 or similar. It's less confusing. :)

Quote:

Originally Posted by VulcanRidr (Post 331152)
Also, are there a theme-making howtos? I would like to create a couple of themes. I use your darkbox theme, since I mainly use it in the car, but it seems a little bland for that use. I wanted to try my hand at creating one that matches the instrument panels on my RSX, which is dark with red details.
--vr

New themes are always welcome. There is a tutorial at
http://pycage.blogspot.com/2009/01/m...-mediabox.html

If you have any questions about theme making just ask. :)

VulcanRidr 2009-09-23 03:30

Re: A couple of Mediabox questions
 
pycage,

For your next release, can you add an option, within the playlist and/or within the media groups (video, audio) to delete the media from the device as well as simply removing from the playlist? Perhaps a pop-up wehn you remove from the playlist? It is a pain to delete from the playlist, then having to open another app (terminal or file manager) to delete the media.

VulcanRidr 2009-09-24 09:07

Re: A couple of Mediabox questions
 
pycage, another issue. Not sure what is going on with it, but here is my situation.

I have, among other things, in my .sounds directory, Pink Floyd's Is There Anybody Out There, which is a 2 cd set. Originally, the mp3s were named like

Code:

01_McAtmos.mp3
01_Hey_You.mp3
etc.

I tried moving the songs from disc 2 to a different directory, but MediaBox still saw them in numerical order rather than track order. So I renamed them to 1_01, 1_02...2_01, 2_02, etc.

Well, now, when I try to access the directory through the Albums tab in the browser, the album opens, but none of the tracks. If I try to access it through the Artists tab and drill down to the album, I get each song on the second disc twice, and none from the first disc.

Going into Music Folders gives me two Is There Anybody Out There folders, both containing the songs from disc 2.

Any ideas?

VulcanRidr 2009-10-15 19:51

Re: A couple of Mediabox questions
 
Hadn't heard anything on this lately. Whats going on with mediabox?

pycage 2009-10-15 20:03

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by VulcanRidr (Post 347681)
Hadn't heard anything on this lately. Whats going on with mediabox?

I'm working hard on it for Fremantle and Diablo releases.
See also http://pycage.blogspot.com/2009/10/m...x-on-n900.html for what's going to come soon.

The platforms I plan to target are:
- Diablo
- Mer
- Fremantle

VulcanRidr 2009-10-16 15:08

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by pycage (Post 347700)
I'm working hard on it for Fremantle and Diablo releases.
See also http://pycage.blogspot.com/2009/10/m...x-on-n900.html for what's going to come soon.

The platforms I plan to target are:
- Diablo
- Mer
- Fremantle

Sweet! Thanks pycage. Just out of curiosity, did you see my questions above? MediaBox has been acting strangely lately. I can get to some files only by drilling down into the directory, but not through artist or album. When I try to open the artist or album, it opens (the open icon changes to add to playlist, but no files appear under it). Adding to playlist says it is adding, but no files are actually added.

I have tried deleting my playlist, could something have gotten corrupted under the .mediabox directory?

pycage 2009-10-16 20:36

Re: A couple of Mediabox questions
 
What happens if you remove the two .idx in the .mediabox directory?

VulcanRidr 2009-10-19 02:34

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by pycage (Post 348978)
What happens if you remove the two .idx in the .mediabox directory?

That did it. Thanks pycage.

I've had to fsck the card twice now, and both led to issues...Have to remember not to do that again... :)

jkq 2009-10-28 04:23

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by pycage (Post 347700)
I'm working hard on it for Fremantle and Diablo releases.
See also http://pycage.blogspot.com/2009/10/m...x-on-n900.html for what's going to come soon.

Any chance of another release for Diablo with maacruz's fixes? :)

-jkq

pycage 2009-10-28 07:11

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by jkq (Post 359586)
Any chance of another release for Diablo with maacruz's fixes? :)

Yes, of course. :)

belanger 2009-11-03 02:22

Re: A couple of Mediabox questions
 
Hi All,

Assuming that this is the thread to post MediaBox questions...

(1) With the YouTube plugin, is there a way of downloading a video without starting to play it?

(2) Is there a way of adjusting the font size? When browsing, the song names look a bit small.

(3) When playing a song, as say started from the browser, is there a way of going immediately to the playlist? Or do I have to go through the bottom menu?

By the way, it was nice to hear that MediaBox will be developed for Mer. I had thought that Mer would automatically run Diablo applications, but perhaps Mer has extra stuff that MediaBox can take advantage of. I recently got a spare n800 to put Mer on. A while ago, I had another n800 to put Mer on, but when my daughter saw me using MediaBox on my primary n800, she wanted her own. So she got my first spare, and I had to go get another.

Jay

pycage 2009-11-03 08:07

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by belanger (Post 364158)
(1) With the YouTube plugin, is there a way of downloading a video without starting to play it?

No, at least not yet.

Quote:

Originally Posted by belanger (Post 364158)
(2) Is there a way of adjusting the font size? When browsing, the song names look a bit small.

The font size is controlled by the theme. So, yes, it could be changed.
See here: http://pycage.blogspot.com/2009/01/m...-mediabox.html

Themes inherit from the default theme, so making a new theme with just the PREVIEW.png, mb.def and info files would be enough.

Quote:

Originally Posted by belanger (Post 364158)
(3) When playing a song, as say started from the browser, is there a way of going immediately to the playlist? Or do I have to go through the bottom menu?

You have to go through the bottom menu.

Quote:

Originally Posted by belanger (Post 364158)
By the way, it was nice to hear that MediaBox will be developed for Mer. I had thought that Mer would automatically run Diablo applications, but perhaps Mer has extra stuff that MediaBox can take advantage of.

Basically, Mer is more like Fremantle than Diablo.

Quote:

Originally Posted by belanger (Post 364158)
A while ago, I had another n800 to put Mer on, but when my daughter saw me using MediaBox on my primary n800, she wanted her own. So she got my first spare, and I had to go get another.

This is great to hear. :D

belanger 2009-11-03 19:11

Re: A couple of Mediabox questions
 
Thanks for the answers!

Quote:

Originally Posted by pycage (Post 364280)
The font size is controlled by the theme. So, yes, it could be changed.
See here: http://pycage.blogspot.com/2009/01/m...-mediabox.html

Themes inherit from the default theme, so making a new theme with just the PREVIEW.png, mb.def and info files would be enough.

Oh, no; now I'll be playing with themes. I've been avoiding that, because I'm worried about what will happen once I get started. I've always felt that anything that can be tweaked must be tweaked.
So there goes my spare time... :)

VulcanRidr 2009-11-03 21:05

Re: A couple of Mediabox questions
 
pycage,

Couple of more stupid questions/bug reports/feature requests.

1. Since I have started using mediabox as my sole mp3/ogg player, I've noticed a couple of things. First, is there a way to have it pick back up where it left off? I mean, I listen to podcasts when I am in the car on my commute. When I get to the train (more on that later), office or whatever, I close down MediaBox to free memory for other apps. When I open it again for the trip home, I would like it to autoresume. Is this possible at some point in the future?

2. I also noticed that if you arrange your playlist, moving items around, then close, then reopen, the play list reverts to the default order. An example: On Sunday night/Monday morning, I download my podcasts using gpodder on my desktop (gpodder is a little too heavy and locks up in my attempts to use it on the N810). I copy them to ~/MyDesktop/.sounds/Podcasts. When I open MediaBox, I import the contents of this directory into the playlist. Then, when time permits, I shuffle the order of play...But when I close MediaBox, the playlist reverts to its original order.

3. If I am playing sound files, and change over to video, then back to sound files, I get strange behavior. When I go back to playing sound files, more often than not, it starts playing the video again. Have you seen this?

Perhaps my usage is non-normal, but these are things I have seen with MediaBox.

Thanks,
--vr

pycage 2009-11-06 19:17

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by VulcanRidr (Post 364811)
1. Since I have started using mediabox as my sole mp3/ogg player, I've noticed a couple of things. First, is there a way to have it pick back up where it left off? I mean, I listen to podcasts when I am in the car on my commute. When I get to the train (more on that later), office or whatever, I close down MediaBox to free memory for other apps. When I open it again for the trip home, I would like it to autoresume. Is this possible at some point in the future?

Yes, this will be possible at some point in the future. For the time being, you could set a bookmark in that file before you close MediaBox.

Quote:

Originally Posted by VulcanRidr (Post 364811)
2. I also noticed that if you arrange your playlist, moving items around, then close, then reopen, the play list reverts to the default order.

Not good. :(
This sounds like a bug. I'll check it. Apparently arranging alone does not trigger writing the playlist to file.

Quote:

Originally Posted by VulcanRidr (Post 364811)
3. If I am playing sound files, and change over to video, then back to sound files, I get strange behavior. When I go back to playing sound files, more often than not, it starts playing the video again. Have you seen this?

This bug will hopefully be gone with the next release. Yes, I've seen it occasionally.

VulcanRidr 2009-11-06 19:42

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by pycage (Post 367651)
Yes, this will be possible at some point in the future. For the time being, you could set a bookmark in that file before you close MediaBox.

That is what I have been doing. But combined with the not changing the playlist bug, it makes it difficult when you are further down in the playlist. For the time being, I am using the "Last 50 played" list to supplement the playlist.

Quote:

Not good. :(
This sounds like a bug. I'll check it. Apparently arranging alone does not trigger writing the playlist to file.
It also may be a result of having to fsck my SD card. Maybe something got munged in my ~/.mediabox directory. The playlist functions that I mentioned a month or so ago seem to have abated after deleting the two .idx files.

Quote:

This bug will hopefully be gone with the next release. Yes, I've seen it occasionally.
Excellent. Thanks PyCage!

volleydude 2009-11-18 05:40

Re: A couple of Mediabox questions
 
Quote:

Originally Posted by VulcanRidr (Post 348500)
Sweet! Thanks pycage. Just out of curiosity, did you see my questions above? MediaBox has been acting strangely lately. I can get to some files only by drilling down into the directory, but not through artist or album. When I try to open the artist or album, it opens (the open icon changes to add to playlist, but no files appear under it). Adding to playlist says it is adding, but no files are actually added.

I have tried deleting my playlist, could something have gotten corrupted under the .mediabox directory?


I'm having the same issue as VulcanRidr. I saw you solution for removing the idx files, but don't see these files on either the internal or external media card.

pycage 2009-11-18 06:56

Re: A couple of Mediabox questions
 
The idx files are located in /home/user/.mediabox/

volleydude 2009-11-18 07:19

Re: A couple of Mediabox questions
 
Thanks, I reinstalled mediabox after not using for a bit. I like the improvements and am looking forward to the new release! Should I have been able to find the location of those in some other thread?

stl1859 2009-11-18 15:16

Re: A couple of Mediabox questions
 
stupid question - apologies in advance - Where do I say something like "this is my audio folder" ? I do not see that option anymore ..or is that option not applicable anymore ?


All times are GMT. The time now is 00:12.

vBulletin® Version 3.8.8