From: Geert U. <ge...@li...> - 2000-10-05 17:12:23
|
On Tue, 26 Sep 2000, Geert Uytterhoeven wrote: > On Mon, 25 Sep 2000, Alan Buxey wrote: > > PS on the sound subject, I'm locating the info for how to get the sound to > > operate at 44KHz instead of the standard 22 of AGA (bootstrap line > > required) but cant locate it > > You need to program htotal for a 31 kHz mode. > > Once I was working on a patch for that, but I haven't finished it yet. I'll > dig for it when I find some time... My original idea was to request_mem_region() the Denise/Lisa registers in dmasound_paula_init() and program a 31 kHz mode when amifb is not active. However, then I came up with this simpler solution: just setup a 31 kHz mode in amiga_init_sound(). If amifb is used, it will be initialized later and override the mode. If it's not used, you keep on having 56 kHz sound (and no video output on the Amiga graphics output). There's one disadvantage of this method: in the rare occasion you have a modular amifb and rmmod amifb, you cannot get the high quality sound back. With the original idea, you could (rmmod and) insmod dmasound_paula. What do you prefer? Oh, and anybody who'd like to test this patch (no testing done, not even a compile test)? Preferably someone who has a monitor (with insurance :-) on the Amiga graphics output as well... Good luck! --- linux-2.4.0-test9/arch/m68k/amiga/amisound.c Fri Jul 28 21:19:00 2000 +++ geert-31kHz-2.4.0-test9/arch/m68k/amiga/amisound.c Thu Oct 5 17:18:26 2000 @@ -51,6 +51,18 @@ /* setup divisor */ clock_constant = (amiga_colorclock+DATA_SIZE/2)/DATA_SIZE; + + if (amiga_chipset == CS_ECS || amiga_chipset == CS_AGA) { + /* program Denise/Lisa for a higher maximum play rate */ + /* (may be overridden by amifb later) */ + custom.htotal = 113; /* 31 kHz */ + custom.vtotal = 223; /* 70 Hz */ + custom.beamcon0 = 0x4390; /* HARDDIS, VAR{BEAM,VSY,HSY,CSY}EN */ + /* suspend the monitor */ + custom.hsstrt = custom.hsstop = 116; + custom.vsstrt = custom.vsstop = 226; + amiga_audio_min_period = 57; + } } static void nosound( unsigned long ignored ); Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds |
From: Michel <dae...@st...> - 2000-10-06 09:49:36
|
Frank Petzold wrote: > > On Thu, Oct 05, 2000 at 05:27:22PM +0200, Geert Uytterhoeven wrote: > > There's one disadvantage of this method: in the rare occasion you have a > > modular amifb and rmmod amifb, you cannot get the high quality sound back. > > With the original idea, you could (rmmod and) insmod dmasound_paula. Why even the need to reinitialize the sound module? Isn't it possible to set the mode each time the sound device is opened or similar? > > What do you prefer? > > You should not rely on the order of initialization of things anywhere. True. Michel -- Earthling Michel Dänzer (MrCooper) \ CS student and free software enthusiast Debian GNU/Linux (powerpc,i386) user \ member of XFree86 and The DRI Project |
From: Geert U. <ge...@li...> - 2000-10-06 17:41:46
|
On Fri, 6 Oct 2000, Michel [iso-8859-1] Dänzer wrote: > Frank Petzold wrote: > > On Thu, Oct 05, 2000 at 05:27:22PM +0200, Geert Uytterhoeven wrote: > > > There's one disadvantage of this method: in the rare occasion you have a > > > modular amifb and rmmod amifb, you cannot get the high quality sound back. > > > With the original idea, you could (rmmod and) insmod dmasound_paula. > > Why even the need to reinitialize the sound module? Isn't it possible to set > the mode each time the sound device is opened or similar? Good idea! > > > What do you prefer? > > > > You should not rely on the order of initialization of things anywhere. > > True. Which is difficult if different functionalities depend on common hardware settings. New try. Now the code is in AmiInit(). Perhaps we should replace the {request,release}_mem_region() stuff with some simpler access method, but that requires changes to amifb as well. For now I'd like to know whether the custom chip programming below works, if amifb is not compiled in or disabled (video=amifb:off). Thanks for testing! --- linux-2.4.0-test9/drivers/sound/dmasound/dmasound_paula.c Tue Jul 18 13:54:40 2000 +++ geert-31kHz-2.4.0-test9/drivers/sound/dmasound/dmasound_paula.c Fri Oct 6 17:12:01 2000 @@ -27,8 +27,6 @@ /* * The minimum period for audio depends on htotal (for OCS/ECS/AGA) * (Imported from arch/m68k/amiga/amisound.c) - * - * FIXME: if amifb is not used, there should be a method to change htotal */ extern volatile u_short amiga_audio_min_period; @@ -366,6 +364,21 @@ int period, i; AmiSilence(); + + if ((amiga_chipset == CS_ECS || amiga_chipset == CS_AGA) && + amiga_audio_min_period > 57 && + request_mem_region(CUSTOM_PHYSADDR+0xe0, 0x120, "31 kHz hack")) { + /* program Denise/Lisa for a higher maximum play rate */ + /* (may be overridden by amifb) */ + custom.htotal = 113; /* 31 kHz */ + custom.vtotal = 223; /* 70 Hz */ + custom.beamcon0 = 0x4390; /* HARDDIS, VAR{BEAM,VSY,HSY,CSY}EN */ + /* suspend the monitor */ + custom.hsstrt = custom.hsstop = 116; + custom.vsstrt = custom.vsstop = 226; + amiga_audio_min_period = 57; + release_mem_region(CUSTOM_PHYSADDR+0xe0, 0x120); + } if (dmasound.soft.speed) period = amiga_colorclock/dmasound.soft.speed-1; Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds |
From: Glenn H. <gh...@c2...> - 2000-10-08 00:27:31
|
Hello, On 06-Oct-2000, Geert wrote: > New try. Now the code is in AmiInit(). > For now I'd like to know whether the custom chip programming below works, > if amifb is not compiled in or disabled (video=amifb:off). I tried this with a 2.4.0-test8 kernel without amifb support compiled in, and it seems to work fine (I haven't done a lot of testing, but everything I tried worked). Finally we can get high quality sound without the need to switch consoles :-) - glenn |
From: <fp...@zu...> - 2000-10-06 08:58:51
|
On Thu, Oct 05, 2000 at 05:27:22PM +0200, Geert Uytterhoeven wrote: > There's one disadvantage of this method: in the rare occasion you have a > modular amifb and rmmod amifb, you cannot get the high quality sound back. > With the original idea, you could (rmmod and) insmod dmasound_paula. > > What do you prefer? You should not rely on the order of initialization of things anywhere. -- Frank Petzold, IBM Zurich Research Laboratory, Säumerstrasse 4, CH-8803 Rüschlikon/Switzerland, Tel. +41-1-724-84-42 Fax. +41-1-724-89-56 Business email: fp...@zu... Private email: pe...@he... The opinions expressed here are mine and not necessarily those of IBM. |
From: Roman Z. <zi...@fh...> - 2000-10-06 11:28:08
|
Hi, On Thu, 5 Oct 2000, Geert Uytterhoeven wrote: > There's one disadvantage of this method: in the rare occasion you have a > modular amifb and rmmod amifb, you cannot get the high quality sound back. > With the original idea, you could (rmmod and) insmod dmasound_paula. We can also make it a inline function and call it from cleanup_module(), too. > Oh, and anybody who'd like to test this patch (no testing done, not even a > compile test)? Preferably someone who has a monitor (with insurance :-) on the > Amiga graphics output as well... We should make it depending on wether amifb is compiled in or not, otherwise during every boot you restart, you turn off the monitor for a short period. IMO this should only be done for amifb:off. bye, Roman |