pl_mpegDC ported running but community help needed

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
User avatar
Ian Robinson
DC Developer
DC Developer
Posts: 116
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Mon Mar 11, 2019 7:12 am
Has thanked: 209 times
Been thanked: 41 times

Re: pl_mpegDC ported running but community help needed

Post by Ian Robinson »

Twada wrote: Tue Sep 05, 2023 7:52 am Thank you for listening to my unreasonable request.
I'm not familiar with stream-related code, so this is a very valuable hint!

Again, we need to speed up audio decoding. I'll try again after I cool my head.
Decoding is slow for ogg and mp3.. Even in kos ports.. Only thing i do to make it work is very low bit-rate 64bit and mono..Sometimes 32 Also 22khz sample rate speeds it up..

Not going to be doing 44khz stereo that's for sure while decoding video and audio with the current kos streamer.
These users thanked the author Ian Robinson for the post:
Twada
Twada
DC Developer
DC Developer
Posts: 42
Joined: Wed Jan 20, 2016 4:55 am
Has thanked: 18 times
Been thanked: 53 times

Re: pl_mpegDC ported running but community help needed

Post by Twada »

Ian Robinson wrote: Tue Sep 05, 2023 10:36 pm Decoding is slow for ogg and mp3.. Even in kos ports.. Only thing i do to make it work is very low bit-rate 64bit and mono..Sometimes 32 Also 22khz sample rate speeds it up..

Not going to be doing 44khz stereo that's for sure while decoding video and audio with the current kos streamer.
This is a version that changes the window array and uses the fipr instruction.
Since I only output mono, 320x240 video should be fast enough with sound.
But it's not threaded yet, so it looks slow. someone please help me
pl_mpeg7.rar
(63.95 KiB) Downloaded 55 times
Fixed pl_mpeg.c. sorry.

For some reason, a memory leak occurs when I specify monaural with "snd_stream_start(snd_hnd, samplerate, 0);".
I don't know if it's a pl_mpeg error or a KOS error...
These users thanked the author Twada for the post:
Ian Robinson
User avatar
BB Hood
DC Developer
DC Developer
Posts: 189
Joined: Fri Mar 30, 2007 12:09 am
Has thanked: 41 times
Been thanked: 10 times

Re: pl_mpegDC ported running but community help needed

Post by BB Hood »

Please please please get on Github. It would be a lot easier for others to see your code and be able to help. I download the code and ran it. It crashes as soon as I upload it through dcload.
User avatar
Ian Robinson
DC Developer
DC Developer
Posts: 116
Joined: Mon Mar 11, 2019 7:12 am
Has thanked: 209 times
Been thanked: 41 times

Re: pl_mpegDC ported running but community help needed

Post by Ian Robinson »

BB Hood wrote: Wed Sep 13, 2023 9:07 pm Please please please get on Github. It would be a lot easier for others to see your code and be able to help. I download the code and ran it. It crashes as soon as I upload it through dcload.
Did you use the right size video ?
bandicam 2023-09-14 01-24-53-527.jpg
Twada
DC Developer
DC Developer
Posts: 42
Joined: Wed Jan 20, 2016 4:55 am
Has thanked: 18 times
Been thanked: 53 times

Re: pl_mpegDC ported running but community help needed

Post by Twada »

I wanted to reduce the storage space, so I deleted the sample videos.
This is a bundled version. I think this will work.
pl_mpeg7_1.rar
(7.13 MiB) Downloaded 69 times
I'm going to learn about GitHub. It certainly seems more convenient to use GitHub if you want to ask for help from the community.
These users thanked the author Twada for the post:
Ian Robinson
User avatar
Ian Robinson
DC Developer
DC Developer
Posts: 116
Joined: Mon Mar 11, 2019 7:12 am
Has thanked: 209 times
Been thanked: 41 times

Re: pl_mpegDC ported running but community help needed

Post by Ian Robinson »

Twada wrote: Thu Sep 14, 2023 8:40 am I wanted to reduce the storage space, so I deleted the sample videos.
This is a bundled version. I think this will work.
pl_mpeg7_1.rar

