fixed 16bit playback. DMA page reg expects the page unshifted
authorJohn Tsiombikas <nuclear@member.fsf.org>
Sun, 3 Feb 2019 02:25:29 +0000 (04:25 +0200)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Sun, 3 Feb 2019 02:25:29 +0000 (04:25 +0200)
src/dma.c
src/main.c

index 56ec5d9..3ff5fd0 100644 (file)
--- a/src/dma.c
+++ b/src/dma.c
@@ -42,6 +42,7 @@ void dma_in(int chan, uint32_t phyaddr, int size, unsigned int flags)
 static void dma_io(int chan, uint32_t phyaddr, int size, unsigned int flags, unsigned int dir)\r
 {\r
        unsigned int mode;\r
 static void dma_io(int chan, uint32_t phyaddr, int size, unsigned int flags, unsigned int dir)\r
 {\r
        unsigned int mode;\r
+       unsigned char page;\r
 \r
        mask(chan);\r
        outp(clrff_port[chan], 0);\r
 \r
        mask(chan);\r
        outp(clrff_port[chan], 0);\r
@@ -52,6 +53,8 @@ static void dma_io(int chan, uint32_t phyaddr, int size, unsigned int flags, uns
        if(flags & DMA_AUTO) mode |= MODE_AUTO;\r
        outp(mode_port[chan], mode);\r
 \r
        if(flags & DMA_AUTO) mode |= MODE_AUTO;\r
        outp(mode_port[chan], mode);\r
 \r
+       page = (phyaddr >> 16) & 0xff;\r
+\r
        if(IS_16BIT(chan)) {\r
                phyaddr >>= 1;\r
                size >>= 1;\r
        if(IS_16BIT(chan)) {\r
                phyaddr >>= 1;\r
                size >>= 1;\r
@@ -59,7 +62,7 @@ static void dma_io(int chan, uint32_t phyaddr, int size, unsigned int flags, uns
 \r
        outp(addr_port[chan], phyaddr & 0xff);\r
        outp(addr_port[chan], (phyaddr >> 8) & 0xff);\r
 \r
        outp(addr_port[chan], phyaddr & 0xff);\r
        outp(addr_port[chan], (phyaddr >> 8) & 0xff);\r
-       outp(page_port[chan], (phyaddr >> 16) & 0xff);\r
+       outp(page_port[chan], page);\r
 \r
        size--;\r
        outp(count_port[chan], size & 0xff);\r
 \r
        size--;\r
        outp(count_port[chan], size & 0xff);\r
index 8fa1126..f8ca49d 100644 (file)
@@ -12,7 +12,7 @@ static int play_file(const char *fname);
 static int cbfunc(void *buf, int size, void *cls);\r
 static void print_usage(const char *argv0);\r
 \r
 static int cbfunc(void *buf, int size, void *cls);\r
 static void print_usage(const char *argv0);\r
 \r
-static int vol = 220;\r
+static int vol = 255;\r
 static int quit;\r
 \r
 int main(int argc, char **argv)\r
 static int quit;\r
 \r
 int main(int argc, char **argv)\r
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
        if(audio_init() == -1) {\r
                return 1;\r
        }\r
        if(audio_init() == -1) {\r
                return 1;\r
        }\r
-       audio_setvolume(AUDIO_MASTER, vol);\r
+       audio_setvolume(AUDIO_MASTER, 255);\r
        audio_setvolume(AUDIO_PCM, 255);\r
 \r
        for(i=1; i<argc; i++) {\r
        audio_setvolume(AUDIO_PCM, 255);\r
 \r
        for(i=1; i<argc; i++) {\r