DOSBox ECE (for Windows & Linux)

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Re: DOSBox ECE (for Windows)

Postby krcroft » 2018-11-17 @ 23:58

James-F wrote:Excellent work btw, I use Opus plenty, but not in dosbox yet.


I've enjoyed reading your audio-related posts. One of the benefits Opus adds to DOSBox is avoiding resampling along the software and audio hardware chain, because almost all modern DACs use 48kHz as their native rate.

If you set DOSBox's mixer rate to 48kHz in your dosbox-SVN.conf, and then mount your Opus+CUE, the patch ensures PCM samples are passed through at least up to the edge of the audio driver, at which point the samples should continue at 48kHz clean through the remaining digital HW chain.

Where as with 44.1kHz tracks, resampling to 48kHz will be performed (possibly poorly) at various points along the chain.

I haven't attempted to quantitize those losses compare to the pure-passthrough Opus scenario, but it would be interesting none the less!
User avatar
krcroft
Member
 
Posts: 128
Joined: 2017-4-29 @ 15:07
Location: Ogden's Retreat

Re: DOSBox ECE (for Windows)

Postby Yesterplay80 » 2018-11-18 @ 03:12

James-F wrote:@Yesterplay80
Do you still add patches manually or you use some script to apply them all and compile with one click?
I'd imagine it takes a lot of your time patching them one by one each new SVN.

When applying new or changed patches I apply them manually one by one, to see if and where they interfere or fail. If there are no new or changed patches or when all is fine or corrected, I just run a shell script written by me in MinGW which applies them, compiles the binaries, zips them and uploads them on my Google Drive. I just check the output for errors.

krcroft wrote:I've updated the FLAC-Opus-MP3 patch to rev5, posted here:
viewtopic.php?f=41&t=62203&p=695839#p695839

This part of the patch is unnecessary since r4173 because Qbix commited this change to the source code:

Code: Select all
diff -x gui_tk -x zmbv -x '.git*' -x scripts -Naur src/dos/drives.cpp src/dos/drives.cpp
--- src/dos/drives.cpp   2018-07-10 14:10:03.000000000 -0700
+++ src/dos/drives.cpp   2018-11-17 12:38:12.016636474 -0800
@@ -132,7 +132,7 @@
       driveInfo.currentDisk = 0;
       DOS_Drive* disk = driveInfo.disks[driveInfo.currentDisk];
       Drives[currentDrive] = disk;
-      disk->Activate();
+      if (driveInfo.disks.size() > 1) disk->Activate();
    }
 }
 
My full-featured DOSBox SVN builds (without debugger) for Windows: Vanilla DOSBox and DOSBox ECE (Enhanced Community Edition)
User avatar
Yesterplay80
Member
 
Posts: 361
Joined: 2016-2-23 @ 11:02
Location: Germany

Re: DOSBox ECE (for Windows)

Postby krcroft » 2018-11-18 @ 03:38

Yesterplay80 wrote:This part of the patch is unnecessary since r4173 because Qbix commited this change to the source code:

Code: Select all
diff -x gui_tk -x zmbv -x '.git*' -x scripts -Naur src/dos/drives.cpp src/dos/drives.cpp
--- src/dos/drives.cpp   2018-07-10 14:10:03.000000000 -0700
+++ src/dos/drives.cpp   2018-11-17 12:38:12.016636474 -0800
@@ -132,7 +132,7 @@
       driveInfo.currentDisk = 0;
       DOS_Drive* disk = driveInfo.disks[driveInfo.currentDisk];
       Drives[currentDrive] = disk;
-      disk->Activate();
+      if (driveInfo.disks.size() > 1) disk->Activate();
    }
 }
 


Thanks for the heads up; will snip that from my side so it won't appear in the next revision.
User avatar
krcroft
Member
 
Posts: 128
Joined: 2017-4-29 @ 15:07
Location: Ogden's Retreat

Re: DOSBox ECE (for Windows)

Postby Dracolich » 2018-11-18 @ 21:40

