Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ossaudiodev: use _Py_read and _Py_write with the Py_buffer #67897

Closed
vstinner opened this issue Mar 19, 2015 · 5 comments
Closed

Refactor ossaudiodev: use _Py_read and _Py_write with the Py_buffer #67897

vstinner opened this issue Mar 19, 2015 · 5 comments

Comments

@vstinner
Copy link
Member

BPO 23709
Nosy @pitrou, @vstinner
Dependencies
  • bpo-23708: PEP 475: Add _Py_read() and _Py_write() functions
  • Files
  • ossaudiodev.patch
  • ossaudiodev-py_buffer.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2015-03-20.09:40:21.099>
    created_at = <Date 2015-03-19.13:36:49.351>
    labels = []
    title = 'Refactor ossaudiodev: use _Py_read and _Py_write with the Py_buffer'
    updated_at = <Date 2015-03-20.09:40:21.099>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2015-03-20.09:40:21.099>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-03-20.09:40:21.099>
    closer = 'vstinner'
    components = []
    creation = <Date 2015-03-19.13:36:49.351>
    creator = 'vstinner'
    dependencies = ['23708']
    files = ['38559', '38571']
    hgrepos = []
    issue_num = 23709
    keywords = ['patch']
    message_count = 5.0
    messages = ['238516', '238520', '238584', '238585', '238629']
    nosy_count = 4.0
    nosy_names = ['pitrou', 'vstinner', 'neologix', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue23709'
    versions = ['Python 3.5']

    @vstinner
    Copy link
    Member Author

    Attached patch enhances ossaudiodev to support buffer larger than 2 GB (replace the C int type with C Py_ssize_t). It uses the new _Py_read() and _Py_write() functions added in the issue bpo-23708 with the Py_buffer API.

    By the way, I don't understand the purpose of the input and output counters (icount and ocount fields of the oss_audio_t structure), they don't look to be used?!

    @vstinner
    Copy link
    Member Author

    Oh, I forgot to mention the advantage of using _Py_read() and _Py_write(): they retry read/write when interrupted by a signal, to support the PEP-475.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 19, 2015

    New changeset d564695b67bb by Victor Stinner in branch 'default':
    Issue bpo-23709: The ossaudiodev module now retries read/write when interrupted by
    https://hg.python.org/cpython/rev/d564695b67bb

    @vstinner
    Copy link
    Member Author

    I commited changes to use _Py_read() and _Py_write().

    I attach an updated patch to use Py_ssize_t instead of int, and to use Py_buffer instead of char*.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 20, 2015

    New changeset d478a2a5738a by Victor Stinner in branch 'default':
    Issue bpo-23709, bpo-23001: ossaudiodev now uses Py_ssize_t for sizes instead of int
    https://hg.python.org/cpython/rev/d478a2a5738a

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant