Re: Changing hw.snd.pcm0.buffersize in 4.10.
On Wed, 15 Dec 2004 03:18:27 -0600, Nikolas Britton [EMAIL PROTECTED] said: Worked for me as well. Thanks. BTW, to change the buffer size for a CT5880 PCI sound card, the variable uses a slightly different naming convention. cat /dev/sndstat FreeBSD Audio Driver (newpcm) Installed devices: pcm0: Creative CT5880-C at io 0xef00 irq 11 (1p/1r/4v channels duplex) *** es137x.cSat Dec 18 00:55:25 2004 --- es137x.c.dist Sat Dec 18 00:49:28 2004 *** *** 88,94 #define CT4730REV_CT4730_A 0x00 ! #define ES_DEFAULT_BUFSZ 8192 /* device private data */ struct es_info; --- 88,94 #define CT4730REV_CT4730_A 0x00 ! #define ES_DEFAULT_BUFSZ 4096 /* device private data */ struct es_info; Note the one F in ES_DEFAULT_BUFSZ. This initially made it a little elusive to grep ;-) uname -a FreeBSD szamoca.krvarr.bc.ca 4.10-RELEASE FreeBSD 4.10-RELEASE #37: Sat Dec 18 00:58:04 PST 2004 sysctl -a | grep snd hw.snd.targetirqrate: 32 hw.snd.report_soft_formats: 1 hw.snd.verbose: 1 hw.snd.maxautovchans: 0 hw.snd.pcm0.buffersize: 8192 hw.snd.pcm0.vchans: 4 Thanks, Sandy Christian Hiris wrote: Yes, This Worked! stumbleine# pwd /usr/src/sys/dev/sound/isa stumbleine# diff ess.c ess.bak 41c41 #define ESS_BUFFSIZE (8192) --- #define ESS_BUFFSIZE (4096) stumbleine# diff sb16.c sb16.bak 41c41 #define SB16_BUFFSIZE8192 --- #define SB16_BUFFSIZE4096 Kernel Config file: optionsPNPBIOS devicepcm# Generic Sound Support device sbc0 at isa? port 0x220 irq 10 drq 1 stumbleine# dmesg | grep ESS sbc0: ESS 1688 at port 0x220-0x22f irq 10 drq 1 on isa0 pcm0: ESS 18xx DSP on sbc0 stumbleine# sysctl hw.snd hw.snd.targetirqrate: 32 hw.snd.report_soft_formats: 1 hw.snd.verbose: 1 hw.snd.maxautovchans: 0 hw.snd.pcm0.buffersize: 8192 hw.snd.pcm0.vchans: 0 stumbleine# uname -a FreeBSD stumbleine.intranet 4.10-STABLE FreeBSD 4.10-STABLE #3: Tue Dec 14 23:40:48 CST 2004 [EMAIL PROTECTED]:/usr/src/sys/compile/STUMBLEINE i386 ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Changing hw.snd.pcm0.buffersize in 4.10.
Christian Hiris wrote: AFAIK the define is named DSP_BUFFSIZE (in src/sys/dev/sound/pcm/sound.h. DSP_BUFFSIZE can be used to define the default buffersize for sound drivers, but most of the sound drivers use their own defines. If you want to change the default buffersize for a sound driver you need to search for a define like xxx_BUFFSIZE, where xxx is the name of the sound driver (maybe some developers use other naming-conventions). ie., if you want to change the default buffersize of the ESS driver you need to change the line #define ESS_BUFFSIZE (4096) in src/sys/dev/sound/isa/ess.c. If you use the sbc driver, you need to do this changes in sb8.c or sb16.c, depending on the soundcard you are using. sbc.c is only the code for the corresponding bridge driver. However, I'm not a guru, so I can't guess, if a driver works better with any other buffer size defined, than the original one. Yes, This Worked! stumbleine# pwd /usr/src/sys/dev/sound/isa stumbleine# diff ess.c ess.bak 41c41 #define ESS_BUFFSIZE (8192) --- #define ESS_BUFFSIZE (4096) stumbleine# diff sb16.c sb16.bak 41c41 #define SB16_BUFFSIZE8192 --- #define SB16_BUFFSIZE4096 Kernel Config file: optionsPNPBIOS devicepcm# Generic Sound Support device sbc0 at isa? port 0x220 irq 10 drq 1 stumbleine# dmesg | grep ESS sbc0: ESS 1688 at port 0x220-0x22f irq 10 drq 1 on isa0 pcm0: ESS 18xx DSP on sbc0 stumbleine# sysctl hw.snd hw.snd.targetirqrate: 32 hw.snd.report_soft_formats: 1 hw.snd.verbose: 1 hw.snd.maxautovchans: 0 hw.snd.pcm0.buffersize: 8192 hw.snd.pcm0.vchans: 0 stumbleine# uname -a FreeBSD stumbleine.intranet 4.10-STABLE FreeBSD 4.10-STABLE #3: Tue Dec 14 23:40:48 CST 2004 [EMAIL PROTECTED]:/usr/src/sys/compile/STUMBLEINE i386 ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Changing hw.snd.pcm0.buffersize in 4.10.
On Mon, 13 Dec 2004 12:03:15 -0600, Kevin D. Kinsey, DaleCo, S.P. [EMAIL PROTECTED] said: I wonder if it wouldn't be: set hw.snd.pcm0.bufffersize=N This doesn't work either. No error --- it just ignores the setting. in accordance with other variables in /boot/loader.help. OTOH, there was a note in /sys/i386/isa/sound/sound_config.h (as of March) that refers to using make config to change the DSP_BUFFERSIZE constant during, I assume, the kernel build operation. As I didn't start using FreeBSD on the desktop until 5.2 came out, I can't say that this is in anyway authoritative, and possibly isn't even helpful, though DSP_BUFFSIZE is not among the options that are setable in the kernel config file and any attempt to set it gives an error when config is run. I'm guessing that the only way to change this is by hacking the header files in the kernel source. Thanks, Sandy ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Changing hw.snd.pcm0.buffersize in 4.10.
Sandy Rutherford wrote: On Mon, 13 Dec 2004 12:03:15 -0600, Kevin D. Kinsey, DaleCo, S.P. [EMAIL PROTECTED] said: I wonder if it wouldn't be: set hw.snd.pcm0.bufffersize=N This doesn't work either. No error --- it just ignores the setting. in accordance with other variables in /boot/loader.help. OTOH, there was a note in /sys/i386/isa/sound/sound_config.h (as of March) that refers to using make config to change the DSP_BUFFERSIZE constant during, I assume, the kernel build operation. As I didn't start using FreeBSD on the desktop until 5.2 came out, I can't say that this is in anyway authoritative, and possibly isn't even helpful, though DSP_BUFFSIZE is not among the options that are setable in the kernel config file and any attempt to set it gives an error when config is run. I'm guessing that the only way to change this is by hacking the header files in the kernel source. Thanks, Sandy Yea, I got my old laptop out that has 4.10 on it and I was rooting around in the src and found that, I tried everywitch way to get it to work in the kernel file but It nerver did work (config always bitched at me), I tried it also like this make DSP_BUFFERSIZE=16384 depend make DSP_BUFFERSIZE=16384 make DSP_BUFFERSIZE=16384 install. this did not pruduce any errors but it didn't do anything ether, it skipped over the sound stuff as if there was no change, also I tried hard coding it it in sound_config.h but again same effect (maybe I did it wrong, i'm not a programmer), maybe you have to do a complete rebuild of the kernel and I did not try that because this laptop is only a P100 with 40MB Ram. also I found refrences to bufsz from /dev/sndstat so I tried adding it to the kernel config file like this device sbc0 at isa? port 0x220 irq 10 drq 1 bufsz 16384 and config didn't like that (I never tried it with device pcm tho?) stumbleine# more /dev/sndstat FreeBSD Audio Driver (newpcm) pcm0: ESS 0 DSP at io 0x220 irq 10 drq 1 bufsz 4096 (1p/1r/0v channels duplex) also reading the man pages for loader.conf , loader.4th, loader, and reading LINT help a bit., also there is a device.hints under /boot that loader reads so I tried adding it there as hint.pcm.0.buffersize=16384 but this did not work, it did tho add it as a loader environment variable (used show at the loader prompt). I also tried setting at the loader prompt hw.snd.pcm0.buffersize=16384 and again no deal, also helpful was setting verbose_loading=YES into loader.conf. in all here is everything I tried with loader.conf: set hw.snd.pcm0.buffersize=3D16384 sh sysctl hw.snd.pcm0.buffersize=16384 sysctl hw.snd.pcm0.buffersize=16384 set hw.snd.pcm0.buffersize=8192 set hw.snd.pcm0.buffersize=8192 set hw.snd.pcm.0.buffersize=8192 set hw.snd.pcm.0.buffersize=8192 hw.snd.pcm0.buffersize=8192 hw.snd.pcm0.buffersize=8192 hint.pcm.0.buffersize=8192 Id like to get some input from a kernel hack or guru, and maybe you should cross post this in the freebsd-multimedia, freebsd-hackers, and/or freebsd-hardware mailling lists and I can not find anything relevant in my google / google groups searches about this problem, at this point I think it would just be easyer to upgrade to 5.3 (your comp will handle it, I have it running on a dual PII 366 system) to set the stupid thing. this might help (but its for linux): http://www.geocities.com/Hollywood/3709/kernelhack.html and this looks interesting: http://www.freebsd.org/cgi/query-pr.cgi?pr=5359 also the only stuff I can find about DSP_BUFFSIZE, buffer stuff is from Matthew Dillon (dillon at backplane.com), maybe you should give him a buzz ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Changing hw.snd.pcm0.buffersize in 4.10.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tuesday 14 December 2004 23:46, Nikolas Britton wrote: Sandy Rutherford wrote: [...] I wonder if it wouldn't be: set hw.snd.pcm0.bufffersize=N This doesn't work either. No error --- it just ignores the setting. This only works, if the driver supports it. To load loader environmental variables something like TUNABLE_INT(hw.snd.pcmN.buffersize, ...) should show up in the driver code: % cd /usr/src/sys/dev/sound/ cat `ls` | grep TUNABLE_ % cd /usr/src/sys/dev/sound/isa cat `ls` | grep TUNABLE_ % cd /usr/src/sys/dev/sound/pci cat `ls` | grep TUNABLE_ % cd /usr/src/sys/dev/sound/pcm cat `ls` | grep TUNABLE_ TUNABLE_INT(hw.snd.targetirqrate, chn_targetirqrate); TUNABLE_INT(hw.snd.verbose, sndstat_verbose); TUNABLE_INT_DECL(hw.snd.verbose, 1, sndstat_verbose); TUNABLE_INT(hw.snd.unit, snd_unit); TUNABLE_INT(hw.snd.maxautovchans, snd_maxautovchans); % cd /usr/src/sys/dev/sound/usb cat `ls` | grep TUNABLE_ This means only the tuneables hw.snd.targetirqrate, hw.snd.verbose, hw.snd.unit and hw.snd.maxautovchans are retrieved from the loader environment at boot time by the pcm driver. (I took this from the sources of the RELENG_*5* branch on my system) [...] Yea, I got my old laptop out that has 4.10 on it and I was rooting around in the src and found that, I tried everywitch way to get it to work in the kernel file but It nerver did work (config always bitched at me), I tried it also like this make DSP_BUFFERSIZE=16384 depend make DSP_BUFFERSIZE=16384 make DSP_BUFFERSIZE=16384 install. this did not pruduce any errors but it didn't do anything ether, it skipped over the sound stuff as if there was no change, also I tried hard coding it it in sound_config.h but again same effect (maybe I did it wrong, i'm not a programmer), maybe you have to do a complete rebuild of the kernel and I did not try that because this laptop is only a P100 with 40MB Ram. also I found refrences to bufsz from /dev/sndstat so I tried adding it to the kernel config file like this device sbc0 at isa? port 0x220 irq 10 drq 1 bufsz 16384 and config didn't like that (I never tried it with device pcm tho?) AFAIK the define is named DSP_BUFFSIZE (in src/sys/dev/sound/pcm/sound.h. DSP_BUFFSIZE can be used to define the default buffersize for sound drivers, but most of the sound drivers use their own defines. If you want to change the default buffersize for a sound driver you need to search for a define like xxx_BUFFSIZE, where xxx is the name of the sound driver (maybe some developers use other naming-conventions). ie., if you want to change the default buffersize of the ESS driver you need to change the line #define ESS_BUFFSIZE (4096) in src/sys/dev/sound/isa/ess.c. If you use the sbc driver, you need to do this changes in sb8.c or sb16.c, depending on the soundcard you are using. sbc.c is only the code for the corresponding bridge driver. However, I'm not a guru, so I can't guess, if a driver works better with any other buffer size defined, than the original one. - -- Christian Hiris [EMAIL PROTECTED] | OpenPGP KeyID 0x3BCA53BE OpenPGP-Key at hkp://wwwkeys.eu.pgp.net and http://pgp.mit.edu -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBv9zz09WjGjvKU74RAtNOAJ4wAZwaRAC3cGywvLB9fGftObId0ACdGGGh nCoW63okjf5L5LRPyidM2JA= =R3es -END PGP SIGNATURE- ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Changing hw.snd.pcm0.buffersize in 4.10.
In FreeBSD 5.3 you can change the buffersize by adding hint.pcm.0.buffersize=foo to /boot/loader.conf, have you try'ed this with 4.x? Sandy Rutherford wrote: Is it possible to change the sysctl variable hw.snd.pcm0.buffersize (DMA buffer size for the soundcard) in FreeBSD 4.10? I know that in 5.x this is changed in devices.hints. I'm guessing that something in the kernel config file will do the job, but haven't been able to figure out what. I am trying to increase the buffersize to get rid of little skips in the playback, which I believe are caused by underruns. Thanks, Sandy ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Changing hw.snd.pcm0.buffersize in 4.10.
Sandy Rutherford wrote: Is it possible to change the sysctl variable hw.snd.pcm0.buffersize (DMA buffer size for the soundcard) in FreeBSD 4.10? I know that in 5.x this is changed in devices.hints. I'm guessing that something in the kernel config file will do the job, but haven't been able to figure out what. I am trying to increase the buffersize to get rid of little skips in the playback, which I believe are caused by underruns. Thanks, Sandy } Nikolas Britton wrote: } In FreeBSD 5.3 you can change the buffersize by adding } hint.pcm.0.buffersize=foo to /boot/loader.conf, have you try'ed this with 4.x? I wonder if it wouldn't be: set hw.snd.pcm0.bufffersize=N in accordance with other variables in /boot/loader.help. OTOH, there was a note in /sys/i386/isa/sound/sound_config.h (as of March) that refers to using make config to change the DSP_BUFFERSIZE constant during, I assume, the kernel build operation. As I didn't start using FreeBSD on the desktop until 5.2 came out, I can't say that this is in anyway authoritative, and possibly isn't even helpful, though #uptime 11:57AM up 213 days, 21:35, 1 user, load averages: 0.00, 0.00, 0.00 I think I need to go update that box Kevin Kinsey ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Changing hw.snd.pcm0.buffersize in 4.10.
On Mon, 13 Dec 2004 09:59:51 -0600, Nikolas Britton [EMAIL PROTECTED] said: In FreeBSD 5.3 you can change the buffersize by adding hint.pcm.0.buffersize=foo to /boot/loader.conf, have you try'ed this with 4.x? Yes. Here are the contents of my /boot/loader.conf file: [szamoca:6] cat /boot/loader.conf # -- sysinstall generated deltas -- # userconfig_script_load=YES hint.pcm.0.buffersize=8192 However, [szamoca:7] sysctl -a | grep snd hw.snd.targetirqrate: 32 hw.snd.report_soft_formats: 1 hw.snd.verbose: 1 hw.snd.maxautovchans: 0 hw.snd.pcm0.buffersize: 4096 hw.snd.pcm0.vchans: 4 So it seems to have ignored the entry in loader.conf. No errors or warnings were generated during boot. It just ignored the entry. Also, here is my /dev/sndstat: [szamoca:8] cat /dev/sndstat FreeBSD Audio Driver (newpcm) Installed devices: pcm0: SB16 DSP 4.02 at io 0x220 irq 5 drq 1:0 bufsz 4096d (1p/1r/4v channels duplex) Also, [szamoca:9] uname -a FreeBSD szamoca.krvarr.bc.ca 4.10-RELEASE FreeBSD 4.10-RELEASE #35: Sat Sep 18 02:19:02 PDT 2004 [EMAIL PROTECTED]:/usr/src/sys/compile/SZAMOCA i386 Sandy Rutherford wrote: Is it possible to change the sysctl variable hw.snd.pcm0.buffersize (DMA buffer size for the soundcard) in FreeBSD 4.10? I know that in 5.x this is changed in devices.hints. I'm guessing that something in the kernel config file will do the job, but haven't been able to figure out what. Thanks, Sandy ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Changing hw.snd.pcm0.buffersize in 4.10.
Sandy Rutherford wrote: On Mon, 13 Dec 2004 09:59:51 -0600, Nikolas Britton [EMAIL PROTECTED] said: In FreeBSD 5.3 you can change the buffersize by adding hint.pcm.0.buffersize=foo to /boot/loader.conf, have you try'ed this with 4.x? Yes. Here are the contents of my /boot/loader.conf file: [szamoca:6] cat /boot/loader.conf # -- sysinstall generated deltas -- # userconfig_script_load=YES hint.pcm.0.buffersize=8192 I'm not sure if it makes a difference but 8192 is not in quotes like I have in my working example and man device.hints says it should look like this: hint.driver.unit.keyword=value, also, have you tried playing with targetirqrate? http://www.freebsd.org/cgi/man.cgi?query=sndapropos=0sektion=0manpath=FreeBSD+5.3-RELEASE+and+Portsformat=html spectra# more /boot/loader.conf ## Video Support nvidia_load=YES linux_load=YES #vesa_load=YES ## Sound Support #sound_load=YES #snd_emu10k1_load=YES #snd_driver_load=YES hw.snd.maxautovchans=4 hw.snd.targetirqrate=48 hint.pcm.0.buffersize=8192 ## Misc. loader_color=YES #Color Boot Menu spectra# sysctl hw.snd hw.snd.targetirqrate: 48 hw.snd.report_soft_formats: 1 hw.snd.verbose: 1 hw.snd.unit: 0 hw.snd.maxautovchans: 4 hw.snd.pcm0.buffersize: 8192 hw.snd.pcm0.vchans: 0 However, [szamoca:7] sysctl -a | grep snd hw.snd.targetirqrate: 32 hw.snd.report_soft_formats: 1 hw.snd.verbose: 1 hw.snd.maxautovchans: 0 hw.snd.pcm0.buffersize: 4096 hw.snd.pcm0.vchans: 4 So it seems to have ignored the entry in loader.conf. No errors or warnings were generated during boot. It just ignored the entry. Also, here is my /dev/sndstat: [szamoca:8] cat /dev/sndstat FreeBSD Audio Driver (newpcm) Installed devices: pcm0: SB16 DSP 4.02 at io 0x220 irq 5 drq 1:0 bufsz 4096d (1p/1r/4v channels duplex) Also, [szamoca:9] uname -a FreeBSD szamoca.krvarr.bc.ca 4.10-RELEASE FreeBSD 4.10-RELEASE #35: Sat Sep 18 02:19:02 PDT 2004 [EMAIL PROTECTED]:/usr/src/sys/compile/SZAMOCA i386 Sandy Rutherford wrote: Is it possible to change the sysctl variable hw.snd.pcm0.buffersize (DMA buffer size for the soundcard) in FreeBSD 4.10? I know that in 5.x this is changed in devices.hints. I'm guessing that something in the kernel config file will do the job, but haven't been able to figure out what. Thanks, Sandy ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Changing hw.snd.pcm0.buffersize in 4.10.
On Mon, 13 Dec 2004 21:08:02 -0600, Nikolas Britton [EMAIL PROTECTED] said: I'm not sure if it makes a difference but 8192 is not in quotes like I have in my working example and man device.hints says it should look like this: hint.driver.unit.keyword=value, I added the quotes, but still: [szamoca:6] cat /boot/loader.conf # -- sysinstall generated deltas -- # userconfig_script_load=YES hint.pcm.0.buffersize=8192 [szamoca:7] sysctl -a | grep snd hw.snd.targetirqrate: 32 hw.snd.report_soft_formats: 1 hw.snd.verbose: 1 hw.snd.maxautovchans: 0 hw.snd.pcm0.buffersize: 4096 hw.snd.pcm0.vchans: 4 [szamoca:8] cat /dev/sndstat FreeBSD Audio Driver (newpcm) Installed devices: pcm0: SB16 DSP 4.02 at io 0x220 irq 5 drq 1:0 bufsz 4096d (1p/1r/4v channels duplex) So no change. Also, in 4.10: [szamoca:9] man device.hints No manual entry for device.hints So perhaps device.hints is not supported in 4.10. also, have you tried playing with targetirqrate? Yes, quite a bit. I set hw.snd.verbose to 2 and compiled stats for hw.snd.targetirqrate set to 16, 24, 32, 48, and 64. There was no effect to either the perceived sound quality or the rate of underruns reported by sndstat. BTW, if it makes any difference, this is an SMP machine --- albeit an older one. It has 2 x PII 300MHZ. Thanks, Sandy ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]