* Re: Dreamcast AICA driver [not found] <1142124747.9496.50.camel@localhost.localdomain> @ 2006-03-12 1:11 ` Lee Revell 2006-03-12 1:20 ` Adrian McMenamin 0 siblings, 1 reply; 15+ messages in thread From: Lee Revell @ 2006-03-12 1:11 UTC (permalink / raw) To: Adrian McMenamin; +Cc: linux-sh, alsa-devel On Sun, 2006-03-12 at 00:52 +0000, Adrian McMenamin wrote: > After a mere three years in development I now have a working (mono only > for now) ALSA driver for the Dreamcast driver to test. > > Sources are available for browsing at: > > http://newgolddream.dyndns.info/cgi-bin/cvsweb > > > If there are any testers out there please let me know! Cool, what did you have to do to get it working? Lee ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Dreamcast AICA driver 2006-03-12 1:11 ` Dreamcast AICA driver Lee Revell @ 2006-03-12 1:20 ` Adrian McMenamin 2006-03-12 6:14 ` Lee Revell ` (2 more replies) 0 siblings, 3 replies; 15+ messages in thread From: Adrian McMenamin @ 2006-03-12 1:20 UTC (permalink / raw) To: Lee Revell; +Cc: linux-sh, alsa-devel On Sat, 2006-03-11 at 20:11 -0500, Lee Revell wrote: > On Sun, 2006-03-12 at 00:52 +0000, Adrian McMenamin wrote: > > After a mere three years in development I now have a working (mono only > > for now) ALSA driver for the Dreamcast driver to test. > > > > Sources are available for browsing at: > > > > http://newgolddream.dyndns.info/cgi-bin/cvsweb > > > > > > If there are any testers out there please let me know! > > Cool, what did you have to do to get it working? Key point was to switch to timer polling. It turned out there were issues with the ARM7 firmware and interrupts that meant it behaved in odd ways and essentially didn't work :) So I still use DMA to transfer the samples, but I use timer polling to test how much has been played ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Dreamcast AICA driver 2006-03-12 1:20 ` Adrian McMenamin @ 2006-03-12 6:14 ` Lee Revell 2006-03-12 6:28 ` Lee Revell 2006-03-12 11:00 ` Adrian McMenamin 2006-03-12 6:32 ` Lee Revell 2006-03-12 6:38 ` Lee Revell 2 siblings, 2 replies; 15+ messages in thread From: Lee Revell @ 2006-03-12 6:14 UTC (permalink / raw) To: Adrian McMenamin; +Cc: linux-sh, alsa-devel On Sun, 2006-03-12 at 01:20 +0000, Adrian McMenamin wrote: > On Sat, 2006-03-11 at 20:11 -0500, Lee Revell wrote: > > On Sun, 2006-03-12 at 00:52 +0000, Adrian McMenamin wrote: > > > After a mere three years in development I now have a working (mono only > > > for now) ALSA driver for the Dreamcast driver to test. > > > > > > Sources are available for browsing at: > > > > > > http://newgolddream.dyndns.info/cgi-bin/cvsweb > > > > > > > > > If there are any testers out there please let me know! > > > > Cool, what did you have to do to get it working? > > > Key point was to switch to timer polling. It turned out there were > issues with the ARM7 firmware and interrupts that meant it behaved in > odd ways and essentially didn't work :) > > So I still use DMA to transfer the samples, but I use timer polling to > test how much has been played > Great!!! I am really glad you finally got this to work - your plight reminded me of trying to develop the emu10k1 multichannel support, when I knew nothing about ALSA drivers, and only had existing driver and reverse engineered hardware docs... You should submit this to ALSA now, as a patch against CVS... Lee ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Dreamcast AICA driver 2006-03-12 6:14 ` Lee Revell @ 2006-03-12 6:28 ` Lee Revell 2006-03-12 10:59 ` Adrian McMenamin [not found] ` <1142161181.9555.3.camel@localhost.localdomain> 2006-03-12 11:00 ` Adrian McMenamin 1 sibling, 2 replies; 15+ messages in thread From: Lee Revell @ 2006-03-12 6:28 UTC (permalink / raw) To: Adrian McMenamin; +Cc: linux-sh, alsa-devel On Sun, 2006-03-12 at 01:14 -0500, Lee Revell wrote: > You should submit this to ALSA now, as a patch against CVS... static int snd_aicapcm_free(snd_card_aica_t *dreamcastcard) { release_mem_region(0xa0702c00, 0x4); release_mem_region(0xa0800000, 0x200000); return 0; } Actually this driver still has way too many magic numbers - if you're not exactly sure what a constant does then document it with comments in the header file. It looks like many of these will be trivial to document: if (request_mem_region(0xa0702c00, 4, "AICA ARM control")== NULL) return -ENOMEM; if (request_mem_region(0xa0800000, 0x200000, "AICA Sound RAM") == NULL) Lee ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Dreamcast AICA driver 2006-03-12 6:28 ` Lee Revell @ 2006-03-12 10:59 ` Adrian McMenamin [not found] ` <1142161181.9555.3.camel@localhost.localdomain> 1 sibling, 0 replies; 15+ messages in thread From: Adrian McMenamin @ 2006-03-12 10:59 UTC (permalink / raw) To: Lee Revell; +Cc: linux-sh, alsa-devel On Sun, 2006-03-12 at 01:28 -0500, Lee Revell wrote: > On Sun, 2006-03-12 at 01:14 -0500, Lee Revell wrote: > > You should submit this to ALSA now, as a patch against CVS... > > > static int snd_aicapcm_free(snd_card_aica_t *dreamcastcard) > { > release_mem_region(0xa0702c00, 0x4); > release_mem_region(0xa0800000, 0x200000); > return 0; > } > > Actually this driver still has way too many magic numbers - if you're > not exactly sure what a constant does then document it with comments in > the header file. > I know what these are - they can be turned into constants - they are either references to the ARM7 register bank or the ARM7 memory space. > It looks like many of these will be trivial to document: > > if (request_mem_region(0xa0702c00, 4, "AICA ARM control")== NULL) return -ENOMEM; > if (request_mem_region(0xa0800000, 0x200000, "AICA Sound RAM") == NULL) > > Lee > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/alsa-devel ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <1142161181.9555.3.camel@localhost.localdomain>]
* Re: Dreamcast AICA driver [not found] ` <1142161181.9555.3.camel@localhost.localdomain> @ 2006-03-12 12:02 ` James Courtier-Dutton 2006-03-12 12:16 ` Adrian McMenamin 0 siblings, 1 reply; 15+ messages in thread From: James Courtier-Dutton @ 2006-03-12 12:02 UTC (permalink / raw) To: Adrian McMenamin; +Cc: Lee Revell, linux-sh, alsa-devel Adrian McMenamin wrote: > I know what these are - they can be turned into constants - they are > either references to the ARM7 register bank or the ARM7 memory space. > > > >> It looks like many of these will be trivial to document: >> >> if (request_mem_region(0xa0702c00, 4, "AICA ARM control")== NULL) return -ENOMEM; >> if (request_mem_region(0xa0800000, 0x200000, "AICA Sound RAM") == NULL) >> >> Lee >> >> Adrian, It was good to talk to you on IRC. Now, as you have the source code for the ARM7 firmware as well as the SH4 driver code, it might be sensible to highlight the dependencies between them, by maybe using the same human readable constant name in both bits of code. It also makes things easier to understand if the hex addresses are given as offsets from some sort of base. if (request_mem_region(0xa0702c00, 4, "AICA ARM control")== NULL) return -ENOMEM; then becomes in a .h file: #define ARM7_BASE_MEM 0xa0700000 #define ARM7_AICA_CONTROL 0x2c00 During driver init: base_mem = ARM7_BASE_MEM if (request_mem_region(base_mem + ARM7_AICA_CONTROL, 4, "AICA ARM control")== NULL) return -ENOMEM; This would then allow movement of the base_mem without much modification to the driver code, if for example the ARM7 firmware required the change. James ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Dreamcast AICA driver 2006-03-12 12:02 ` James Courtier-Dutton @ 2006-03-12 12:16 ` Adrian McMenamin 0 siblings, 0 replies; 15+ messages in thread From: Adrian McMenamin @ 2006-03-12 12:16 UTC (permalink / raw) To: James Courtier-Dutton; +Cc: Lee Revell, linux-sh, alsa-devel On Sun, 2006-03-12 at 12:02 +0000, James Courtier-Dutton wrote: > Adrian, > > It was good to talk to you on IRC. Now, as you have the source code for > the ARM7 firmware as well as the SH4 driver code, it might be sensible > to highlight the dependencies between them, by maybe using the same > human readable constant name in both bits of code. It also makes things > easier to understand if the hex addresses are given as offsets from some > sort of base. > > if (request_mem_region(0xa0702c00, 4, "AICA ARM control")== NULL) return -ENOMEM; > > then becomes in a .h file: > #define ARM7_BASE_MEM 0xa0700000 > #define ARM7_AICA_CONTROL 0x2c00 > > During driver init: > base_mem = ARM7_BASE_MEM > > if (request_mem_region(base_mem + ARM7_AICA_CONTROL, 4, "AICA ARM control")== NULL) return -ENOMEM; > > This would then allow movement of the base_mem without much modification to the driver code, if for example the ARM7 firmware required the change. Sure. I understand the point of course ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Dreamcast AICA driver 2006-03-12 6:14 ` Lee Revell 2006-03-12 6:28 ` Lee Revell @ 2006-03-12 11:00 ` Adrian McMenamin 1 sibling, 0 replies; 15+ messages in thread From: Adrian McMenamin @ 2006-03-12 11:00 UTC (permalink / raw) To: Lee Revell; +Cc: linux-sh, alsa-devel On Sun, 2006-03-12 at 01:14 -0500, Lee Revell wrote: > > You should submit this to ALSA now, as a patch against CVS... > > Lee A bit more tidying to be done as you say ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Dreamcast AICA driver 2006-03-12 1:20 ` Adrian McMenamin 2006-03-12 6:14 ` Lee Revell @ 2006-03-12 6:32 ` Lee Revell 2006-03-12 6:38 ` Lee Revell 2 siblings, 0 replies; 15+ messages in thread From: Lee Revell @ 2006-03-12 6:32 UTC (permalink / raw) To: Adrian McMenamin; +Cc: linux-sh, alsa-devel On Sun, 2006-03-12 at 01:20 +0000, Adrian McMenamin wrote: > http://newgolddream.dyndns.info/cgi-bin/cvsweb You should split this into a .c and .h file /* AICA channels stuff */ /* Command values */ #define AICA_CMD_KICK 0x80000000 #define AICA_CMD_NONE 0 #define AICA_CMD_START 1 #define AICA_CMD_STOP 2 #define AICA_CMD_VOL 3 /* Sound modes */ #define SM_8BIT 1 #define SM_16BIT 0 #define SM_ADPCM 2 etc Lee ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Dreamcast AICA driver 2006-03-12 1:20 ` Adrian McMenamin 2006-03-12 6:14 ` Lee Revell 2006-03-12 6:32 ` Lee Revell @ 2006-03-12 6:38 ` Lee Revell 2006-03-12 10:58 ` Adrian McMenamin 2006-03-12 20:35 ` Manuel Jander 2 siblings, 2 replies; 15+ messages in thread From: Lee Revell @ 2006-03-12 6:38 UTC (permalink / raw) To: Adrian McMenamin; +Cc: linux-sh, alsa-devel On Sun, 2006-03-12 at 01:20 +0000, Adrian McMenamin wrote: > > > http://newgolddream.dyndns.info/cgi-bin/cvsweb > > > > > dreamcastcard->clicks++; > if (dreamcastcard->clicks == 8) dreamcastcard->clicks = 0; dreamcastcard->clicks %= 8 ;-) > /* reschedule the timer */ > dreamcastcard->timer.expires = jiffies + 2; What exactly do you mean to do here - I suspect there's an unintended dependency on HZ. Do you intend to delay for $FOO ms? Lee ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Dreamcast AICA driver 2006-03-12 6:38 ` Lee Revell @ 2006-03-12 10:58 ` Adrian McMenamin 2006-03-12 20:35 ` Manuel Jander 1 sibling, 0 replies; 15+ messages in thread From: Adrian McMenamin @ 2006-03-12 10:58 UTC (permalink / raw) To: Lee Revell; +Cc: linux-sh, alsa-devel On Sun, 2006-03-12 at 01:38 -0500, Lee Revell wrote: > On Sun, 2006-03-12 at 01:20 +0000, Adrian McMenamin wrote: > > > > http://newgolddream.dyndns.info/cgi-bin/cvsweb > > > > > > > > > dreamcastcard->clicks++; > > if (dreamcastcard->clicks == 8) dreamcastcard->clicks = 0; > > dreamcastcard->clicks %= 8 > > ;-) > > > /* reschedule the timer */ > > dreamcastcard->timer.expires = jiffies + 2; > > What exactly do you mean to do here - I suspect there's an unintended > dependency on HZ. Do you intend to delay for $FOO ms? Just copied that off the dummy driver in the kernel but yes it's just an arbitrary delay ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Dreamcast AICA driver 2006-03-12 6:38 ` Lee Revell 2006-03-12 10:58 ` Adrian McMenamin @ 2006-03-12 20:35 ` Manuel Jander 2006-03-12 20:23 ` Adrian McMenamin 2006-03-13 11:48 ` Takashi Iwai 1 sibling, 2 replies; 15+ messages in thread From: Manuel Jander @ 2006-03-12 20:35 UTC (permalink / raw) To: Alsa-devel list Hi, On Sun, 2006-03-12 at 01:38 -0500, Lee Revell wrote: > On Sun, 2006-03-12 at 01:20 +0000, Adrian McMenamin wrote: > > > > http://newgolddream.dyndns.info/cgi-bin/cvsweb > > > > > > > > > dreamcastcard->clicks++; > > if (dreamcastcard->clicks == 8) dreamcastcard->clicks = 0; > > dreamcastcard->clicks %= 8; Watch out. The ARM7 does not support this in direct assembler. If the compiler is not smart enough it would require a division, and that is really realy slow on a any ARM processor. Helping the compiler by using dreamcastcard->clicks &= 0x00000003; ... would be a much faster option. Best Regards, Manuel. ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Dreamcast AICA driver 2006-03-12 20:35 ` Manuel Jander @ 2006-03-12 20:23 ` Adrian McMenamin 2006-03-13 11:48 ` Takashi Iwai 1 sibling, 0 replies; 15+ messages in thread From: Adrian McMenamin @ 2006-03-12 20:23 UTC (permalink / raw) To: Manuel Jander; +Cc: Alsa-devel list On Sun, 2006-03-12 at 21:35 +0100, Manuel Jander wrote: > Hi, > > On Sun, 2006-03-12 at 01:38 -0500, Lee Revell wrote: > > On Sun, 2006-03-12 at 01:20 +0000, Adrian McMenamin wrote: > > > > > http://newgolddream.dyndns.info/cgi-bin/cvsweb > > > > > > > > > > > > > dreamcastcard->clicks++; > > > if (dreamcastcard->clicks == 8) dreamcastcard->clicks = 0; > > > > dreamcastcard->clicks %= 8; > > Watch out. The ARM7 does not support this in direct assembler. If the > compiler is not smart enough it would require a division, and that is > really realy slow on a any ARM processor. > Helping the compiler by using > > dreamcastcard->clicks &= 0x00000003; > > ... would be a much faster option. > This was actually in SH4 code rather than ARM7, though I did have some fun and games with the ARM7 code - seemingly with division :) ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Dreamcast AICA driver 2006-03-12 20:35 ` Manuel Jander 2006-03-12 20:23 ` Adrian McMenamin @ 2006-03-13 11:48 ` Takashi Iwai 1 sibling, 0 replies; 15+ messages in thread From: Takashi Iwai @ 2006-03-13 11:48 UTC (permalink / raw) To: Manuel Jander; +Cc: Alsa-devel list At Sun, 12 Mar 2006 21:35:36 +0100, Manuel Jander wrote: > > Hi, > > On Sun, 2006-03-12 at 01:38 -0500, Lee Revell wrote: > > On Sun, 2006-03-12 at 01:20 +0000, Adrian McMenamin wrote: > > > > > http://newgolddream.dyndns.info/cgi-bin/cvsweb > > > > > > > > > > > > > dreamcastcard->clicks++; > > > if (dreamcastcard->clicks == 8) dreamcastcard->clicks = 0; > > > > dreamcastcard->clicks %= 8; > > Watch out. The ARM7 does not support this in direct assembler. If the > compiler is not smart enough it would require a division, and that is > really realy slow on a any ARM processor. > Helping the compiler by using > > dreamcastcard->clicks &= 0x00000003; Should be 7 instead of 3 :) BTW, you don't have to restrict the buffer size and period size as long as you have double-buffer, i.e. a buffer on CPU side and transfer to the h/w buffer. The only restricted parameter is the period size. For example, a buffer with 13 periods can be mapped like: BUF 0 ... 7 8 9 10 11 12 | 0 1 2 3 4 ... H/W 0 ... 7 0 1 2 3 4 | 5 6 7 0 1 ... Takashi ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Dreamcast AICA driver @ 2006-03-12 0:52 Adrian McMenamin 0 siblings, 0 replies; 15+ messages in thread From: Adrian McMenamin @ 2006-03-12 0:52 UTC (permalink / raw) To: linux-sh; +Cc: alsa-devel After a mere three years in development I now have a working (mono only for now) ALSA driver for the Dreamcast driver to test. Sources are available for browsing at: http://newgolddream.dyndns.info/cgi-bin/cvsweb If there are any testers out there please let me know! Adrian ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2006-03-13 11:48 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1142124747.9496.50.camel@localhost.localdomain>
2006-03-12 1:11 ` Dreamcast AICA driver Lee Revell
2006-03-12 1:20 ` Adrian McMenamin
2006-03-12 6:14 ` Lee Revell
2006-03-12 6:28 ` Lee Revell
2006-03-12 10:59 ` Adrian McMenamin
[not found] ` <1142161181.9555.3.camel@localhost.localdomain>
2006-03-12 12:02 ` James Courtier-Dutton
2006-03-12 12:16 ` Adrian McMenamin
2006-03-12 11:00 ` Adrian McMenamin
2006-03-12 6:32 ` Lee Revell
2006-03-12 6:38 ` Lee Revell
2006-03-12 10:58 ` Adrian McMenamin
2006-03-12 20:35 ` Manuel Jander
2006-03-12 20:23 ` Adrian McMenamin
2006-03-13 11:48 ` Takashi Iwai
2006-03-12 0:52 Adrian McMenamin
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.