larsimmisch / pyalsaaudio

ALSA wrappers for Python
http://larsimmisch.github.io/pyalsaaudio/
Other
214 stars 74 forks source link

First version documentation PCM.info() method. #119

Closed RonaldAJ closed 1 year ago

RonaldAJ commented 1 year ago

Should this text also go into the doc-string? Also dumpinfo is not working for me, but I guess that for a working dumpinfo we can reference info for the details.

RonaldAJ commented 1 year ago

There is one exception where the name in the dict is different from the keyword. The dict returned by info contains the key "name", where the corresponding keyword is "device". This might be a reason to change "name" to "device_name". And perhaps add an option to retrieve the device index if that is possible.

RonaldAJ commented 1 year ago

I stand corrected the dumpinfo is printed to the terminal from which I started Jupyter.

RonaldAJ commented 1 year ago

This website https://livesphinx.herokuapp.com/ allowed me to edit the rst file interactively.

larsimmisch commented 1 year ago

There is one exception where the name in the dict is different from the keyword. The dict returned by info contains the key "name", where the corresponding keyword is "device". This might be a reason to change "name" to "device_name". And perhaps add an option to retrieve the device index if that is possible.

I'd maybe rename name to device or leave it as it is - device_name is a bit clunky and I'd sort-of expect name or device.

The index would be nice - if possible I'd always include it

larsimmisch commented 1 year ago

Should this text also go into the doc-string? Also dumpinfo is not working for me, but I guess that for a working dumpinfo we can reference info for the details.

What about just linking to the documentation?

BTW, I think dumpinfo is a bit of a hack.

RonaldAJ commented 1 year ago

Should this text also go into the doc-string? Also dumpinfo is not working for me, but I guess that for a working dumpinfo we can reference info for the details.

What about just linking to the documentation?

Straight to PCM objects documentation: http://larsimmisch.github.io/pyalsaaudio/libalsaaudio.html#pcm-objects ?

BTW, I think dumpinfo is a bit of a hack.

So dumpinfo can remain undocumented?

RonaldAJ commented 1 year ago

If I commit will it still be added to the pull request now it is approved?

larsimmisch commented 1 year ago

Straight to PCM objects documentation: http://larsimmisch.github.io/pyalsaaudio/libalsaaudio.html#pcm-objects ?

Yes, with https.

So dumpinfo can remain undocumented?

Yeah.

If I commit will it still be added to the pull request now it is approved?

It should be enough to just push to your branch (that's the way it works within the same fork, in any case)

RonaldAJ commented 1 year ago

Produced dictionary now includes info on the card, device and subdevice indices. Updated in the documentation as well. There is more available, but I am not sure what is valuable and what is not: https://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m___info.html

Added: card_no index of card integer (negative indicates device not associable with a card) device_no index of PCM device integer subdevice_no index of PCM subdevice integer

I convinced myself memory management is OK. But you caught me on memory leaks before.