I'm going to learn about GitHub. It certainly seems more convenient to use GitHub if you want to ask for help from the community.
I will take a look at that see what i can do.. You have gone far past my port of it so there is not much put going with mine..
User avatar
Ian Robinson
DC Developer
DC Developer
Posts: 116
Joined: Mon Mar 11, 2019 7:12 am
Has thanked: 209 times
Been thanked: 41 times

Re: pl_mpegDC ported running but community help needed

Post by Ian Robinson »

Twada wrote: Wed Sep 13, 2023 2:38 am
Ian Robinson wrote: Tue Sep 05, 2023 10:36 pm Decoding is slow for ogg and mp3.. Even in kos ports.. Only thing i do to make it work is very low bit-rate 64bit and mono..Sometimes 32 Also 22khz sample rate speeds it up..

Not going to be doing 44khz stereo that's for sure while decoding video and audio with the current kos streamer.
This is a version that changes the window array and uses the fipr instruction.
Since I only output mono, 320x240 video should be fast enough with sound.
But it's not threaded yet, so it looks slow. someone please help me

pl_mpeg7.rar
Fixed pl_mpeg.c. sorry.

For some reason, a memory leak occurs when I specify monaural with "snd_stream_start(snd_hnd, samplerate, 0);".
I don't know if it's a pl_mpeg error or a KOS error...
Ok works fine i just compiled it and sent to hardware
https://streamable.com/pftkip

now the video is slower yes audio decoding takes a big hit out of the cpu and streaming as normal.. I will test the memory leak you said..
These users thanked the author Ian Robinson for the post:
Twada
User avatar
Ian Robinson
DC Developer
DC Developer
Posts: 116
Joined: Mon Mar 11, 2019 7:12 am
Has thanked: 209 times
Been thanked: 41 times

Re: pl_mpegDC ported running but community help needed

Post by Ian Robinson »

First think i do is fix all warnings i always do that and go from there.. upload the fixed code.Because of the memory leak you warned about as that's not in kos i call mono like that with out that problem.
Twada
DC Developer
DC Developer
Posts: 42
Joined: Wed Jan 20, 2016 4:55 am
Has thanked: 18 times
Been thanked: 53 times

Re: pl_mpegDC ported running but community help needed

Post by Twada »

It has finally been completed! Thanks to Ian and BBHood!
You can play 320x240 Mpeg1 files with sound.
mpeg1dc.rar
(3.38 MiB) Downloaded 61 times
Edit:Fix line 164 in mpeg1.c.

Please set the resolution to 320x240 (4:3) or 368x208 (16:9). Please use monaural sound of 80kbits or less.
Due to copyright reasons, the sample video has been replaced.

The frame rate control is quite sloppy, so feel free to modify it as you like.
I hope it is helpful to the Dreamcast community.
I'll try GitHub another time...
Last edited by Twada on Tue Sep 19, 2023 5:03 pm, edited 1 time in total.
These users thanked the author Twada for the post (total 2):
Ian RobinsonGyroVorbis
User avatar
lerabot
Insane DCEmu
Insane DCEmu
Posts: 134
Joined: Sun Nov 01, 2015 8:25 pm
Has thanked: 2 times
Been thanked: 19 times

Re: pl_mpegDC ported running but community help needed

Post by lerabot »

Thank you very much Twada! The source code itself it also very nice to study.
These users thanked the author lerabot for the post:
Twada
User avatar
Ian Robinson
DC Developer
DC Developer
Posts: 116
Joined: Mon Mar 11, 2019 7:12 am
Has thanked: 209 times
Been thanked: 41 times

Re: pl_mpegDC ported running but community help needed

Post by Ian Robinson »

Twada wrote: Tue Sep 19, 2023 7:29 am It has finally been completed! Thanks to Ian and BBHood!
You can play 320x240 Mpeg1 files with sound.

mpeg1dc.rar

Please set the resolution to 320x240 (4:3) or 368x208 (16:9). Please use monaural sound of 80kbits or less.
Due to copyright reasons, the sample video has been replaced.

The frame rate control is quite sloppy, so feel free to modify it as you like.
I hope it is helpful to the Dreamcast community.
I'll try GitHub another time...
fantastic Twada ::) :grin:
User avatar
Ian Robinson
DC Developer
DC Developer
Posts: 116
Joined: Mon Mar 11, 2019 7:12 am
Has thanked: 209 times
Been thanked: 41 times