I'm using Slackware Linux 14.2 and getting an error when compiling r4173. This is the first version that has failed to compile on my system.
Code: Select all
g++ -DHAVE_CONFIG_H -I. -I../../..  -Iinternal/ogg/include -Iinternal/opus/include -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT  -Wall -g -O2 -mno-ms-bitfields  -MT libdecoders_a-mp3.o -MD -MP -MF .deps/libdecoders_a-mp3.Tpo -c -o libdecoders_a-mp3.o `test -f 'mp3.cpp' || echo './'`mp3.cpp
mp3.cpp: In function ‘void load_seek_table(Sound_Sample*, std::vector<unsigned int>&)’:
mp3.cpp:229:46: error: no matching function for call to ‘std::basic_ifstream<char>::basic_ifstream(std::string&, const openmode&)’
         ifstream infile(filename, ios::binary);
                                              ^
In file included from mp3.cpp:30:0:
/usr/include/c++/5.5.0/fstream:495:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
       basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in
       ^
/usr/include/c++/5.5.0/fstream:495:7: note:   no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘const char*’
/usr/include/c++/5.5.0/fstream:481:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>]
       basic_ifstream() : __istream_type(), _M_filebuf()
       ^
/usr/include/c++/5.5.0/fstream:481:7: note:   candidate expects 0 arguments, 2 provided
/usr/include/c++/5.5.0/fstream:455:11: note: candidate: std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&)
     class basic_ifstream : public basic_istream<_CharT, _Traits>
           ^
/usr/include/c++/5.5.0/fstream:455:11: note:   candidate expects 1 argument, 2 provided
mp3.cpp:284:60: error: no matching function for call to ‘std::basic_ofstream<char>::basic_ofstream(std::string&, std::_Ios_Openmode)’
         ofstream outfile(filename, ios::trunc | ios::binary);
                                                            ^
In file included from mp3.cpp:30:0:
/usr/include/c++/5.5.0/fstream:697:7: note: candidate: std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
       basic_ofstream(const char* __s,
       ^
/usr/include/c++/5.5.0/fstream:697:7: note:   no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘const char*’
/usr/include/c++/5.5.0/fstream:682:7: note: candidate: std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits<char>]
       basic_ofstream(): __ostream_type(), _M_filebuf()
       ^
/usr/include/c++/5.5.0/fstream:682:7: note:   candidate expects 0 arguments, 2 provided
/usr/include/c++/5.5.0/fstream:656:11: note: candidate: std::basic_ofstream<char>::basic_ofstream(const std::basic_ofstream<char>&)
     class basic_ofstream : public basic_ostream<_CharT,_Traits>
           ^
/usr/include/c++/5.5.0/fstream:656:11: note:   candidate expects 1 argument, 2 provided
Makefile:504: recipe for target 'libdecoders_a-mp3.o' failed
make[4]: *** [libdecoders_a-mp3.o] Error 1

It looks like my c compiler is missing some functions needed to build libdecoders_a-mp3. My gcc version is 5.5.0, the most recent for Slackware 14.2, released during Feb 2018. There is an 8.2.0 in the -current repo but it's bad to mix -current with the stable 14.2
Dracolich
Newbie
 
Posts: 39
Joined: 2017-8-07 @ 13:45

Re: DOSBox ECE (for Windows)

Postby krcroft » 2018-11-19 @ 04:08

Dracolich wrote:It looks like my c compiler is missing some functions needed to build libdecoders_a-mp3. My gcc version is 5.5.0, the most recent for Slackware 14.2, released during Feb 2018. There is an 8.2.0 in the -current repo but it's bad to mix -current with the stable 14.2

Dracolich, sorry for the hassle, and thanks for the report! I tried reproducing the issue by installing GCC 5.5 and 4.9 (using pacaur on an ARCH system), but unfortunately both compilers built it clean. I've made two changes to the fstream instantiations: switched to using std::ios_base, and to using const char* instead of std::string's (thanks Qbix).

Would you be able to try another build with the update? If it runs clean for you then we can recommend the improvement to Yesterplay80.

1. Download the baseline DOSBox r4173 source from: http://source.dosbox.com/dosboxsvn.tgz
2. Download the updated patch: download/file.php?id=55658
3. Sitting into your extracted dosbox source directory, run: zcat /path/to/dosbox-r4173-internal_codecs-rev7.patch.gz | patch -p1
4. Build as usual: ./autogen.sh && ./configure && make -j $(nproc)
Last edited by krcroft on 2018-11-19 @ 17:29, edited 3 times in total.
User avatar
krcroft
Member
 
