emu10k1: add per-voice PTR register dump to /proc entry
PATCH 1/1 emu10k1: add per-voice PTR register dump to /proc entry
Summary: This patch adds a register dump for each voice to the /proc entry. This functionality will be key for improving the voice allocator for multichannel support. Currently these all go in the main file; I can split these into a file per voice if desired.
Sample output for an idle (15) and running (16) voice:
Voice 15 PTR registers
PTR 0x0 0x0
PTR 0x1 0x0
PTR 0x2 0xffff
PTR 0x3 0xffff
PTR 0x4 0x0
PTR 0x5 0x0
PTR 0x6 0x0
PTR 0x7 0x10
PTR 0x8 0x0
PTR 0x9 0x400000
PTR 0xa 0x32101000
PTR 0xb 0x32101000
PTR 0xc 0x31d3fff
PTR 0xd 0x31d3fff
PTR 0xe 0x33ea901
PTR 0xf 0x33ea901
PTR 0x10 0x0
PTR 0x11 0x0
PTR 0x12 0x0
PTR 0x13 0x0
PTR 0x14 0x0
PTR 0x15 0x0
PTR 0x16 0x0
PTR 0x17 0x0
PTR 0x18 0x0
PTR 0x19 0xffff
PTR 0x1a 0x0
PTR 0x1b 0x0
PTR 0x1c 0x18
PTR 0x1d 0x18
PTR 0x1e 0x0
PTR 0x1f 0x0
PTR 0x20 0x0
PTR 0x21 0x0
PTR 0x22 0x0
PTR 0x23 0x0
PTR 0x24 0x0
PTR 0x25 0x0
PTR 0x26 0x0
PTR 0x27 0x0
PTR 0x28 0x0
PTR 0x29 0x0
PTR 0x2a 0x0
PTR 0x2b 0x0
PTR 0x2c 0x0
PTR 0x2d 0x0
PTR 0x2e 0x0
PTR 0x2f 0x0
PTR 0x30 0x0
PTR 0x31 0x0
PTR 0x32 0x0
PTR 0x33 0x0
PTR 0x34 0x0
PTR 0x35 0x0
PTR 0x36 0x0
PTR 0x37 0x0
PTR 0x38 0x0
PTR 0x39 0x0
PTR 0x3a 0x0
PTR 0x3b 0x0
PTR 0x3c 0x0
PTR 0x3d 0x0
PTR 0x3e 0x0
PTR 0x3f 0x0
Voice 16 PTR registers
PTR 0x0 0x3acdbe58
PTR 0x1 0x3acdff00
PTR 0x2 0xffffffff
PTR 0x3 0xffffffff
PTR 0x4 0xaf00
PTR 0x5 0xff00
PTR 0x6 0x400
PTR 0x7 0x4400
PTR 0x8 0x2002521
PTR 0x9 0x2e91000
PTR 0xa 0x32104400
PTR 0xb 0x32104400
PTR 0xc 0x63f4009
PTR 0xd 0x31d3fff
PTR 0xe 0x73ea901
PTR 0xf 0x73ea901
PTR 0x10 0x0
PTR 0x11 0x7f7f
PTR 0x12 0x7f7f
PTR 0x13 0x8000
PTR 0x14 0x8000
PTR 0x15 0x0
PTR 0x16 0x7f
PTR 0x17 0x8000
PTR 0x18 0xde0b
PTR 0x19 0xff
PTR 0x1a 0x7f
PTR 0x1b 0x0
PTR 0x1c 0x0
PTR 0x1d 0x0
PTR 0x1e 0x0
PTR 0x1f 0x0
PTR 0x20 0x2d002d
PTR 0x21 0x220022
PTR 0x22 0x2f002f
PTR 0x23 0x2f002f
PTR 0x24 0x2d002d
PTR 0x25 0x2a002a
PTR 0x26 0x270027
PTR 0x27 0x170017
PTR 0x28 0x2f002f
PTR 0x29 0x2a002a
PTR 0x2a 0x2d002d
PTR 0x2b 0x2d002d
PTR 0x2c 0x2f002f
PTR 0x2d 0x270027
PTR 0x2e 0x2d002d
PTR 0x2f 0x320032
PTR 0x30 0x2d002d
PTR 0x31 0x220022
PTR 0x32 0x2f002f
PTR 0x33 0x2f002f
PTR 0x34 0x2d002d
PTR 0x35 0x2a002a
PTR 0x36 0x270027
PTR 0x37 0x170017
PTR 0x38 0x2f002f
PTR 0x39 0x2a002a
PTR 0x3a 0x2d002d
PTR 0x3b 0x2d002d
PTR 0x3c 0x2f002f
PTR 0x3d 0x270027
PTR 0x3e 0x2d002d
PTR 0x3f 0x320032
Index: alsa-kernel/pci/emu10k1/emuproc.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/emu10k1/emuproc.c,v retrieving revision 1.21
pci/emu10k1/emuproc.c +13 -2
@@ -178,7 +178,7 @@unsigned int val;int nefx = emu->audigy ?64 :32 ;char **outputs = emu->audigy ? audigy_outs : creative_outs; -int idx; +int idx, reg;snd_iprintf (buffer,"EMU10K1\n\n" ); val = emu->audigy ?
@@ -219,6 +219,17 @@snd_iprintf (buffer,"\nZoomed Video\n" );snd_iprintf (buffer,"Rate Locked : %s\n" , val &SRCS_RATELOCKED ?"on" :"off" );snd_iprintf (buffer,"Estimated Sample Rate : 0x%x\n" , val &SRCS_ESTSAMPLERATE ); + +// per-voice parameters +for (idx =0 ; idx <NUM_G ; idx++) { +snd_iprintf (buffer,"\nVoice %i PTR registers\n" , idx); +for (reg =0x0 ; reg <0x40 ; reg++) { +snd_iprintf (buffer,"PTR 0x%x 0x%x\n" , + reg, +snd_emu10k1_ptr_read (emu, reg, idx)); + } + } + } static void snd_emu10k1_proc_acode_read(snd_info_entry_t *entry,
@@ -318,7 +329,7 @@snd_info_entry_t *entry;if (!snd_card_proc_new (emu->card,"emu10k1" , &entry)) -snd_info_set_text_ops (entry, emu,1024 , snd_emu10k1_proc_read); +snd_info_set_text_ops (entry, emu,65536 , snd_emu10k1_proc_read);if (!snd_card_proc_new (emu->card,"fx8010_gpr" , &entry)) { entry->content =SNDRV_INFO_CONTENT_DATA ;
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
At Sat, 13 Nov 2004 20:01:26 -0500,
Quoted 5 lines · Lee Revell
Summary: This patch adds a register dump for each voice to the /proc entry. This functionality will be key for improving the voice allocator for multichannel support. Currently these all go in the main file; I can split these into a file per voice if desired.
I feel it'd be better to create another proc file. Not necessarily per voice, though. The dump seems not matching with the current emu10k1 proc file contents.
Also, could you use tab for indentation?
thanks,
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
Quoted 12 lines · Takashi Iwai
At Sat, 13 Nov 2004 20:01:26 -0500,
Quoted 5 lines · Lee Revell
Summary: This patch adds a register dump for each voice to the /proc entry. This functionality will be key for improving the voice allocator for multichannel support. Currently these all go in the main file; I can split these into a file per voice if desired.
I feel it'd be better to create another proc file. Not necessarily per voice, though. The dump seems not matching with the current emu10k1 proc file contents.
Sure, will do. One file per voice for the PTR registers (and one file for FN0) might actually be most useful. This way you can diff them.
Quoted 2 lines
Also, could you use tab for indentation?
No problem, I will update my editor settings.
Also, James, I forgot you were the emu10k1 maintainer, I will cc: you on future patches.
Lee
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
At Wed, 17 Nov 2004 11:31:01 -0500,
Quoted 10 lines · Lee Revell
Quoted 8 lines · Takashi Iwai
At Sat, 13 Nov 2004 20:01:26 -0500,
Quoted 5 lines · Lee Revell
Summary: This patch adds a register dump for each voice to the /proc entry. This functionality will be key for improving the voice allocator for multichannel support. Currently these all go in the main file; I can split these into a file per voice if desired.
Quoted 7 lines
Quoted 4 lines
I feel it'd be better to create another proc file. Not necessarily per voice, though. The dump seems not matching with the current emu10k1 proc file contents.
Sure, will do. One file per voice for the PTR registers (and one file for FN0) might actually be most useful. This way you can diff them.
Yes, that makes sense.
Quoted 4 lines
Quoted 2 lines
Also, could you use tab for indentation?
No problem, I will update my editor settings.
Thanks.
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
Quoted 9 lines · Takashi Iwai
Quoted 7 lines
Quoted 4 lines
I feel it'd be better to create another proc file. Not necessarily per voice, though. The dump seems not matching with the current emu10k1 proc file contents.
Sure, will do. One file per voice for the PTR registers (and one file for FN0) might actually be most useful. This way you can diff them.
Yes, that makes sense.
How do I create a new directory under /proc/asound/my_card? Cresting a file is easy, but I cannot find an example of a driver that creates a directory and populates it.
Lee
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
Quoted 6 lines · Takashi Iwai
Quoted 3 lines
Sure, will do. One file per voice for the PTR registers (and one file for FN0) might actually be most useful. This way you can diff them.
Yes, that makes sense.
OK regarding the previous message, I figured out how to create a directory under the card root (just set S_IFDIR). However there is no way to create files under that directory because snd_card_proc_new makes the following assumption (from alsa-kernel/core/info.c):
852 *
853 * The parent is assumed as card->proc_root.
854 *So, I think the API has to be modified to allow a parent to be specified.
Lee
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
At Fri, 19 Nov 2004 19:10:24 -0500,
Quoted 14 lines · Lee Revell
Quoted 6 lines · Takashi Iwai
Quoted 3 lines
Sure, will do. One file per voice for the PTR registers (and one file for FN0) might actually be most useful. This way you can diff them.
Yes, that makes sense.
OK regarding the previous message, I figured out how to create a directory under the card root (just set
S_IFDIR). However there is no way to create files under that directory becausesnd_card_proc_newmakes the following assumption (fromalsa-kernel/core/info.c):
Quoted 6 lines
852 * 853 * The parent is assumed as card->proc_root. 854 *So, I think the API has to be modified to allow a parent to be specified.
snd_card_proc_new() is just a helper function.
When creating a subdirectory and files under it, you have to manage the instaces by yourself (i.e. requires a proper destructor).
An example is found in pci/ac97/ac97_proc.c.
Takashi
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
Quoted 12 lines · Takashi Iwai
At Sat, 13 Nov 2004 20:01:26 -0500,
Quoted 5 lines · Lee Revell
Summary: This patch adds a register dump for each voice to the /proc entry. This functionality will be key for improving the voice allocator for multichannel support. Currently these all go in the main file; I can split these into a file per voice if desired.
I feel it'd be better to create another proc file. Not necessarily per voice, though. The dump seems not matching with the current emu10k1 proc file contents.
Hey, it looks like if I write routines to dump all registers, then suspend/resume is halfway finished, right?
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=227
Lee
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
At Wed, 17 Nov 2004 12:51:29 -0500,
Quoted 15 lines · Lee Revell
Quoted 12 lines · Takashi Iwai
At Sat, 13 Nov 2004 20:01:26 -0500,
Quoted 5 lines · Lee Revell
Summary: This patch adds a register dump for each voice to the /proc entry. This functionality will be key for improving the voice allocator for multichannel support. Currently these all go in the main file; I can split these into a file per voice if desired.
I feel it'd be better to create another proc file. Not necessarily per voice, though. The dump seems not matching with the current emu10k1 proc file contents.
Quoted 4 lines
Hey, it looks like if I write routines to dump all registers, then suspend/resume is halfway finished, right?
Well, yes, halfway :)
We should call snd_pcm_suspend_all() to suspend the PCM streams, then save the necessary registers, and stop the hardware.
In the resume, start the hardware, restore the registers, resume the mixer (e.g. call snd_ac97_resume()).
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8