Re: pl_mpegDC ported running but community help needed

Post by Ian Robinson »

Twada wrote: Tue Sep 19, 2023 7:29 am It has finally been completed! Thanks to Ian and BBHood!
You can play 320x240 Mpeg1 files with sound.

mpeg1dc.rar

Please set the resolution to 320x240 (4:3) or 368x208 (16:9). Please use monaural sound of 80kbits or less.
Due to copyright reasons, the sample video has been replaced.

The frame rate control is quite sloppy, so feel free to modify it as you like.
I hope it is helpful to the Dreamcast community.
I'll try GitHub another time...
thank you again amazing work..
Here is the video running pefect
https://streamable.com/9rn4uc
User avatar
Ian Robinson
DC Developer
DC Developer
Posts: 116
Joined: Mon Mar 11, 2019 7:12 am
Has thanked: 209 times
Been thanked: 41 times

Re: pl_mpegDC ported running but community help needed

Post by Ian Robinson »

Twada wrote: Thu Sep 14, 2023 8:40 am I wanted to reduce the storage space, so I deleted the sample videos.
This is a bundled version. I think this will work.
pl_mpeg7_1.rar

I'm going to learn about GitHub. It certainly seems more convenient to use GitHub if you want to ask for help from the community.
Can i put this up on my github course all credit to you :)
Twada
DC Developer
DC Developer
Posts: 42
Joined: Wed Jan 20, 2016 4:55 am
Has thanked: 18 times
Been thanked: 53 times

Re: pl_mpegDC ported running but community help needed

Post by Twada »

Ian Robinson wrote: Tue Sep 19, 2023 10:48 am Can i put this up on my github course all credit to you :)
Thank you! Please.
I have fixed line 164 of mpeg1.c, so please download it again. The file name was not passed correctly.
These users thanked the author Twada for the post (total 2):
Ian RobinsonGyroVorbis
User avatar
Ian Robinson
DC Developer
DC Developer
Posts: 116
Joined: Mon Mar 11, 2019 7:12 am
Has thanked: 209 times
Been thanked: 41 times

Re: pl_mpegDC ported running but community help needed

Post by Ian Robinson »

Twada wrote: Tue Sep 19, 2023 5:01 pm
Ian Robinson wrote: Tue Sep 19, 2023 10:48 am Can i put this up on my github course all credit to you :)
Thank you! Please.
I have fixed line 164 of mpeg1.c, so please download it again. The file name was not passed correctly.
Ok i put it up on github with your handle and name post it here..
User avatar
GyroVorbis
Elysian Shadows Developer
Elysian Shadows Developer
Posts: 1874
Joined: Mon Mar 22, 2004 4:55 pm
Location: #%^&*!!!11one Super Sonic
Has thanked: 80 times
Been thanked: 62 times
Contact:

Re: pl_mpegDC ported running but community help needed

Post by GyroVorbis »

Wow, congratulations! This is fantastic work!

I really don't know anything about media decoding, but I'm an engine/graphics programmer, and the fact FIPR got used here got me curious... and sure enough, I see what you did in the hot path with the linear algebra. Also see the strategic prefetching. Very nice!

Given what a monumental accomplishment this is, and how much interest there is in it, what would you think of the idea of us including it as a first party library in KOS-ports? That way it has the potential to reach the widest audience, we can add examples, we can ensure we don't break anything in KOS by maintaining and testing the examples, and it would be extremely easy for homebrew developers to utilize. :)
These users thanked the author GyroVorbis for the post (total 2):
Ian Robinson|darc|
User avatar
Ian Robinson
DC Developer
DC Developer
Posts: 116
Joined: Mon Mar 11, 2019 7:12 am
Has thanked: 209 times
Been thanked: 41 times

Re: pl_mpegDC ported running but community help needed

Post by Ian Robinson »