Posts: 128
Joined: 2017-4-29 @ 15:07
Location: Ogden's Retreat

Re: DOSBox ECE (for Windows)

Postby Qbix » 2018-11-19 @ 09:16

judging from the error, without looking at the error, isn't just a .c_str() needed to the infile ?
I might be wrong as without looking at the code, I could be thinking of the wrong thing.
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10694
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: DOSBox ECE (for Windows)

Postby krcroft » 2018-11-19 @ 16:38

Qbix wrote:judging from the error, without looking at the error, isn't just a .c_str() needed to the infile ?
I might be wrong as without looking at the code, I could be thinking of the wrong thing.

Thanks for the closer inspection Qbix, I think you're right as well after double checking the error. I've switched to pure const char*'s.

Dracolich, I've update the patch to 'rev7' and edited my prior post. Tested with gcc 4.9, 5.5, 6.4, 7.3, and 8.2. Curious if your build also passes.
User avatar
krcroft
Member
 
Posts: 128
Joined: 2017-4-29 @ 15:07
Location: Ogden's Retreat

Re: DOSBox ECE (for Windows)

Postby Dracolich » 2018-11-19 @ 17:49

Thanks so much for the quick responses and the patch. I will try it this evening after work.
Dracolich
Newbie
 
Posts: 39
Joined: 2017-8-07 @ 13:45

Re: DOSBox ECE (for Windows)

Postby Dracolich » 2018-11-20 @ 04:02

I've tried building dosbox again. Thank you, krcroft, for the links. I had not tried building vanilla dosboxsvn yesterday. The vanilla builds successfully with and without your patch. The errors I get are when attempting to build the ECE r4173 - something wrong with my version of fstream that is being called by mp3.cpp. It did not happen in 4168 or earlier.
Dracolich
Newbie
 
Posts: 39
Joined: 2017-8-07 @ 13:45

Re: DOSBox ECE (for Windows)

Postby krcroft » 2018-11-20 @ 04:28

Dracolich wrote:I've tried building dosbox again. Thank you, krcroft, for the links. I had not tried building vanilla dosboxsvn yesterday. The vanilla builds successfully with and without your patch. The errors I get are when attempting to build the ECE r4173 - something wrong with my version of fstream that is being called by mp3.cpp. It did not happen in 4168 or earlier.


Perfect; this is expected because the rev7 patch you tested hasn't been applied to ECE r4173 yet, but your good news bodes well. Yesterplay80 - I think we're all set to move to rev7 of the codec patch. Best regards.
User avatar
krcroft
Member
 
Posts: 128
Joined: 2017-4-29 @ 15:07
Location: Ogden's Retreat

Re: DOSBox ECE (for Windows)

Postby Yesterplay80 » 2018-11-20 @ 08:32

New binaries and source archives based on r4175 and your patch rev. 7 are online!
My full-featured DOSBox SVN builds (without debugger) for Windows: Vanilla DOSBox and DOSBox ECE (Enhanced Community Edition)
User avatar
Yesterplay80
Member
 
Posts: 361
Joined: 2016-2-23 @ 11:02
Location: Germany

Re: DOSBox ECE (for Windows)

Postby pantercat » 2018-11-20 @ 12:34

Hello everyone, I found a small bug compiling ECE r4175. I'm using debian testing.

If I extract DOSBox ECE r4175 (Linux source).7z and compile it from a directory with spaces (ie '/home/user/dosbox ece r4173/'), the compilation ends with the following error:

/bin/mkdir -p '/home/user/dosbox ece r4173/src/libs/decoders/internal/lib'
/bin/bash ../libtool --mode=install /usr/bin/install -c libogg.la '/home/user/dosbox ece r4173/src/libs/decoders/internal/lib'
libtool: install: /usr/bin/install -c .libs/libogg.lai /home/user/dosbox ece r4173/src/libs/decoders/internal/lib/libogg.la
/usr/bin/install: target 'r4173/src/libs/decoders/internal/lib/libogg.la' is not a directory
make[8]: *** [Makefile:410: install-libLTLIBRARIES] Error 1

If I extract ECE and compile it from a directory without spaces, the compilation ends well.

It seems that some var is missing its '' so that it expands to '/home/user/dosbox ece r4173/src/libs/decoders/internal/lib/libogg.la' instead of 'r4173/src/libs/decoders/internal/lib/libogg.la'