Twada wrote: Tue Sep 19, 2023 5:01 pm
Ian Robinson wrote: Tue Sep 19, 2023 10:48 am Can i put this up on my github course all credit to you :)
Thank you! Please.
I have fixed line 164 of mpeg1.c, so please download it again. The file name was not passed correctly.
here you go :)
https://github.com/ianmicheal/MPEG1-Dec ... /tree/main
These users thanked the author Ian Robinson for the post:
GyroVorbis
Twada
DC Developer
DC Developer
Posts: 42
Joined: Wed Jan 20, 2016 4:55 am
Has thanked: 18 times
Been thanked: 53 times

Re: pl_mpegDC ported running but community help needed

Post by Twada »

Ian Robinson wrote: Tue Sep 19, 2023 9:53 pm here you go :)
https://github.com/ianmicheal/MPEG1-Dec ... /tree/main
Thank you, Ian, for uploading it to GitHub!
Thank you for all the hard work you put into fixing and uploading the Readme.
I would be happy if many people could use it as they like.
GyroVorbis wrote: Tue Sep 19, 2023 9:43 pm Given what a monumental accomplishment this is, and how much interest there is in it, what would you think of the idea of us including it as a first party library in KOS-ports? That way it has the potential to reach the widest audience, we can add examples, we can ensure we don't break anything in KOS by maintaining and testing the examples, and it would be extremely easy for homebrew developers to utilize. :)
We would be honored if you could add us to Kos-Ports! Please feel free to use it!
Ah, but now that I think about it, I haven't explicitly reset the sound callback's static variable, so it might cause some audio lag when playing continuously.
Also, it may be necessary to add software reset (ABXY+START) processing.
I think more improvements are needed to make it first party.
These users thanked the author Twada for the post (total 2):
Ian RobinsonGyroVorbis
User avatar
Ian Robinson
DC Developer
DC Developer
Posts: 116
Joined: Mon Mar 11, 2019 7:12 am
Has thanked: 209 times
Been thanked: 41 times

Re: pl_mpegDC ported running but community help needed

Post by Ian Robinson »

Twada wrote: Tue Sep 19, 2023 10:56 pm
Ian Robinson wrote: Tue Sep 19, 2023 9:53 pm here you go :)
https://github.com/ianmicheal/MPEG1-Dec ... /tree/main
Thank you, Ian, for uploading it to GitHub!
Thank you for all the hard work you put into fixing and uploading the Readme.
I would be happy if many people could use it as they like.
GyroVorbis wrote: Tue Sep 19, 2023 9:43 pm Given what a monumental accomplishment this is, and how much interest there is in it, what would you think of the idea of us including it as a first party library in KOS-ports? That way it has the potential to reach the widest audience, we can add examples, we can ensure we don't break anything in KOS by maintaining and testing the examples, and it would be extremely easy for homebrew developers to utilize. :)
We would be honored if you could add us to Kos-Ports! Please feel free to use it!
Ah, but now that I think about it, I haven't explicitly reset the sound callback's static variable, so it might cause some audio lag when playing continuously.
Also, it may be necessary to add software reset (ABXY+START) processing.
I think more improvements are needed to make it first party.
Do you think with this it would be possible to add function for pause/resume a movie ? ..
These users thanked the author Ian Robinson for the post:
GyroVorbis
User avatar
GyroVorbis
Elysian Shadows Developer
Elysian Shadows Developer
Posts: 1874
Joined: Mon Mar 22, 2004 4:55 pm
Location: #%^&*!!!11one Super Sonic
Has thanked: 80 times
Been thanked: 62 times
Contact:

Re: pl_mpegDC ported running but community help needed

Post by GyroVorbis »

Twada wrote:We would be honored if you could add us to Kos-Ports! Please feel free to use it!
Thank you so much on behalf of everyone! I think this will be an incredibly useful port in the future!
Twada wrote: Tue Sep 19, 2023 10:56 pm Ah, but now that I think about it, I haven't explicitly reset the sound callback's static variable, so it might cause some audio lag when playing continuously.
Also, it may be necessary to add software reset (ABXY+START) processing.
I think more improvements are needed to make it first party.
Oh yeah, this is totally expected. After all, you just barely got the thing up and working! I figured there would be some polishing that would need to be done. I've added a task to the KOS backlog for helping to get this ready to be added as a KOS-Port! :mrgreen:
These users thanked the author GyroVorbis for the post:
Ian Robinson
Post Reply