r4165 (at least) and previous versions are not affected

Regards
pantercat
Newbie
 
Posts: 7
Joined: 2018-9-06 @ 17:22

Re: DOSBox ECE (for Windows)

Postby Dracolich » 2018-11-20 @ 13:05

Thanks, guys, ECE r4175 builds and works great now! :cool:
Dracolich
Newbie
 
Posts: 39
Joined: 2017-8-07 @ 13:45

Re: DOSBox ECE (for Windows)

Postby krcroft » 2018-11-20 @ 22:26

pantercat, thanks for the bug report regarding compiling inside a directory with one or more spaces.

This is a known auto-tools issue reported during the ./configure phase of the Opus dependencies. They warn that libtool does not properly handle current-working-directories with spaces, and indeed the failure occurs when they make install to a properly quoted "$(CURDIR)" prefix.

To fix this, I now avoid using --prefix="$(CURDIR)" and make install all together, and instead simply copy out the handful of library and header dependencies after make succeeds.

I've confirmed the build runs clean inside directories with spaces. If you want to try it, patch the latest DOSBox r4175 source with the rev8 patch attached here: viewtopic.php?f=41&t=62203
(Direct link to the patch: download/file.php?id=55737)
User avatar
krcroft
Member
 
Posts: 128
Joined: 2017-4-29 @ 15:07
Location: Ogden's Retreat

Re: DOSBox ECE (for Windows)

Postby pantercat » 2018-11-22 @ 19:04

Actually "./autogen.sh && ./configure && make" was enough to get the error.

Thanks for the updated patch. I patched dosbox r4175 with rev8 patch and "make" ends successfully inside dirs with spaces.
pantercat
Newbie
 
Posts: 7
Joined: 2018-9-06 @ 17:22

Re: DOSBox ECE (for Windows)

Postby krcroft » 2018-11-22 @ 19:56

Thanks for the confirmation!
User avatar
krcroft
Member
 
Posts: 128
Joined: 2017-4-29 @ 15:07
Location: Ogden's Retreat

Re: DOSBox ECE (for Windows)

Postby troydm » 2018-11-26 @ 22:22

I've just compiled DOSBox ECE r4176 on my Raspberry Pi 3 B+ running Raspbian and it runs flawlessly. Compiled out of the box without any changes. I had previously installed munt 2.3.0 before so had mt32emu library with headers. Thank you so much for the linux build.
This might be integrated into RetroPie one day.

P.S. for Dosbox keyboard to work correctly when starting directly from console (without X desktop) had to set use-scancodes=false configuration option, otherwise keyboard is messed up (it's a well known dosbox workaround)
troydm
Newbie
 
Posts: 7
Joined: 2018-11-26 @ 22:16
Location: Kiev

Re: DOSBox ECE (for Windows)

Postby Yesterplay80 » 2018-11-27 @ 06:57

troydm wrote:I've just compiled DOSBox ECE r4176 on my Raspberry Pi 3 B+ running Raspbian and it runs flawlessly. Compiled out of the box without any changes. I had previously installed munt 2.3.0 before so had mt32emu library with headers. Thank you so much for the linux build.

You're welcome! Great to know it runs on the Pi as well, thanks!
My full-featured DOSBox SVN builds (without debugger) for Windows: Vanilla DOSBox and DOSBox ECE (Enhanced Community Edition)
User avatar
Yesterplay80
Member
 
Posts: 361
Joined: 2016-2-23 @ 11:02
Location: Germany

Re: DOSBox ECE (for Windows)

Postby troydm » 2018-11-27 @ 16:59

Forgot to mention, it would be nice to add output gain and reverb output gain settings as I had to manually set them in midi_mt32.cpp using setOutputGain and setReverbOutputGain methods on Synth object and recompile dosbox ece. Also for future contribution/development it would be nice to have github repository so we could make fix/improvement contributions via PR requests and better track source code changes
troydm
Newbie
 
Posts: 7
Joined: 2018-11-26 @ 22:16
Location: Kiev

Re: DOSBox ECE (for Windows)

Postby aardvark82 » 2018-11-28 @ 08:10

Is it possible to change the fluidsynth volume?
aardvark82
Newbie
 
Posts: 4
Joined: 2017-6-08 @ 09:41

PreviousNext

Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 1 guest